-
-
Notifications
You must be signed in to change notification settings - Fork 39
transformer.js
An Axios customizaton transform.
Kind: global class
-
Transformer
- .mchid
- .secret
- .request
- .response
-
.signer(data) ⇒
object
-
.toXml(data) ⇒
string
-
.toObject(xml) ⇒
object
-
.verifier(data) ⇒
object
Kind: static property of Transformer
Properties
Name | Type | Description |
---|---|---|
mchid | string |
The merchant ID |
Kind: static property of Transformer
Properties
Name | Type | Description |
---|---|---|
secret | string |
The merchant secret key string |
Kind: static property of Transformer
Properties
Name | Type | Description |
---|---|---|
request | array |
@see {import('axios').AxiosTransformer} |
Kind: static property of Transformer
Properties
Name | Type | Description |
---|---|---|
response | array |
@see {import('axios').AxiosTransformer} |
Compose the pre-request data signature
Note here: While the [MCHID] is set, then checking the input data matching with it.
Kind: static method of Transformer
Returns: object
- - With data signature
Param | Type | Description |
---|---|---|
data | object |
The API request parameters |
Translation the javascript's object to the XML string
Kind: static method of Transformer
Returns: string
- - XML string
Param | Type | Description |
---|---|---|
data | object |
The API request parameters |
Translation the XML string to the javascript's object.
Kind: static method of Transformer
Returns: object
- - Parsed as object for xml
Param | Type | Description |
---|---|---|
xml | string |
XML string |
Validation the response data with the sign
string.
Kind: static method of Transformer
Returns: object
- - The API response data
Param | Type | Description |
---|---|---|
data | object |
The API response data |