Skip to content

Commit c9ae5c4

Browse files
authored
Adding PaymentMethod support into ApplicationContext (#237)
1 parent 5c5393b commit c9ae5c4

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

const.go

+14
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,17 @@ const (
102102
ProductCategorySoftwareOther ProductCategory = "OTHER"
103103
ProductCategorySoftwareServices ProductCategory = "SERVICES"
104104
)
105+
106+
type PayeePreferred string // Doc: https://developer.paypal.com/api/orders/v2/#definition-payment_method
107+
const (
108+
PayeePreferredUnrestricted PayeePreferred = "UNRESTRICTED"
109+
PayeePreferredImmediatePaymentRequired PayeePreferred = "IMMEDIATE_PAYMENT_REQUIRED"
110+
)
111+
112+
type StandardEntryClassCode string // Doc: https://developer.paypal.com/api/orders/v2/#definition-payment_method
113+
const (
114+
StandardEntryClassCodeTel StandardEntryClassCode="TEL"
115+
StandardEntryClassCodeWeb StandardEntryClassCode="WEB"
116+
StandardEntryClassCodeCcd StandardEntryClassCode="CCD"
117+
StandardEntryClassCodePpd StandardEntryClassCode="PPD"
118+
)

types.go

+7
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,18 @@ type (
198198
Locale string `json:"locale,omitempty"`
199199
ShippingPreference ShippingPreference `json:"shipping_preference,omitempty"`
200200
UserAction UserAction `json:"user_action,omitempty"`
201+
PaymentMethod PaymentMethod `json:"payment_method,omitempty"`
201202
//LandingPage string `json:"landing_page,omitempty"` // not found in documentation
202203
ReturnURL string `json:"return_url,omitempty"`
203204
CancelURL string `json:"cancel_url,omitempty"`
204205
}
205206

207+
// Doc: https://developer.paypal.com/api/orders/v2/#definition-payment_method
208+
PaymentMethod struct {
209+
PayeePreferred PayeePreferred `json:"payee_preferred,omitempty"`
210+
StandardEntryClassCode StandardEntryClassCode `json:"standard_entry_class_code,omitempty"`
211+
}
212+
206213
// Authorization struct
207214
Authorization struct {
208215
ID string `json:"id,omitempty"`

0 commit comments

Comments
 (0)