nps_sdk 1.1.11 → 1.1.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/nps/utils.rb +73 -4
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bf903f566173e68bdbebdf79e252938f4adebf84
4
- data.tar.gz: c44af7b345a6e59202580ab664e99ba44dd01753
3
+ metadata.gz: 5bc6eab2ff4612e61d818cbeddb07fbea6a7693d
4
+ data.tar.gz: c1f9ad18f33503639ec723ff384a7eb0675d74da
5
5
  SHA512:
6
- metadata.gz: bad17b8b17aefc7cb0ce99ee3cf6497fa60a3abd3b3229b99d4dda57526da00fe60a30928aa8f13de2275cebfb68360427e3e4139b14aa62ffc1fa6d4a86cbdd
7
- data.tar.gz: 968710e38efc363c0a4c69892c493b1dcf421dfe7651cb904d98cde0bc594dbfbbf3e25ebdfe71f5239bb3cb05122c9ae28db706d8d86920d51d703aabf2c69d
6
+ metadata.gz: 99edc54b1fca224d74ab50c65347802fa67fe12337dc803a2743a12e672bf740aa9cf4cd7479d6ba60aa69fb7c4b4c0f910917c3fa41fa1776a35de3ddac07f9
7
+ data.tar.gz: fc15552f11ba0ba6b1fabe19bffcfa38e924d5bf0d68735d2c4382bbdf15fe0d71648e734b46be6c0db01835b219a37cad9cbf44e5e154d330d0db68adc4276a
data/lib/nps/utils.rb CHANGED
@@ -5,10 +5,78 @@ module Nps
5
5
  CACHE_TTL = 1
6
6
  TIMEOUT = 90
7
7
 
