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