@@ -8,8 +8,10 @@ use serde_with::skip_serializing_none;
88/// The intent to either capture payment immediately or authorize a payment for an order after order creation.
99#[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Copy , Clone ) ]
1010#[ serde( rename_all = "SCREAMING_SNAKE_CASE" ) ]
11+ #[ derive( Default ) ]
1112pub enum Intent {
1213 /// The merchant intends to capture payment immediately after the customer makes a payment.
14+ #[ default]
1315 Capture ,
1416 /// The merchant intends to authorize a payment and place funds on hold after the customer makes a payment.
1517 /// Authorized payments are guaranteed for up to three days but are available to capture for up to 29 days.
@@ -19,12 +21,6 @@ pub enum Intent {
1921 Authorize ,
2022}
2123
22- impl Default for Intent {
23- fn default ( ) -> Self {
24- Intent :: Capture
25- }
26- }
27-
2824/// Represents a payer name.
2925///
3026/// <https://developer.paypal.com/docs/api/orders/v2/#definition-payer.name>
@@ -197,22 +193,17 @@ pub struct PlatformFee {
197193}
198194
199195/// The funds that are held on behalf of the merchant
200- #[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Clone ) ]
196+ #[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Clone , Default ) ]
201197pub enum DisbursementMode {
202198 /// The funds are released to the merchant immediately.
199+ #[ default]
203200 Instant ,
204201 /// The funds are held for a finite number of days. The actual duration depends on the region and type of integration.
205202 /// You can release the funds through a referenced payout.
206203 /// Otherwise, the funds disbursed automatically after the specified duration.
207204 Delayed ,
208205}
209206
210- impl Default for DisbursementMode {
211- fn default ( ) -> Self {
212- DisbursementMode :: Instant
213- }
214- }
215-
216207/// Any additional payment instructions for PayPal Commerce Platform customers.
217208#[ skip_serializing_none]
218209#[ derive( Debug , Default , Serialize , Deserialize , Clone , Builder ) ]
@@ -227,10 +218,12 @@ pub struct PaymentInstruction {
227218/// The item category type.
228219#[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Copy , Clone ) ]
229220#[ serde( rename_all = "SCREAMING_SNAKE_CASE" ) ]
221+ #[ derive( Default ) ]
230222pub enum ItemCategoryType {
231223 /// Goods that are stored, delivered, and used in their electronic format.
232224 /// This value is not currently supported for API callers that leverage
233225 /// the [PayPal for Commerce Platform](https://www.paypal.com/us/webapps/mpp/commerce-platform) product.
226+ #[ default]
234227 DigitalGoods ,
235228 /// A tangible item that can be shipped with proof of delivery.
236229 PhysicalGoods ,
@@ -239,12 +232,6 @@ pub enum ItemCategoryType {
239232 Donation ,
240233}
241234
242- impl Default for ItemCategoryType {
243- fn default ( ) -> Self {
244- ItemCategoryType :: DigitalGoods
245- }
246- }
247-
248235/// The name of the person to whom to ship the items.
249236#[ skip_serializing_none]
250237#[ derive( Debug , Default , Serialize , Deserialize , Clone ) ]
@@ -551,6 +538,7 @@ impl PurchaseUnit {
551538/// The type of landing page to show on the PayPal site for customer checkout.
552539#[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Copy , Clone ) ]
553540#[ serde( rename_all = "SCREAMING_SNAKE_CASE" ) ]
541+ #[ derive( Default ) ]
554542pub enum LandingPage {
555543 /// When the customer clicks PayPal Checkout, the customer is redirected to a page to log in to PayPal and approve the payment.
556544 Login ,
@@ -560,71 +548,54 @@ pub enum LandingPage {
560548 /// When the customer clicks PayPal Checkout, the customer is redirected to either a page to log in to PayPal and approve
561549 /// the payment or to a page to enter credit or debit card and other relevant billing information required to complete the purchase,
562550 /// depending on their previous interaction with PayPal.
551+ #[ default]
563552 NoPreference ,
564553}
565554
566- impl Default for LandingPage {
567- fn default ( ) -> Self {
568- LandingPage :: NoPreference
569- }
570- }
571-
572555/// The shipping preference
573556#[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Copy , Clone ) ]
574557#[ serde( rename_all = "SCREAMING_SNAKE_CASE" ) ]
558+ #[ derive( Default ) ]
575559pub enum ShippingPreference {
576560 /// Use the customer-provided shipping address on the PayPal site.
561+ #[ default]
577562 GetFromFile ,
578563 /// Redact the shipping address from the PayPal site. Recommended for digital goods.
579564 NoShipping ,
580565 /// Use the merchant-provided address. The customer cannot change this address on the PayPal site.
581566 SetProvidedAddress ,
582567}
583568
584- impl Default for ShippingPreference {
585- fn default ( ) -> Self {
586- ShippingPreference :: GetFromFile
587- }
588- }
589-
590569/// Configures a Continue or Pay Now checkout flow.
591570#[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Copy , Clone ) ]
592571#[ serde( rename_all = "SCREAMING_SNAKE_CASE" ) ]
572+ #[ derive( Default ) ]
593573pub enum UserAction {
594574 /// After you redirect the customer to the PayPal payment page, a Continue button appears. Use this option when
595575 /// the final amount is not known when the checkout flow is initiated and you want to redirect the customer
596576 /// to the merchant page without processing the payment.
577+ #[ default]
597578 Continue ,
598579 /// After you redirect the customer to the PayPal payment page, a Pay Now button appears.
599580 /// Use this option when the final amount is known when the checkout is initiated and you want to
600581 /// process the payment immediately when the customer clicks Pay Now.
601582 PayNow ,
602583}
603584
604- impl Default for UserAction {
605- fn default ( ) -> Self {
606- UserAction :: Continue
607- }
608- }
609-
610585/// The merchant-preferred payment sources.
611586#[ derive( Debug , Serialize , Deserialize , Eq , PartialEq , Copy , Clone ) ]
612587#[ serde( rename_all = "SCREAMING_SNAKE_CASE" ) ]
588+ #[ derive( Default ) ]
613589pub enum PayeePreferred {
614590 /// Accepts any type of payment from the customer.
591+ #[ default]
615592 Unrestricted ,
616593 /// Accepts only immediate payment from the customer.
617594 /// For example, credit card, PayPal balance, or instant ACH.
618595 /// Ensures that at the time of capture, the payment does not have the `pending` status.
619596 ImmediatePaymentRequired ,
620597}
621598
622- impl Default for PayeePreferred {
623- fn default ( ) -> Self {
624- PayeePreferred :: Unrestricted
625- }
626- }
627-
628599/// A payment method.
629600#[ skip_serializing_none]
630601#[ derive( Debug , Default , Serialize , Deserialize , Clone ) ]
0 commit comments