File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -51,11 +51,33 @@ module.exports = class RegisterScopeFive extends AfipWebService {
51
51
idPersona : identifier
52
52
} ;
53
53
54
- return this . executeRequest ( 'getPersona ' , params )
54
+ return this . executeRequest ( 'getPersona_v2 ' , params )
55
55
. then ( res => res )
56
56
. catch ( err => { if ( err . message . indexOf ( 'No existe' ) !== - 1 ) { return null } else { throw err } } ) ;
57
57
}
58
58
59
+ /**
60
+ * Asks to web service for taxpayers details
61
+ *
62
+ * @throws Exception if exists an error in response
63
+ *
64
+ * @return [object] returns web service full response
65
+ **/
66
+ async getTaxpayersDetails ( identifiers ) {
67
+ // Get token and sign
68
+ let { token, sign } = await this . afip . GetServiceTA ( 'ws_sr_padron_a5' ) ;
69
+
70
+ // Prepare SOAP params
71
+ let params = {
72
+ token, sign,
73
+ cuitRepresentada : this . afip . CUIT ,
74
+ idPersona : identifiers
75
+ } ;
76
+
77
+ return this . executeRequest ( 'getPersonaList_v2' , params )
78
+ . then ( res => res . persona ) ;
79
+ }
80
+
59
81
/**
60
82
* Send request to AFIP servers
61
83
*
@@ -68,7 +90,10 @@ module.exports = class RegisterScopeFive extends AfipWebService {
68
90
{
69
91
let results = await super . executeRequest ( operation , params ) ;
70
92
71
- return results [ operation === 'getPersona' ? 'personaReturn' : 'return' ] ;
93
+ return results [
94
+ operation === 'getPersona_v2' ? 'personaReturn' :
95
+ ( operation === 'getPersonaList_v2' ? 'personaListReturn' : 'return' )
96
+ ] ;
72
97
}
73
98
}
74
99
You can’t perform that action at this time.
0 commit comments