Crates.io | mangopay |
lib.rs | mangopay |
version | 0.1.6 |
source | src |
created_at | 2022-05-27 10:38:42.573649 |
updated_at | 2022-07-22 11:53:15.477033 |
description | MangoPay API SDK #mangopay #pay #lib |
homepage | |
repository | |
max_upload_size | |
id | 595005 |
size | 51,504 |
Feel free to help me build this KillianG/MangoPay :)
let mango: Mangopay = Mangopay::init(
env!("MANGO_CLIENT_ID").parse().unwrap(),
env!("MANGO_API_KEY").parse().unwrap(),
"https://api.sandbox.mangopay.com/v2.01/".to_string()
);
let user_infos = CreateUserBody {
first_name: "firstName".to_string(),
last_name: "lastNme".to_string(),
email: "john@doe.com".to_string(),
user_category: "Payer".to_string(),
tag: "Tagged".to_string(),
terms_and_conditions_accepted: true,
};
let user = mango.create_user(&user_infos).unwrap();
let user_get = mangop.get_user(user.id).unwrap();
let wallet: Wallet = mango.create_wallet(CreateWallet{
owners: vec![user.id],
description: "Description".to_string(),
currency: "EUR".to_string(),
tag: "Tagged".to_string()
})
let list_wallets: ListWallets = mangop.list_wallets(user_id.to_string()).unwrap();
let card_registration_result = mango.create_card_registration(&CardRegistrationBody{
tag: "Tag".to_string(),
user_id: user_id.to_owned(),
currency: "EUR".to_string(),
card_type: "CB_VISA_MASTERCARD".to_string()
}).unwrap();
let card_registration = mango.get_card_registration(card_registration_result.id).unwrap();
let modified_card_registration = mangop.update_card_registration(card_registration.id, &UpdateCardRegistrationBody {
tag: "".to_string(),
registration_data: "registrationdata".to_string()
}).unwrap();