Git Product home page Git Product logo

paystack's People

Contributors

adekoyejoakinhanmi avatar devamaz avatar emmaadesile avatar isocroft avatar stitchng avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar

paystack's Issues

Update plan throws an error

I'm trying to make an update plan request using the SDK but it keeps throwing an error. After digging into the code, I discovered that the SDK sends a default value of monthly for the interval but the API doesn't accept interval param for the update plan endpoint.

This is the updatePlan function

  updatePlan: {
    method: 'PUT',
    path: '/plan/{:id_or_plan_code}',
    send_json: true,
    params: { name$: String, interval$: String, currency: String, amount$: Number, send_invoices: Boolean, send_sms: Boolean, invoice_limit: Number, description: String },
    param_defaults: { interval: 'monthly', currency: 'NGN', send_invoices: false, send_sms: false, invoice_limit: 0 },
    route_params: { id_or_plan_code: String }
  }

Screeenshot:

Screenshot 2021-05-29 at 15 07 20

Screenshot 2021-05-29 at 15 53 26

Possible Fix

This error should be fixed after the interval is removed from the params_defaults and params fields in the updatePlan function

Issues understanding documentation

Can the documentation please be more readable and easy to follow?? Whats the easiest method to accept payment through my nodejs and express backend

[Improve error reporting] Request was badly formed | Bad Request (400)

When testing paystack.initiateTransfer({... .. }) the server always returns with 400 no matter what i do, below is the argument i passed into the function

{
  reason: 'Withdrawing from ***: United Bank For Africa',
  amount: 40000,
  recipient: 'RCP_gqko5hey45189ob',
  reference: 'rApY3'
}

I don't really know what am doing wrong here, but using the curl method just works fine, the recipient is from an already generated endpoint and am just passing it directly to the initiateTransfer method

this is the specification am following https://developers.paystack.co/v2.0/docs/funds-transfers

[EDIT]
Ive also disabled OPT confirmation, but still no positive reply from paystack

the correct format of paystack.chargeCard()

I have been experiencing error in the chargeCard function with the following object as a parameter to the chargeCard function:

{
  "email":"[email protected]",
  "amount":"10000",
  "metadata":{
    "custom_fields":[
      {
        "value":"makurdi",
        "display_name": "Donation for",
        "variable_name": "donation_for"
      }
    ]
  },
  "card":{
    "cvv":"408",
    "number":"4084084084084081",
    "expiry_month":"01",
    "expiry_year":"99"
  },
  "pin":"0000"
}

Source:
and here is the errror i get:

Error: Request was badly formed | Bad Request (400)
    at PayStack.httpClientBaseOptions.hooks.afterResponse (C:\xampp\htdocs\blake\node_modules\paystack-node\src\PayStack\index.js:331:21)
    at EventEmitter.<anonymous> (C:\xampp\htdocs\blake\node_modules\got\source\as-promise.js:39:23)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)

and just to dig up thing i had to go into that file and console log at line 309 and here's what i got even after changing the card details to a real card:

body: '{\n  "status": false,\n  "message": "Please pass card number to charge"\n}'

[UPDATE] customer endpoint outdated! or does not work

The API endpoint attribute at

path: '/customer/{:customer_id}',
should be changed to path: '/customer/{:id_or_customer_code} https://developers.paystack.co/reference#update-customer the above query doest scale well or throws an error

 Request endpoint does not exist | Not Found (404)
    at PayStack.httpClientBaseOptions.hooks.afterResponse (/home/.../.../node_modules/paystack-node/src/PayStack/index.js:330:21)
    at EventEmitter.<anonymous> (/home/.../.../node_modules/paystack-node/node_modules/got/source/as-promise.js:39:23)

This should be updated to also support customer_id

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.