UnhandledPromiseRejectionWarning:错误:“收据”是强制性的razorpay

问题描述

我正在按照 this 文档创建订单,他们已经明确说明收据是一个可选参数,那么为什么我会收到

some,file,field
group,/path/to/file1,/path/to/file2,this
group,/path/to/file1b,/path/to/file2c,that
group,/path/to/file2b,that

这里是错误

enter image description here

这是代码

UnhandledPromiseRejectionWarning: Error: `receipt` is mandatory razorpay 

解决方法

这是 razorpay 库中的一个错误,即 fixed over a year ago

确保您使用的是最新版本的软件包。如果修复未发布,您可以尝试直接使用此提交:

npm i razorpay/razorpay-node#80044a4d1f54cdee6e8f5b81ddbcccba5812c175

如果这也不起作用,您可以在 GitHub 上打开该库的问题。