Code Monkey home page Code Monkey logo

paystack-rs's Introduction

paystack-rs

Rust paystack-rs on crates.io paystack-rs  on docs.rs License: MIT

Convenient Rust bindings and types for the Paystack HTTP API aiming to support the entire API surface. Not the case? Please open an issue. I update the definitions on a weekly basis.

The client aims to make receiving payments for African business or business with African clients building with Rust as hassle-free as possible.

Note : While the crate aims to support sync and async use cases, only async use case is supported at the moment.

The client currently covers the following section of the API, and the sections to be implemented in order are left unchecked:

  • Transaction
  • Transaction Split
  • Terminal
  • Customers
  • Dedicated Virtual Account
  • Apple Pay
  • Subaccounts
  • Plans
  • Subscriptions
  • Transfer Recipients
  • Transfers
  • Transfers Control
  • Bulk Charges
  • Integration
  • Charge
  • Disputes
  • Refunds
  • Verifications
  • Miscellaneous

Documentation

See the Rust API docs or the examples.

Installation

paystack-rs uses the reqwest HTTP client under the hood and the tokio runtime for async operations.

[dependencies]
paystack-rs = "0.x.x"

You can also download the source code and use in your code base directly if you prefer.

Usage

Initializing an instance of the Paystack client and creating a transaction.

Contributing

See CONTRIBUTING.md for information on contributing to paystack-rs.

License

Licensed under MIT license (LICENSE-MIT).

paystack-rs's People

Contributors

lilit0x avatar morukele avatar

Stargazers

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

Watchers

 avatar  avatar

paystack-rs's Issues

Help with contribution guideline policy

I would like some help with the Contribution.MD file, I am not sure how to write a contribution guideline.

I will be grateful if you can help me with this.

Implementing examples

I need help implementing examples of the API client in the /example folder.

As I build the API client and write tests; it will be nice to have examples of logic that can be done with the crate.

Some examples off the top of my head:

  • A CLI app to create a transaction in your Paystack integration, the app can return the payment link generated, and you can also check the status of the transaction on the CLI using the transaction reference.
  • A CLI to give the number of transactions in your integration, it can further group the transactions based on status or any other criteria you like.

These are just examples, feel free to be creative with your examples. The goal is to show what can be built with the crate.

If you create an example, please name the file after your example, this will make it intuitive for other users. It will also be nice if you comment on the code.

This is a non-ending issue, so it is opened to as many contributors as possible.

Write test for transaction splits endpoint

The goal is to write a series of these for the transaction splits endpoint.

The goal is to write tests to check that the proper behavior happens when the right data is sent to the endpoint and when the wrong data is sent to the endpoint.

Improve the charge test

At the moment, the test in the test/api/charge.rs file has hard-coded values. These values are directly retired from my Paystack integration. This is not an ideal solution because if someone uses their own API key, the tests will fail.

To fix this issue, you would need to figure out a way to retrieve those values from the integration so that they will not be hard coded.

If you are interested in fixing this, please indicate and take a short at it.

Make crate HTTP client agnostic

The HTTP client agnostic crate allows the user to have flexibility in their application. The user can use their own HTTP client as long as it implements the crate's base HTTP trait.

To make this as convenient as possible, I propose an implementation of the reqwest client as the default, and then other clients can be added as the project continues.

The goal of this issue is to focus on the first two items, namely:

  • create the base HTTP trait
  • implement the reqwest HTTP client for the crate

Implement customer API

This issue revolves around implementing the complete Paystack customer API for the crate. Some API parts have already been implemented, mostly the data model. This will ensure that this new customer API route does not conflict with the existing one.

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.