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