Giter VIP home page Giter VIP logo

cashfree-sdk-nodejs's People

Contributors

dependabot[bot] avatar indrajeet-cashfree avatar kshirish avatar nafey avatar premaddx avatar rajcashfree avatar rajnandan1 avatar shwetabhcf avatar vrishab-cashfree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cashfree-sdk-nodejs's Issues

Firebase function failed on PG gateway: Cannot encode value

Firebase cloud function on Cashfree PG gateway failed with error: Cannot encode value.

Reason: path: undefined (inside class PG)

this.path variable is undefined inside Http call of PaymentGateway constructor.

Resolution: Either path has to be initialized as null or string.empty

Getting cannot read property token when IP is not whitelisted

Error thrown by SDK:
{"level":"error","message":"error validating bank details, "TypeError: Cannot read property 'token' of undefined\n at Auth.authorize (/Users/mohak.gupta/curefit/payment-service/node_modules/cashfree-sdk/lib/auth/index.js:81:40)\n at process._tickCallback (internal/process/next_tick.js:68:7)"","timestamp":"2020-09-03 18:22:41","iID":"CF-LP00286.local","pID":35728,"rID":"e2b3f034-7361-40c9-8074-05ed0306419c"}

Actual API response:
{
"status": "ERROR",
"subCode": "403",
"message": "IP not whitelisted"
}

Encode URI components properly

The given example for bank validation fails with ERR_UNESCAPED_CHARACTERS if the name field contains a space

Validation.ValidateBankDetails({
	name: "JOHN SMITH",
	phone: "9908712345",
	bankAccount: "026291800001191",
	ifsc: "YESB0000262"
}).then(function(d){
	console.log(d)
});

It seems that the parameters sent via HTTPS to the Cashfree API are not URL-encoded and cause issues if they contain special characters such as space.
https://github.com/cashfree/cashfree-sdk-nodejs/blob/master/Payouts/Validation/index.js#L20

TypeError: Cannot read property 'token' of undefined

Error thrown by SDK:
TypeError: Cannot read property 'token' of undefined\n at Auth.authorize
"IP not whitelisted"

ENV: TEST
I'm using dynamic IP for API calls, so instead of IP whitelisting, I'm using a public key.

Also, as a side note, I haven't added any IP in the whitelisting field on the test dashboard.

Rate limiting not configured

var headers = {
    'Content-Type': 'application/json',
    'x-api-version': '2022-01-01',
    'x-client-id': 'perfect id',
    'x-client-secret': 'perfect secret'
};

var dataString = `{
  "order_id": "o26945143520",
  "order_amount": 10,
  "order_currency": "INR",
  "order_note": "Additional order info",
  "customer_details": {
    "customer_id": "ASFS12345",
    "customer_email": "[email protected]",
    "customer_phone": "9816512345"
  }
}`;

var options = {
    url: 'https://sandbox.cashfree.com/pg/orders',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    console.log(body)
}

request(options, callback);

**Output**
{"message":"Rate limiting not configured","code":"request_failed","type":"internal_error"} `

"verifySignature" function not working in lib/payouts/services.

-- In the documentation, it was written that "postData" should be a string of concatenated values of the request-body object, which should be created by sorting keys in "descending" order, excluding the "signature" key and encryption type should be set to "base64".

-- But in function, it is treating the body as an "object" and converting it using "toString()" then encrypting it in "hex" rather than "base64".

-- code has been fixed and PR has been raised.

Rate limiting not configured | Issue not solved please provide link to solution

var headers = {
    'Content-Type': 'application/json',
    'x-api-version': '2022-01-01',
    'x-client-id': 'perfect id',
    'x-client-secret': 'perfect secret'
};

var dataString = `{
  "order_id": "o26945143520",
  "order_amount": 10,
  "order_currency": "INR",
  "order_note": "Additional order info",
  "customer_details": {
    "customer_id": "ASFS12345",
    "customer_email": "[email protected]",
    "customer_phone": "9816512345"
  }
}`;

var options = {
    url: 'https://sandbox.cashfree.com/pg/orders',
    method: 'POST',
    headers: headers,
    body: dataString
};

function callback(error, response, body) {
    console.log(body)
}

request(options, callback);

**Output**
{"message":"Rate limiting not configured","code":"request_failed","type":"internal_error"} `
`

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.