8
+ SANITIZE = {
9
+ 'psp_Person.FirstName.max_length' => '128',
10
+ 'psp_Person.LastName.max_length' => '64',
11
+ 'psp_Person.MiddleName.max_length' => '64',
12
+ 'psp_Person.PhoneNumber1.max_length' => '32',
13
+ 'psp_Person.PhoneNumber2.max_length' => '32',
14
+ 'psp_Person.Gender.max_length' => '1',
15
+ 'psp_Person.Nationality.max_length' => '3',
16
+ 'psp_Person.IDNumber.max_length' => '40',
17
+ 'psp_Person.IDType.max_length' => '5',
18
+ 'psp_Address.Street.max_length' => '128',
19
+ 'psp_Address.HouseNumber.max_length' => '32',
20
+ 'psp_Address.AdditionalInfo.max_length' => '128',
21
+ 'psp_Address.City.max_length' => '40',
22
+ 'psp_Address.StateProvince.max_length' => '40',
23
+ 'psp_Address.Country.max_length' => '3',
24
+ 'psp_Address.ZipCode.max_length' => '10',
25
+ 'psp_OrderItem.Description.max_length' => '127',
26
+ 'psp_OrderItem.Type.max_length' => '20',
27
+ 'psp_OrderItem.SkuCode.max_length' => '48',
28
+ 'psp_OrderItem.ManufacturerPartNumber.max_length' => '30',
29
+ 'psp_OrderItem.Risk.max_length' => '1',
30
+ 'psp_Leg.DepartureAirport.max_length' => '3',
31
+ 'psp_Leg.ArrivalAirport.max_length' => '3',
32
+ 'psp_Leg.CarrierCode.max_length' => '2',
33
+ 'psp_Leg.FlightNumber.max_length' => '5',
34
+ 'psp_Leg.FareBasisCode.max_length' => '15',
35
+ 'psp_Leg.FareClassCode.max_length' => '3',
36
+ 'psp_Leg.BaseFareCurrency.max_length' => '3',
37
+ 'psp_Passenger.FirstName.max_length' => '50',
38
+ 'psp_Passenger.LastName.max_length' => '30',
39
+ 'psp_Passenger.MiddleName.max_length' => '30',
40
+ 'psp_Passenger.Type.max_length' => '1',
41
+ 'psp_Passenger.Nationality.max_length' => '3',
42
+ 'psp_Passenger.IDNumber.max_length' => '40',
43
+ 'psp_Passenger.IDType.max_length' => '10',
44
+ 'psp_Passenger.IDCountry.max_length' => '3',
45
+ 'psp_Passenger.LoyaltyNumber.max_length' => '20',
46
+ 'psp_SellerDetails.IDNumber.max_length' => '40',
47
+ 'psp_SellerDetails.IDType.max_length' => '10',
48
+ 'psp_SellerDetails.Name.max_length' => '128',
49
+ 'psp_SellerDetails.Invoice.max_length' => '32',
50
+ 'psp_SellerDetails.PurchaseDescription.max_length' => '32',
51
+ 'psp_SellerDetails.MCC.max_length' => '5',
52
+ 'psp_SellerDetails.ChannelCode.max_length' => '3',
53
+ 'psp_SellerDetails.GeoCode.max_length' => '5',
54
+ 'psp_TaxesRequest.TypeId.max_length' => '5',
55
+ 'psp_MerchantAdditionalDetails.Type.max_length' => '1',
56
+ 'psp_MerchantAdditionalDetails.SdkInfo.max_length' => '48',
57
+ 'psp_MerchantAdditionalDetails.ShoppingCartInfo.max_length' => '48',
58
+ 'psp_MerchantAdditionalDetails.ShoppingCartPluginInfo.max_length' => '48',
59
+ 'psp_CustomerAdditionalDetails.IPAddress.max_length' => '45',
60
+ 'psp_CustomerAdditionalDetails.AccountID.max_length' => '128',
61
+ 'psp_CustomerAdditionalDetails.DeviceFingerPrint.max_length' => '4000',
62
+ 'psp_CustomerAdditionalDetails.BrowserLanguage.max_length' => '2',
63
+ 'psp_CustomerAdditionalDetails.HttpUserAgent.max_length' => '255',
64
+ 'psp_BillingDetails.Invoice.max_length' => '32',
65
+ 'psp_BillingDetails.InvoiceCurrency.max_length' => '3',
66
+ 'psp_ShippingDetails.TrackingNumber.max_length' => '24',
67
+ 'psp_ShippingDetails.Method.max_length' => '3',
68
+ 'psp_ShippingDetails.Carrier.max_length' => '3',
69
+ 'psp_ShippingDetails.GiftMessage.max_length' => '200',
70
+ 'psp_AirlineDetails.TicketNumber.max_length' => '14',
71
+ 'psp_AirlineDetails.PNR.max_length' => '10',
72
+ 'psp_VaultReference.PaymentMethodToken.max_length' => '64',
73
+ 'psp_VaultReference.PaymentMethodId.max_length' => '64',
74
+ 'psp_VaultReference.CustomerId.max_length' => '64'
75
+ }
76
+
8
77
 
9
78
  def self.sanitize(params)
10
- #File.join(File.dirname(File.expand_path(__FILE__)), "/wsdl/" + @wsdl)
11
- myini = IniFile.load(File.join(File.dirname(File.expand_path(__FILE__)), "conf/sanitize_struc.ini"))
79
+ myini = SANITIZE
12
80
  return check_sanitize(params, true, nil, myini)
13
81
  end
14
82
 
@@ -43,11 +111,12 @@ module Nps
43
111
  else
44
112
  key_name = k + ".max_length"
45
113
  end
46
- size = file["global"][key_name]
114
+ size = file[key_name]
47
115
  if size.nil?
48
116
  return value
49
117
  end
50
- return value.to_s.slice(0,size)
118
+
119
+ return value.to_s.slice(0,Integer(size))
51
120
  end
52
121
 
53
122
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nps_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.11
4
+ version: 1.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - soporte@nps.com.ar