diff --git a/const.go b/const.go index 7ba0d87..52db026 100644 --- a/const.go +++ b/const.go @@ -102,3 +102,17 @@ const ( ProductCategorySoftwareOther ProductCategory = "OTHER" ProductCategorySoftwareServices ProductCategory = "SERVICES" ) + +type PayeePreferred string // Doc: https://developer.paypal.com/api/orders/v2/#definition-payment_method +const ( + PayeePreferredUnrestricted PayeePreferred = "UNRESTRICTED" + PayeePreferredImmediatePaymentRequired PayeePreferred = "IMMEDIATE_PAYMENT_REQUIRED" +) + +type StandardEntryClassCode string // Doc: https://developer.paypal.com/api/orders/v2/#definition-payment_method +const ( + StandardEntryClassCodeTel StandardEntryClassCode="TEL" + StandardEntryClassCodeWeb StandardEntryClassCode="WEB" + StandardEntryClassCodeCcd StandardEntryClassCode="CCD" + StandardEntryClassCodePpd StandardEntryClassCode="PPD" +) diff --git a/types.go b/types.go index 9cbd68c..e43b972 100644 --- a/types.go +++ b/types.go @@ -198,11 +198,18 @@ type ( Locale string `json:"locale,omitempty"` ShippingPreference ShippingPreference `json:"shipping_preference,omitempty"` UserAction UserAction `json:"user_action,omitempty"` + PaymentMethod PaymentMethod `json:"payment_method,omitempty"` //LandingPage string `json:"landing_page,omitempty"` // not found in documentation ReturnURL string `json:"return_url,omitempty"` CancelURL string `json:"cancel_url,omitempty"` } + // Doc: https://developer.paypal.com/api/orders/v2/#definition-payment_method + PaymentMethod struct { + PayeePreferred PayeePreferred `json:"payee_preferred,omitempty"` + StandardEntryClassCode StandardEntryClassCode `json:"standard_entry_class_code,omitempty"` + } + // Authorization struct Authorization struct { ID string `json:"id,omitempty"`