I am trying to integrate paytm payment api gateway, during creating paytmchecksum i faced below issue:
Issue:Unhandled error in paytmchecksum.generateSignature
If i don't add below line in index.d.ts file
declare module 'paytmchecksum';
It fails in deploying to firebase cloud functions saying Could not find a declaration file for module 'paytmchecksum'
If I add above mentioned entry, it compiles well but it fails in run time with below error:
{"severity":"ERROR","message":"Unhandled error TypeError: Cannot read properties of undefined (reading 'generateSignature'
previous issue background: Type script node.js - paytmchecksum undefined - generateSignature
You can try the following ways to resolve the error
Could not find a declaration file for module 'paytmchecksum'
Add paytmchecksum
under dependencies in package.json
Use require
instead of import
as below
var paytm_checksum = require( paytm/paytmchecksum)
Create your own type declarations file or use @ts-ignore
on the line before the import.
Check this StackOverflow thread , If you wish to create your own type.d.ts file
Run the following command to install paytmchecksum
properly.
npm install paytmchecksum
Also have a look at this thread
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.