razorpay / razorpay/razorpay-node

Broken Promises Flow

Open
#19 10 comments 0 reactions 1 assignee View on GitHub

@rzpamidi is already working on this.

Since Oct 24, 2017.

enhancement
Dominant language
JavaScript
Stars
243
Forks
128
PR merge metrics
No merged PRs in 30d

Description

Different behaviour has been noted with the promise returned, when a callback is passed to the api function.

eg.

const instance = new Razorpay({
  key_id: 'rzp_test_2mYdwI91aUdL2u',
  key_secret: 'hd0FgTKnZUUJCGYHTdfQ6Zx2'
});

instance.payments.all({})
  .then((arg) => console.log(arg)) // arg value is printed  
  .catch(arg => console.log(arg))

instance.payments.all({}, function () {
  console.log(arguments); // arguments are printed
}).then((arg) => console.log(arg)) // arg value is undefined 
  .catch(arg => console.log(arg))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.