forked from go-packages/paypal
Order should include payments & purchase_units (#179)
* Order should include purchase_units * PayerWithNameAndPhone needs Address for Order * add SellerProtection to CaptureAmount * add RecipientType(s) * add RecipientType(s) * BatchHeader.BatchStatus values
This commit is contained in:
parent
13112c66e5
commit
476102bb76
2
const.go
2
const.go
|
@ -65,6 +65,7 @@ const (
|
|||
|
||||
//Doc: https://developer.paypal.com/docs/api/subscriptions/v1/#definition-transaction
|
||||
type SubscriptionTransactionStatus string
|
||||
|
||||
const (
|
||||
SubscriptionCaptureStatusCompleted SubscriptionTransactionStatus = "COMPLETED"
|
||||
SubscriptionCaptureStatusDeclined SubscriptionTransactionStatus = "DECLINED"
|
||||
|
@ -74,6 +75,7 @@ const (
|
|||
)
|
||||
|
||||
type CaptureType string
|
||||
|
||||
const (
|
||||
CaptureTypeOutstandingBalance CaptureType = "OUTSTANDING_BALANCE"
|
||||
)
|
||||
|
|
|
@ -57,8 +57,6 @@ func (self *Product) GetUpdatePatch() []Patch {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// CreateProduct creates a product
|
||||
// Doc: https://developer.paypal.com/docs/api/catalog-products/v1/#products_create
|
||||
// Endpoint: POST /v1/catalogs/products
|
||||
|
|
29
types.go
29
types.go
|
@ -116,12 +116,31 @@ const (
|
|||
FeatureUpdateCustomerDispute string = "UPDATE_CUSTOMER_DISPUTES"
|
||||
)
|
||||
|
||||
// https://developer.paypal.com/docs/api/payments.payouts-batch/v1/?mark=recipient_type#definition-recipient_type
|
||||
const (
|
||||
EmailRecipientType string = "EMAIL" // An unencrypted email — string of up to 127 single-byte characters.
|
||||
PaypalIdRecipientType string = "PAYPAL_ID" // An encrypted PayPal account number.
|
||||
PhoneRecipientType string = "PHONE" // An unencrypted phone number.
|
||||
// Note: The PayPal sandbox doesn't support type PHONE
|
||||
)
|
||||
|
||||
// https://developer.paypal.com/docs/api/payments.payouts-batch/v1/?mark=recipient_wallet#definition-recipient_wallet
|
||||
const (
|
||||
PaypalRecipientWallet string = "PAYPAL"
|
||||
VenmoRecipientWallet string = "VENMO"
|
||||
)
|
||||
|
||||
// Possible value for `batch_status` in GetPayout
|
||||
//
|
||||
// https://developer.paypal.com/docs/api/payments.payouts-batch/v1/#definition-batch_status
|
||||
const (
|
||||
BatchStatusDenied string = "DENIED"
|
||||
BatchStatusPending string = "PENDING"
|
||||
BatchStatusProcessing string = "PROCESSING"
|
||||
BatchStatusSuccess string = "SUCCESS"
|
||||
BatchStatusCanceled string = "CANCELED"
|
||||
)
|
||||
|
||||
const (
|
||||
LinkRelSelf string = "self"
|
||||
LinkRelActionURL string = "action_url"
|
||||
|
@ -138,10 +157,10 @@ type (
|
|||
|
||||
// Address struct
|
||||
Address struct {
|
||||
Line1 string `json:"line1"`
|
||||
Line1 string `json:"line1,omitempty"`
|
||||
Line2 string `json:"line2,omitempty"`
|
||||
City string `json:"city"`
|
||||
CountryCode string `json:"country_code"`
|
||||
City string `json:"city,omitempty"`
|
||||
CountryCode string `json:"country_code,omitempty"`
|
||||
PostalCode string `json:"postal_code,omitempty"`
|
||||
State string `json:"state,omitempty"`
|
||||
Phone string `json:"phone,omitempty"`
|
||||
|
@ -520,6 +539,7 @@ type (
|
|||
PurchaseUnit struct {
|
||||
ReferenceID string `json:"reference_id"`
|
||||
Amount *PurchaseUnitAmount `json:"amount,omitempty"`
|
||||
Payments *CapturedPayments `json:"payments,omitempty"`
|
||||
}
|
||||
|
||||
// TaxInfo used for orders.
|
||||
|
@ -616,6 +636,7 @@ type (
|
|||
ID string `json:"id,omitempty"`
|
||||
CustomID string `json:"custom_id,omitempty"`
|
||||
Amount *PurchaseUnitAmount `json:"amount,omitempty"`
|
||||
SellerProtection *SellerProtection `json:"seller_protection,omitempty"`
|
||||
SellerReceivableBreakdown *SellerReceivableBreakdown `json:"seller_receivable_breakdown,omitempty"`
|
||||
}
|
||||
|
||||
|
@ -650,6 +671,7 @@ type (
|
|||
EmailAddress string `json:"email_address,omitempty"`
|
||||
Phone *PhoneWithType `json:"phone,omitempty"`
|
||||
PayerID string `json:"payer_id,omitempty"`
|
||||
Address Address `json:"address,omitempty"`
|
||||
}
|
||||
|
||||
// CaptureOrderResponse is the response for capture order
|
||||
|
@ -657,6 +679,7 @@ type (
|
|||
ID string `json:"id,omitempty"`
|
||||
Status string `json:"status,omitempty"`
|
||||
Payer *PayerWithNameAndPhone `json:"payer,omitempty"`
|
||||
Address *Address `json:"address,omitempty"`
|
||||
PurchaseUnits []CapturedPurchaseUnit `json:"purchase_units,omitempty"`
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user