@@ -426,7 +426,8 @@ protected function _getXmlQuotes()
426
426
if (!$ service ) {
427
427
$ service = $ r ->getService ();
428
428
}
429
- if ($ r ->getContainer () == 'FLAT RATE BOX ' || $ r ->getContainer () == 'FLAT RATE ENVELOPE ' ) {
429
+
430
+ if (preg_match ('/(FLAT RATE ENVELOPE|FLAT RATE BOX)$/ ' , $ r ->getContainer ())) {
430
431
$ service = 'Priority ' ;
431
432
}
432
433
$ package ->addChild ('Service ' , $ service );
@@ -794,8 +795,15 @@ public function getCode($type, $code = '')
794
795
'first_class_mail_type ' => ['LETTER ' => __ ('Letter ' ), 'FLAT ' => __ ('Flat ' ), 'PARCEL ' => __ ('Parcel ' )],
795
796
'container ' => [
796
797
'VARIABLE ' => __ ('Variable ' ),
797
- 'FLAT RATE BOX ' => __ ('Flat-Rate Box ' ),
798
+ 'SM FLAT RATE BOX ' => __ ('Small Flat-Rate Box ' ),
799
+ 'MD FLAT RATE BOX ' => __ ('Medium Flat-Rate Box ' ),
800
+ 'LG FLAT RATE BOX ' => __ ('Large Flat-Rate Box ' ),
798
801
'FLAT RATE ENVELOPE ' => __ ('Flat-Rate Envelope ' ),
802
+ 'SM FLAT RATE ENVELOPE ' => __ ('Small Flat-Rate Envelope ' ),
803
+ 'WINDOW FLAT RATE ENVELOPE ' => __ ('Window Flat-Rate Envelope ' ),
804
+ 'GIFT CARD FLAT RATE ENVELOPE ' => __ ('Gift Card Flat-Rate Envelope ' ),
805
+ 'LEGAL FLAT RATE ENVELOPE ' => __ ('Legal Flat-Rate Envelope ' ),
806
+ 'PADDED FLAT RATE ENVELOPE ' => __ ('Padded Flat-Rate Envelope ' ),
799
807
'RECTANGULAR ' => __ ('Rectangular ' ),
800
808
'NONRECTANGULAR ' => __ ('Non-rectangular ' ),
801
809
],
@@ -805,104 +813,115 @@ public function getCode($type, $code = '')
805
813
'filters ' => [
806
814
'within_us ' => [
807
815
'method ' => [
808
- 'Priority Mail Express Flat Rate Envelope ' ,
809
- 'Priority Mail Express Flat Rate Envelope Hold For Pickup ' ,
810
- 'Priority Mail Flat Rate Envelope ' ,
811
- 'Priority Mail Large Flat Rate Box ' ,
812
- 'Priority Mail Medium Flat Rate Box ' ,
813
- 'Priority Mail Small Flat Rate Box ' ,
814
- 'Priority Mail Express Hold For Pickup ' ,
815
- 'Priority Mail Express ' ,
816
- 'Priority Mail ' ,
817
- 'Priority Mail Hold For Pickup ' ,
818
- 'Priority Mail Large Flat Rate Box Hold For Pickup ' ,
819
- 'Priority Mail Medium Flat Rate Box Hold For Pickup ' ,
820
- 'Priority Mail Small Flat Rate Box Hold For Pickup ' ,
821
- 'Priority Mail Flat Rate Envelope Hold For Pickup ' ,
822
- 'Priority Mail Small Flat Rate Envelope ' ,
823
- 'Priority Mail Small Flat Rate Envelope Hold For Pickup ' ,
824
- 'First-Class Package Service Hold For Pickup ' ,
825
- 'Retail Ground ' ,
826
- 'Media Mail ' ,
827
- 'First-Class Mail Large Envelope ' ,
828
- 'Priority Mail Express Sunday/Holiday Delivery ' ,
829
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope ' ,
830
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes ' ,
816
+ '13 ' , '27 ' , '16 ' , '22 ' , '17 ' , '28 ' , '2 ' , '3 ' , '1 ' , '33 ' , '34 ' , '35 ' ,
817
+ '36 ' , '37 ' , '42 ' , '43 ' , '53 ' , '4 ' , '6 ' , '15 ' , '23 ' , '25 ' , '57 '
831
818
],
832
819
],
833
820
'from_us ' => [
834
821
'method ' => [
835
- 'Priority Mail Express International Flat Rate Envelope ' ,
836
- 'Priority Mail International Flat Rate Envelope ' ,
837
- 'Priority Mail International Large Flat Rate Box ' ,
838
- 'Priority Mail International Medium Flat Rate Box ' ,
839
- 'Priority Mail International Small Flat Rate Box ' ,
840
- 'Priority Mail International Small Flat Rate Envelope ' ,
841
- 'Priority Mail Express International Flat Rate Boxes ' ,
842
- 'Global Express Guaranteed (GXG) ' ,
843
- 'USPS GXG Envelopes ' ,
844
- 'Priority Mail Express International ' ,
845
- 'Priority Mail International ' ,
846
- 'First-Class Mail International Letter ' ,
847
- 'First-Class Mail International Large Envelope ' ,
848
- 'First-Class Package International Service ' ,
822
+ 'INT_10 ' , 'INT_8 ' , 'INT_11 ' , 'INT_9 ' , 'INT_16 ' , 'INT_20 ' , 'INT_4 ' ,
823
+ 'INT_12 ' , 'INT_1 ' , 'INT_2 ' , 'INT_13 ' , 'INT_14 ' , 'INT_15 '
849
824
],
850
825
],
851
826
],
852
827
],
853
828
[
854
- 'containers ' => ['FLAT RATE BOX ' ],
829
+ 'containers ' => ['SM FLAT RATE BOX ' ],
855
830
'filters ' => [
856
831
'within_us ' => [
857
- 'method ' => [
858
- 'Priority Mail Large Flat Rate Box ' ,
859
- 'Priority Mail Medium Flat Rate Box ' ,
860
- 'Priority Mail Small Flat Rate Box ' ,
861
- 'Priority Mail International Large Flat Rate Box ' ,
862
- 'Priority Mail International Medium Flat Rate Box ' ,
863
- 'Priority Mail International Small Flat Rate Box ' ,
864
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Boxes ' ,
865
- ],
832
+ 'method ' => ['28 ' , '57 ' ],
866
833
],
867
834
'from_us ' => [
868
- 'method ' => [
869
- 'Priority Mail International Large Flat Rate Box ' ,
870
- 'Priority Mail International Medium Flat Rate Box ' ,
871
- 'Priority Mail International Small Flat Rate Box ' ,
872
- 'Priority Mail International DVD Flat Rate priced box ' ,
873
- 'Priority Mail International Large Video Flat Rate priced box ' ,
874
- ],
835
+ 'method ' => ['INT_16 ' , 'INT_24 ' ],
836
+ ],
837
+ ]
838
+ ],
839
+ [
840
+ 'containers ' => ['MD FLAT RATE BOX ' ],
841
+ 'filters ' => [
842
+ 'within_us ' => [
843
+ 'method ' => ['17 ' , '57 ' ],
844
+ ],
845
+ 'from_us ' => [
846
+ 'method ' => ['INT_9 ' , 'INT_24 ' ],
847
+ ],
848
+ ]
849
+ ],
850
+ [
851
+ 'containers ' => ['LG FLAT RATE BOX ' ],
852
+ 'filters ' => [
853
+ 'within_us ' => [
854
+ 'method ' => ['22 ' , '57 ' ],
855
+ ],
856
+ 'from_us ' => [
857
+ 'method ' => ['INT_11 ' , 'INT_24 ' , 'INT_25 ' ],
858
+ ],
859
+ ]
860
+ ],
861
+ [
862
+ 'containers ' => ['SM FLAT RATE ENVELOPE ' ],
863
+ 'filters ' => [
864
+ 'within_us ' => [
865
+ 'method ' => ['42 ' , '43 ' ],
866
+ ],
867
+ 'from_us ' => [
868
+ 'method ' => ['INT_20 ' ],
869
+ ],
870
+ ]
871
+ ],
872
+ [
873
+ 'containers ' => ['WINDOW FLAT RATE ENVELOPE ' ],
874
+ 'filters ' => [
875
+ 'within_us ' => [
876
+ 'method ' => ['40 ' , '41 ' ],
877
+ ],
878
+ 'from_us ' => [
879
+ 'method ' => ['INT_19 ' ],
880
+ ],
881
+ ]
882
+ ],
883
+ [
884
+ 'containers ' => ['GIFT CARD FLAT RATE ENVELOPE ' ],
885
+ 'filters ' => [
886
+ 'within_us ' => [
887
+ 'method ' => ['38 ' , '39 ' ],
888
+ ],
889
+ 'from_us ' => [
890
+ 'method ' => ['INT_18 ' ],
891
+ ],
892
+ ]
893
+ ],
894
+ [
895
+ 'containers ' => ['PADDED FLAT RATE ENVELOPE ' ],
896
+ 'filters ' => [
897
+ 'within_us ' => [
898
+ 'method ' => ['62 ' , '63 ' , '64 ' , '46 ' , '29 ' ],
899
+ ],
900
+ 'from_us ' => [
901
+ 'method ' => ['INT_27 ' , 'INT_23 ' ],
902
+ ],
903
+ ]
904
+ ],
905
+ [
906
+ 'containers ' => ['LEGAL FLAT RATE ENVELOPE ' ],
907
+ 'filters ' => [
908
+ 'within_us ' => [
909
+ 'method ' => ['44 ' , '45 ' , '30 ' , '31 ' , '32 ' ],
910
+ ],
911
+ 'from_us ' => [
912
+ 'method ' => ['INT_17 ' , 'INT_22 ' ],
875
913
],
876
914
]
877
915
],
878
916
[
879
917
'containers ' => ['FLAT RATE ENVELOPE ' ],
880
918
'filters ' => [
881
919
'within_us ' => [
882
- 'method ' => [
883
- 'Priority Mail Flat Rate Envelope ' ,
884
- 'Priority Mail Express Flat Rate Envelope ' ,
885
- 'Priority Mail Express Flat Rate Envelope Hold For Pickup ' ,
886
- 'Priority Mail Flat Rate Envelope ' ,
887
- 'First-Class Mail Large Envelope ' ,
888
- 'Priority Mail Flat Rate Envelope Hold For Pickup ' ,
889
- 'Priority Mail Small Flat Rate Envelope ' ,
890
- 'Priority Mail Small Flat Rate Envelope Hold For Pickup ' ,
891
- 'Priority Mail Express Sunday/Holiday Delivery Flat Rate Envelope ' ,
892
- 'Priority Mail Express Padded Flat Rate Envelope ' ,
893
- ],
920
+ 'method ' => ['16 ' , '13 ' , '27 ' , '16 ' , '15 ' , '37 ' , '42 ' , '43 ' , '25 ' , '62 ' ],
894
921
],
895
922
'from_us ' => [
896
923
'method ' => [
897
- 'Priority Mail Express International Flat Rate Envelope ' ,
898
- 'Priority Mail International Flat Rate Envelope ' ,
899
- 'First-Class Mail International Large Envelope ' ,
900
- 'Priority Mail International Small Flat Rate Envelope ' ,
901
- 'Priority Mail Express International Legal Flat Rate Envelope ' ,
902
- 'Priority Mail International Gift Card Flat Rate Envelope ' ,
903
- 'Priority Mail International Window Flat Rate Envelope ' ,
904
- 'Priority Mail International Legal Flat Rate Envelope ' ,
905
- 'Priority Mail Express International Padded Flat Rate Envelope ' ,
924
+ 'INT_10 ' , 'INT_8 ' , 'INT_14 ' , 'INT_20 ' , 'INT_17 ' , 'INT_18 ' , 'INT_19 ' , 'INT_22 ' , 'INT_27 '
906
925
],
907
926
],
908
927
]
@@ -911,44 +930,21 @@ public function getCode($type, $code = '')
911
930
'containers ' => ['RECTANGULAR ' ],
912
931
'filters ' => [
913
932
'within_us ' => [
914
- 'method ' => [
915
- 'Priority Mail Express ' ,
916
- 'Priority Mail ' ,
917
- 'Retail Ground ' ,
918
- 'Media Mail ' ,
919
- 'Library Mail ' ,
920
- 'First-Class Package Service ' ,
921
- ],
933
+ 'method ' => ['3 ' , '1 ' , '4 ' , '6 ' , '7 ' , '61 ' ],
922
934
],
923
935
'from_us ' => [
924
- 'method ' => [
925
- 'USPS GXG Envelopes ' ,
926
- 'Priority Mail Express International ' ,
927
- 'Priority Mail International ' ,
928
- 'First-Class Package International Service ' ,
929
- ],
936
+ 'method ' => ['INT_12 ' , 'INT_1 ' , 'INT_2 ' , 'INT_15 ' ],
930
937
],
931
938
]
932
939
],
933
940
[
934
941
'containers ' => ['NONRECTANGULAR ' ],
935
942
'filters ' => [
936
943
'within_us ' => [
937
- 'method ' => [
938
- 'Priority Mail Express ' ,
939
- 'Priority Mail ' ,
940
- 'Retail Ground ' ,
941
- 'Media Mail ' ,
942
- 'Library Mail ' ,
943
- ],
944
+ 'method ' => ['3 ' , '1 ' , '4 ' , '6 ' , '7 ' ],
944
945
],
945
946
'from_us ' => [
946
- 'method ' => [
947
- 'Global Express Guaranteed (GXG) ' ,
948
- 'Priority Mail Express International ' ,
949
- 'Priority Mail International ' ,
950
- 'First-Class Package International Service ' ,
951
- ],
947
+ 'method ' => ['INT_4 ' , 'INT_1 ' , 'INT_2 ' , 'INT_15 ' ],
952
948
],
953
949
]
954
950
],
0 commit comments