Closed cahyonobagus closed 3 years ago
Very nice, thanks for catching the issue and submitting the detailed analysis & fix on this PR. Great write up. Looks good, will be merged and released as new version soon.
Thanks for contributing 😃
Done NPM released as version 1.2.3
just now. Thanks!
Module Version: midtrans-client@1.2.2
What's the problem?
I can not override the notification URL with the module this way:
The notification is always sent to the URL described on the Midtrans dashboard (SETTINGS > CONFIGURATION)
Expected Condition
If 'X-Override-Notification' is used, then the notification should be sent to the new URL.
Possible Causes
Method request on the Class HttpClient always uses Axios instead of using http_client from the constructor. So when I add headers with
MidtransClient.httpClient.http_client.defaults.headers.common['X-Override-Notification']
, It does not give any effect.Solution
Use http_client from the constructor.