This commit is contained in:
Edgar 2021-07-02 11:38:43 +02:00
parent a364cd26e6
commit 2ac44b4c91
No known key found for this signature in database
GPG key ID: 8731E6C0166EAA85
4 changed files with 12 additions and 8 deletions

View file

@ -1,4 +1,4 @@
use paypal_rs::{common::*, errors::*, invoice::*, Client, HeaderParams, Prefer};
use paypal_rs::{common::*, errors::*, invoice::*, Client, HeaderParams};
#[tokio::main]
async fn main() -> Result<(), ResponseError> {

View file

@ -61,7 +61,7 @@ pub struct Address {
}
/// Represents money
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone)]
pub struct Money {
/// The [three-character ISO-4217 currency code](https://developer.paypal.com/docs/integration/direct/rest/currency-codes/) that identifies the currency.
pub currency_code: Currency,
@ -73,7 +73,7 @@ pub struct Money {
pub value: String,
}
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq, Clone, Copy)]
#[serde(rename_all = "SCREAMING_SNAKE_CASE")]
#[allow(missing_docs)]
pub enum LinkMethod {
@ -89,7 +89,7 @@ pub enum LinkMethod {
/// A HTOAES link
#[skip_serializing_none]
#[derive(Debug, Default, Serialize, Deserialize)]
#[derive(Debug, Default, Serialize, Deserialize, Clone)]
pub struct LinkDescription {
/// The complete target URL.
pub href: String,
@ -100,7 +100,7 @@ pub struct LinkDescription {
}
/// ISO-4217 currency codes.
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq)]
#[derive(Debug, Serialize, Deserialize, PartialEq, Eq, Clone, Copy)]
pub enum Currency {
/// Australian dollar
AUD,

View file

@ -108,7 +108,7 @@ pub struct Metadata {
/// The details of the invoice. Includes the invoice number, date, payment terms, and audit metadata.
#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoiceDetail {
/// The reference data. Includes a post office (PO) number.
pub reference: Option<String>,
@ -521,7 +521,7 @@ pub enum Status {
/// An invoice payload
#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct InvoicePayload {
/// The details of the invoice. Includes the invoice number, date, payment terms, and audit metadata.
pub detail: InvoiceDetail,

View file

@ -339,12 +339,13 @@ pub enum CaptureStatusDetails {
}
/// A captured payment.
#[skip_serializing_none]
#[derive(Debug, Serialize, Deserialize, Eq, PartialEq)]
pub struct Capture {
/// The status of the captured payment.
pub status: CaptureStatus,
/// The details of the captured payment status.
pub status_details: CaptureStatusDetails,
pub status_details: Option<CaptureStatusDetails>,
}
/// The status of the refund
@ -380,10 +381,13 @@ pub struct Refund {
#[derive(Debug, Serialize, Deserialize)]
pub struct PaymentCollection {
/// An array of authorized payments for a purchase unit. A purchase unit can have zero or more authorized payments.
#[serde(default)]
pub authorizations: Vec<AuthorizationWithData>,
/// An array of captured payments for a purchase unit. A purchase unit can have zero or more captured payments.
#[serde(default)]
pub captures: Vec<Capture>,
/// An array of refunds for a purchase unit. A purchase unit can have zero or more refunds.
#[serde(default)]
pub refunds: Vec<Refund>,
}