Skip to content

opeolluwa/opay-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Opay Rust SDK

Description

Opay SDK in the Rust Programming language

Getting Started

To get started create a account from https://merchant.opaycheckout.com/signup or login to existing account

Installing

cargo add opay_rs tokio -F full 

Executing program

use opay_rs::{
    opay_client::OpayClient,
    error::OpayClientError,
    opay::{Environment, MerchantId, PublicKey},
};

#[tokio::main]
async fn main() -> Result<(), OpayClientError> {
    let env = Environment::Development; // Environment::Default
    let public_key = PublicKey::from(&std::env::var("OPAY_PUBLIC_KEY").ok().unwrap());
    let merchant_id = MerchantId::from(&std::env::var("OPAY_MERCHANT_ID").ok().unwrap());
    let opay_client = OpayClient::new(env, public_key, merchant_id);

    let bank_list = opay_client.get_bank_list().await;

    Ok(())
}

Documentation

Describe any special instructions that are necessary to install a software package on your computer (if applicable).

Help

Any advise for common problems or issues.

command to run if program contains helper info

Authors

Contributors names and contact info

ex. Dominique Pizzie
ex. @DomPizzie

Version History

License

This project is licensed under the [NAME HERE] License - see the LICENSE.md file for details

Acknowledgments

Inspiration, code snippets, etc.

About

Opay SDK buillt in Rust programming language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages