alitnk / monopay Goto Github PK
View Code? Open in Web Editor NEW💳 A node.js package for making payment transactions with different payment gateways
Home Page: https://monopay.js.org
License: MIT License
💳 A node.js package for making payment transactions with different payment gateways
Home Page: https://monopay.js.org
License: MIT License
We might want to use @ts-ignore
in some test files to simulate a javscript user or even a typescript user who is ignoring the types. So that we can test the parsing exceptions correctly.
Tests are not failing but the error is shown in the editor anyway. I'm not sure it's just my vscode config or the project eslint config. But even if it's local we better define a config in .vscode
to stop it.
I'd look into this one later. It's not a major issue 🙂
Currently there are no exceptions if signing process fails. Which means it'll lead to default crypto
/cryptojs
errors if a user was to provide a wrong key format. (which is not so much away from happening in a format like rsa
in Pasargad driver).
I assume a SigningException
can be suitable for the cause. Or even a default Error
object with a more convenient message
For the time being, Sadad and Pasargad implement a signing process.
I'd be happy to know any other ideas and to be assigned to this issue
npm install mobinco/monopay
npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/mobinco/monopay.git
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-11-08T14_03_18_128Z-debug-0.log
[root@server public_html]# cat /root/.npm/_logs/2022-11-08T14_03_18_128Z-debug-0.log
Replace the current validation library with zod
Behpardakht Driver doesn't seem to get error codes correctly. see here
I'll commit a fix for this in error handling branch. It could be reviewed when its pull request is opened later
node app.js
/home/akbar/Desktop/node taxi/node_modules/monopay/dist/drivers/saman/index.js:52
const responseStatus = response[0]?.result?.$value;
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/akbar/Desktop/node taxi/node_modules/monopay/dist/drivers.js:11:17)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object. (/home/akbar/Desktop/node taxi/node_modules/monopay/dist/index.js:17:14)
at Module._compile (internal/modules/cjs/loader.js:999:30)
I think we might have to depend on some NestJS packages when implementing #26
It would be unnecessary to have NestJS dependencies when using the library outside NestJS, hence we create a separate package (nestjs-monopay
maybe) to have the NestJS module/service there.
That would require us to convert the repo into a monorepo
axios 0.8.1 - 1.5.1
Severity: moderate
Axios Cross-Site Request Forgery Vulnerability - GHSA-wf5p-g6vw-rhxx
No fix available
node_modules/monopay/node_modules/axios
monopay *
Depends on vulnerable versions of axios
node_modules/monopay
I was looking at this line in express example. I'm wondering if this is just simply a typo mistake with transactionId
or BaseReceipt
might actually contain a property called referenceId
in some case? Either way I was unable to transform this code into typescript because of the type error below:
Property 'referenceId' does not exist on type 'BaseReceipt<any>'.ts(2339)
پکیجتون خیلی عالی و کاربردیه
اگر پشتیبانی از درگاه بانک پاسارگاد رو هم اضافه کنید فوق العادس
ممنون
I was trying to test a new feature then I've faced this:
Cannot find module 'drivers/behpardakht' from 'src/drivers.ts'
Require stack:
src/drivers.ts
src/drivers/behpardakht/behpardakht.spec.ts
> 1 | import { Behpardakht, BehpardakhtAPI } from 'drivers/behpardakht';
| ^
2 | import { IdPay, IdPayAPI } from 'drivers/idpay';
3 | import { NextPay, NextPayAPI } from 'drivers/nextpay';
4 | import { Parsian, ParsianAPI } from 'drivers/parsian';
at Resolver._throwModNotFoundError (node_modules/jest-resolve/build/resolver.js:487:11)
at Object.<anonymous> (src/drivers.ts:1:1)
at Object.<anonymous> (src/drivers/behpardakht/behpardakht.spec.ts:1:1)
The results are the same while testing every other driver.
To reproduce: yarn test
Expected behavior: run the tests without error
Fix: bringing back ./
to import routes in drivers.ts
seems to have fixed the issue for me
How ever yarn prebuild
and yarn build
have no problem. I'm starting to think there's something wrong with my own general jest config cause it had happened before.
If the tests are generally failing for every one, let me know to create a pull request
من هنگام درخواست پرداخت این خطارو دریافت میکنم: The top-level-await experiment is not enabled
کجا میتونم اینو فعال کنم؟
Example README links are producing 404:
typescript , javascript
It was probably caused by refactoring. I'll look into it
با سلام و تشکر بابت پکیج بسیار عالی . ممنون میشم در خصوص نحوه استفاده از درگاه سامان کیش در express راهنمایی بفرمایید . با تشکر
Describe the bug
The package uses the v1.1 of IDPay, however, requesting for creating a payment, throws an error saying order_id must not be empty.
To Reproduce
Try to request and create a payment with the samples
Expected behavior
Creating the payment
As mentioned in pull #20 , Pasargad provides its developers with a certificate.xml
file containing their RSA private key. However, the Pasargad driver accepts the private key in pem
format (Due to the crypto
library only accepting pem
) so developers are forced to convert it on their own. It would be nice to implement a conversion process to extract pem
keys from RSA-XML
.
I will be working on it. Feel free to assign
in verifyPayment method of zarinpal in the docx. it is suggested to pass referenceId
but when read your code figured out it must be Authority
.
monopay/src/drivers/zarinpal/index.ts
Line 44 in c0b45c4
I have had spent an hour scratching my head why my endpoint return 404.
import { getPaymentDriver } from "monopay";
const driver = getPaymentDriver("zarinpal", {
merchantId: "zarinpal-merchant",
});
const receipt = await driver.verifyPayment(
{
amount: 5000,
referenceId: 1234,
},
{ ...request.query }
);
Hey @alitnk thanks the package, but in your example please add description since it has become required for zarinpal
const paymentInfo = await driver.requestPayment({
amount: 20000,
callbackUrl: process.env.APP_URL + "/callback",
description: "Description about the transaction",
});
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.