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"
)
// 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 (
// JSONTime overrides MarshalJson method to format in ISO8601
JSONTime time.Time
@ -360,6 +369,10 @@ type (
ChargeModels []ChargeModel `json:"charge_models,omitempty"`
}
PaymentOptions struct {
AllowedPaymentMethod string `json:"allowed_payment_method,omitempty"`
}
// PaymentPatch PATCH /v1/payments/payment/{payment_id)
PaymentPatch struct {
Operation string `json:"op"`
@ -497,6 +510,7 @@ type (
Custom string `json:"custom,omitempty"`
SoftDescriptor string `json:"soft_descriptor,omitempty"`
RelatedResources []Related `json:"related_resources,omitempty"`
PaymentOptions *PaymentOptions `json:"payment_options,omitempty"`
}
// UserInfo struct