#api #api-bindings #v2 #http-api

nightly culqi

API bindings for the Culqi v2 HTTP API

4 releases

Uses old Rust 2015

0.2.1 May 21, 2017
0.2.0 May 16, 2017
0.1.1 May 8, 2017
0.1.0 May 3, 2017

#8 in #v2

MIT license

33KB
505 lines

culqi-rust

Packagist Crates.io

Culqi API - Rust

Usage

Put this in your Cargo.toml:

[dependencies]
culqi = "0.2.1"

And this in your crate root:

extern crate culqi;

Instructions for Generate Doc

cargo rustdoc --lib

lib.rs:

Culqi-Rust is a library for used Culqi API

Usage

Put this in your Cargo.toml

[dependencies]
culqi = "0.2.0"

And this in your crate root:

extern crate culqi;

Examples

Initialization

At Culqi you have two keys (public_key, secret_key) public_key is only for create Token

let public_key = "{PUBLIC_KEY}";
let secret_key = "{SECRET_KEY}";
let client = culqi::Client::new(&secret_key);

Create Token is only use in integration enviroment (keys must be activated)

let new_token = culqi::Token::new("4111111111111111","123",9,2020,"test@test.com", None);

Create a Charge with Antifraud Details

let ref antifraud_details = culqi::AntifraudDetails::new("av. lima", "lima", "PE", "Will", "Aguirre", "993978969");
let new_charge = culqi::Charge::new("3500", "PEN", "will@me.com", 4, None, Some(antifraud_details), "{token}");
let get_charge = culqi::Charge::create(&client, &new_charge);

Dependencies

~8–16MB
~247K SLoC