A crate that serves to abstract away the network aspect of interfacing with paypal. Created by nikos
Creating a payment is done using the create_payment
function.
let token = get_token?;
let amount = TransactionAmount ;
let new_payment = new?;
A crate that serves to abstract away the network aspect of interfacing with paypal. Created by nikos
Creating a payment is done using the create_payment
function.
let token = paypal::get_token("my_id", "my_secret")?;
let amount = TransactionAmount {
currency: "USD".to_string(),
total: "100.00".to_string()
};
let new_payment = payment::new(
&token.access_token,
"mysite.com/whooyoupaid",
"mysite.com/nooyoufailed",
PaymentMethod::Paypal,
PaymentIntent::Sale,
vec![Transaction { amount }],
)?;