Giter VIP home page Giter VIP logo

monopay's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

monopay's Issues

Issue with docs site deployment

CI is failing. Local dev also throws all sorts of Webpack errors. We may need to upgrade the site.

CI fail is blocking #52 and #55 from being deployed.

Cannot find module `drivers/behpardakht` from `src/drivers.ts`

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

Unexpected token

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)

Move to a monorepo structure

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

IDPay v1.1 - 406 Error - order_id must not be empty

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

درگاه سامان کیش

با سلام و تشکر بابت پکیج بسیار عالی . ممنون میشم در خصوص نحوه استفاده از درگاه سامان کیش در express راهنمایی بفرمایید . با تشکر

`RSA-XML` to `pem` format conversion for Pasargad

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

An unknown git error occurred

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

What is `referenceId` in express example

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)

خطای Next Js

من هنگام درخواست پرداخت این خطارو دریافت میکنم: The top-level-await experiment is not enabled
کجا میتونم اینو فعال کنم؟

Allowing `@ts-ignore` in test files

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 🙂

Zarinpal refrenceId is wrong!!

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.

const { Authority: authority, Status: status } = params;

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 }
);

description is required

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",
    });

more info here

Restructure Exceptions

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.