Skip to content

Commit

Permalink
Adding PaymentMethod support into ApplicationContext (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxzhao-bolt committed Mar 17, 2022
1 parent 5c5393b commit c9ae5c4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
14 changes: 14 additions & 0 deletions const.go
Expand Up @@ -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"
)
7 changes: 7 additions & 0 deletions types.go
Expand Up @@ -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"`
Expand Down

0 comments on commit c9ae5c4

Please sign in to comment.