@@ -60,74 +60,94 @@ protected BaseStampV4(String url, String token, String operation, String proxy,
6060 * utilizando la versión 1 de timbrado.
6161 * @param xml String xml.
6262 * @param isBase64 indica si es base64.
63- * @param email String email receptor.
63+ * @param emails String emails receptor(max 5).
64+ * @param customId String identificador único asignado al comprobante.
65+ * @param extra boolean confirma la generación de un PDF.
6466 * @return StampResponseV1
6567 * @see StampResponseV1
6668 * @throws ServicesException exception en caso de error.
6769 */
68- public StampResponseV1 timbrarV1 (String xml , String email , boolean isBase64 ) throws ServicesException {
70+ public StampResponseV1 timbrarV1 (String xml , String emails , String customId , boolean extra , boolean isBase64 ) throws ServicesException {
6971 StampResponseHandlerV1 handler = new StampResponseHandlerV1 ();
70- Map <String , String > headers = getHeaders ();
71- headers .put ("email" , email );
72- String format = isBase64 ? "b64" : "" ;
73- String path = String .format (formatPath , operation , "v1" , format );
74- return super .timbrar (xml , path , headers , handler , StampResponseV1 .class );
72+ try {
73+ Map <String , String > headers = getHeaders (emails ,customId , extra );
74+ String format = isBase64 ? "b64" : "" ;
75+ String path = String .format (formatPath , operation , "v1" , format );
76+ return super .timbrar (xml , path , headers , handler , StampResponseV1 .class );
77+ }catch (ServicesException e ) {
78+ return handler .handleException (e );
79+ }
7580 }
7681
7782 /**
7883 * Timbra un documento CFDI versión XML
7984 * utilizando la versión 2 de timbrado.
8085 * @param xml String xml.
8186 * @param isBase64 indica si es base64.
82- * @param email String email receptor.
87+ * @param emails String emails receptor(max 5).
88+ * @param customId String identificador único asignado al comprobante.
89+ * @param extra boolean confirma la generación de un PDF.
8390 * @return StampResponseV2
8491 * @see StampResponseV2
8592 * @throws ServicesException exception en caso de error.
8693 */
87- public StampResponseV2 timbrarV2 (String xml , String email , boolean isBase64 ) throws ServicesException {
94+ public StampResponseV2 timbrarV2 (String xml , String emails , String customId , boolean extra , boolean isBase64 ) throws ServicesException {
8895 StampResponseHandlerV2 handler = new StampResponseHandlerV2 ();
89- Map <String , String > headers = getHeaders ();
90- headers .put ("email" , email );
91- String format = isBase64 ? "b64" : "" ;
92- String path = String .format (formatPath , operation , "v2" , format );
93- return super .timbrar (xml , path , headers , handler , StampResponseV2 .class );
96+ try {
97+ Map <String , String > headers = getHeaders (emails ,customId , extra );
98+ String format = isBase64 ? "b64" : "" ;
99+ String path = String .format (formatPath , operation , "v2" , format );
100+ return super .timbrar (xml , path , headers , handler , StampResponseV2 .class );
101+ }catch (ServicesException e ) {
102+ return handler .handleException (e );
103+ }
94104 }
95105
96106 /**
97107 * Timbra un documento CFDI versión XML
98108 * utilizando la versión 3 de timbrado.
99109 * @param xml String xml.
100110 * @param isBase64 indica si es base64.
101- * @param email String email receptor.
111+ * @param emails String emails receptor(max 5).
112+ * @param customId String identificador único asignado al comprobante.
113+ * @param extra boolean confirma la generación de un PDF.
102114 * @return StampResponseV3
103115 * @see StampResponseV3
104116 * @throws ServicesException exception en caso de error.
105117 */
106- public StampResponseV3 timbrarV3 (String xml , String email , boolean isBase64 ) throws ServicesException {
118+ public StampResponseV3 timbrarV3 (String xml , String emails , String customId , boolean extra , boolean isBase64 ) throws ServicesException {
107119 StampResponseHandlerV3 handler = new StampResponseHandlerV3 ();
108- Map <String , String > headers = getHeaders ();
109- headers .put ("email" , email );
110- String format = isBase64 ? "b64" : "" ;
111- String path = String .format (formatPath , operation , "v3" , format );
112- return super .timbrar (xml , path , headers , handler , StampResponseV3 .class );
120+ try {
121+ Map <String , String > headers = getHeaders (emails ,customId , extra );
122+ String format = isBase64 ? "b64" : "" ;
123+ String path = String .format (formatPath , operation , "v3" , format );
124+ return super .timbrar (xml , path , headers , handler , StampResponseV3 .class );
125+ }catch (ServicesException e ) {
126+ return handler .handleException (e );
127+ }
113128 }
114129
115130 /**
116131 * Timbra un documento CFDI versión XML
117132 * utilizando la versión 4 de timbrado.
118133 * @param xml String xml.
119134 * @param isBase64 indica si es base64.
120- * @param email String email receptor.
135+ * @param emails String emails receptor(max 5).
136+ * @param customId String identificador único asignado al comprobante.
137+ * @param extra boolean confirma la generación de un PDF.
121138 * @return StampResponseV4
122139 * @see StampResponseV4
123140 * @throws ServicesException exception en caso de error.
124141 */
125- public StampResponseV4 timbrarV4 (String xml , String email , boolean isBase64 ) throws ServicesException {
142+ public StampResponseV4 timbrarV4 (String xml , String emails , String customId , boolean extra , boolean isBase64 ) throws ServicesException {
126143 StampResponseHandlerV4 handler = new StampResponseHandlerV4 ();
127- Map <String , String > headers = getHeaders ();
128- headers .put ("email" , email );
129- String format = isBase64 ? "b64" : "" ;
130- String path = String .format (formatPath , operation , "v4" , format );
131- return super .timbrar (xml , path , headers , handler , StampResponseV4 .class );
144+ try {
145+ Map <String , String > headers = getHeaders (emails ,customId , extra );
146+ String format = isBase64 ? "b64" : "" ;
147+ String path = String .format (formatPath , operation , "v4" , format );
148+ return super .timbrar (xml , path , headers , handler , StampResponseV4 .class );
149+ }catch (ServicesException e ) {
150+ return handler .handleException (e );
151+ }
132152 }
133153}
0 commit comments