Adding PaymentMethod support into ApplicationContext (#237)

This commit is contained in:
maxzhao-bolt 2022-03-17 11:33:06 -07:00 committed by GitHub
parent 5c5393bd47
commit c9ae5c4190
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -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"
)

View File

@ -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"`