midtrans-nodejs-client icon indicating copy to clipboard operation
midtrans-nodejs-client copied to clipboard

TYPO in lib/snapBi

Open sasakiRoo opened this issue 1 year ago • 5 comments

previously https://github.com/Midtrans/midtrans-nodejs-client/issues/76 , i encountered an issue that my node module cannot find "SnapBiApiRequestor".

so i checked it myslef, and found out that this code from folder lib/snapBi const SnapBiApiRequestor = require('./SnapBiApiRequestor');

this code create problem CANNOT FIND MODULE and needs to be fixed, so that user dont need to fix it themselve.

expected code: const SnapBiApiRequestor = require('./snapBiApiRequestor');

https://github.com/Midtrans/midtrans-nodejs-client/blob/master/lib/SnapBi/snapBi.js

sasakiRoo avatar Oct 22 '24 02:10 sasakiRoo

thanks for the feedback, what version is this? ah I see, so there's a wrong capitalization ya? the s should be lowercase?

uziwuzzy avatar Oct 22 '24 10:10 uziwuzzy

Yes, it should be lowercase

sasakiRoo avatar Oct 22 '24 10:10 sasakiRoo

let snap = new midtransClient.Snap({ ^

TypeError: midtransClient.Snap is not a constructor

how to fix

TacoFury avatar Oct 24 '24 06:10 TacoFury

Coba kayak gini pas importnya. import {Midtrans} from 'midtrans-client'

`let snap = new Midtrans.Snap({

})`

sasakiRoo avatar Oct 24 '24 07:10 sasakiRoo

NOTE: THE ISSUE OF UPPERCASE in SnapBiApiRequestor still is not fixed yet when i use netlify to test my app, it got error like the issue of number 76.

I created a pull request about fixing the typo. I hope it will be approved.

sasakiRoo avatar Oct 24 '24 07:10 sasakiRoo