Merge pull request #53 from soyersoyer/master

Add allowed_payment_method option
This commit is contained in:
Alex Pliutau 2018-02-08 13:48:30 +07:00 committed by GitHub
commit acdf616064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,6 +44,15 @@ const (
LandingPageTypeLogin string = "Login" LandingPageTypeLogin string = "Login"
) )
// Possible value for `allowed_payment_method` in PaymentOptions
//
// https://developer.paypal.com/docs/api/payments/#definition-payment_options
const (
AllowedPaymentUnrestricted string = "UNRESTRICTED"
AllowedPaymentInstantFundingSource string = "INSTANT_FUNDING_SOURCE"
AllowedPaymentImmediatePay string = "IMMEDIATE_PAY"
)
type ( type (
// JSONTime overrides MarshalJson method to format in ISO8601 // JSONTime overrides MarshalJson method to format in ISO8601
JSONTime time.Time JSONTime time.Time
@ -360,6 +369,10 @@ type (
ChargeModels []ChargeModel `json:"charge_models,omitempty"` ChargeModels []ChargeModel `json:"charge_models,omitempty"`
} }
PaymentOptions struct {
AllowedPaymentMethod string `json:"allowed_payment_method,omitempty"`
}
// PaymentPatch PATCH /v1/payments/payment/{payment_id) // PaymentPatch PATCH /v1/payments/payment/{payment_id)
PaymentPatch struct { PaymentPatch struct {
Operation string `json:"op"` Operation string `json:"op"`
@ -490,13 +503,14 @@ type (
// Transaction struct // Transaction struct
Transaction struct { Transaction struct {
Amount *Amount `json:"amount"` Amount *Amount `json:"amount"`
Description string `json:"description,omitempty"` Description string `json:"description,omitempty"`
ItemList *ItemList `json:"item_list,omitempty"` ItemList *ItemList `json:"item_list,omitempty"`
InvoiceNumber string `json:"invoice_number,omitempty"` InvoiceNumber string `json:"invoice_number,omitempty"`
Custom string `json:"custom,omitempty"` Custom string `json:"custom,omitempty"`
SoftDescriptor string `json:"soft_descriptor,omitempty"` SoftDescriptor string `json:"soft_descriptor,omitempty"`
RelatedResources []Related `json:"related_resources,omitempty"` RelatedResources []Related `json:"related_resources,omitempty"`
PaymentOptions *PaymentOptions `json:"payment_options,omitempty"`
} }
// UserInfo struct // UserInfo struct