mirror of
https://github.com/plutov/paypal.git
synced 2025-01-23 10:21:03 +01:00
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
|
//Doc: https://developer.paypal.com/docs/api/subscriptions/v1/#definition-transaction
|
||||||
type SubscriptionTransactionStatus string
|
type SubscriptionTransactionStatus string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SubscriptionCaptureStatusCompleted SubscriptionTransactionStatus = "COMPLETED"
|
SubscriptionCaptureStatusCompleted SubscriptionTransactionStatus = "COMPLETED"
|
||||||
SubscriptionCaptureStatusDeclined SubscriptionTransactionStatus = "DECLINED"
|
SubscriptionCaptureStatusDeclined SubscriptionTransactionStatus = "DECLINED"
|
||||||
|
@ -74,6 +75,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
type CaptureType string
|
type CaptureType string
|
||||||
|
|
||||||
const (
|
const (
|
||||||
CaptureTypeOutstandingBalance CaptureType = "OUTSTANDING_BALANCE"
|
CaptureTypeOutstandingBalance CaptureType = "OUTSTANDING_BALANCE"
|
||||||
)
|
)
|
||||||
|
|
|
@ -57,8 +57,6 @@ func (self *Product) GetUpdatePatch() []Patch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// CreateProduct creates a product
|
// CreateProduct creates a product
|
||||||
// Doc: https://developer.paypal.com/docs/api/catalog-products/v1/#products_create
|
// Doc: https://developer.paypal.com/docs/api/catalog-products/v1/#products_create
|
||||||
// Endpoint: POST /v1/catalogs/products
|
// Endpoint: POST /v1/catalogs/products
|
||||||
|
|
29
types.go
29
types.go
|
@ -116,12 +116,31 @@ const (
|
||||||
FeatureUpdateCustomerDispute string = "UPDATE_CUSTOMER_DISPUTES"
|
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
|
// https://developer.paypal.com/docs/api/payments.payouts-batch/v1/?mark=recipient_wallet#definition-recipient_wallet
|
||||||
const (
|
const (
|
||||||
PaypalRecipientWallet string = "PAYPAL"
|
PaypalRecipientWallet string = "PAYPAL"
|
||||||
VenmoRecipientWallet string = "VENMO"
|
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 (
|
const (
|
||||||
LinkRelSelf string = "self"
|
LinkRelSelf string = "self"
|
||||||
LinkRelActionURL string = "action_url"
|
LinkRelActionURL string = "action_url"
|
||||||
|
@ -138,10 +157,10 @@ type (
|
||||||
|
|
||||||
// Address struct
|
// Address struct
|
||||||
Address struct {
|
Address struct {
|
||||||
Line1 string `json:"line1"`
|
Line1 string `json:"line1,omitempty"`
|
||||||
Line2 string `json:"line2,omitempty"`
|
Line2 string `json:"line2,omitempty"`
|
||||||
City string `json:"city"`
|
City string `json:"city,omitempty"`
|
||||||
CountryCode string `json:"country_code"`
|
CountryCode string `json:"country_code,omitempty"`
|
||||||
PostalCode string `json:"postal_code,omitempty"`
|
PostalCode string `json:"postal_code,omitempty"`
|
||||||
State string `json:"state,omitempty"`
|
State string `json:"state,omitempty"`
|
||||||
Phone string `json:"phone,omitempty"`
|
Phone string `json:"phone,omitempty"`
|
||||||
|
@ -520,6 +539,7 @@ type (
|
||||||
PurchaseUnit struct {
|
PurchaseUnit struct {
|
||||||
ReferenceID string `json:"reference_id"`
|
ReferenceID string `json:"reference_id"`
|
||||||
Amount *PurchaseUnitAmount `json:"amount,omitempty"`
|
Amount *PurchaseUnitAmount `json:"amount,omitempty"`
|
||||||
|
Payments *CapturedPayments `json:"payments,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// TaxInfo used for orders.
|
// TaxInfo used for orders.
|
||||||
|
@ -616,6 +636,7 @@ type (
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
CustomID string `json:"custom_id,omitempty"`
|
CustomID string `json:"custom_id,omitempty"`
|
||||||
Amount *PurchaseUnitAmount `json:"amount,omitempty"`
|
Amount *PurchaseUnitAmount `json:"amount,omitempty"`
|
||||||
|
SellerProtection *SellerProtection `json:"seller_protection,omitempty"`
|
||||||
SellerReceivableBreakdown *SellerReceivableBreakdown `json:"seller_receivable_breakdown,omitempty"`
|
SellerReceivableBreakdown *SellerReceivableBreakdown `json:"seller_receivable_breakdown,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -650,6 +671,7 @@ type (
|
||||||
EmailAddress string `json:"email_address,omitempty"`
|
EmailAddress string `json:"email_address,omitempty"`
|
||||||
Phone *PhoneWithType `json:"phone,omitempty"`
|
Phone *PhoneWithType `json:"phone,omitempty"`
|
||||||
PayerID string `json:"payer_id,omitempty"`
|
PayerID string `json:"payer_id,omitempty"`
|
||||||
|
Address Address `json:"address,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CaptureOrderResponse is the response for capture order
|
// CaptureOrderResponse is the response for capture order
|
||||||
|
@ -657,6 +679,7 @@ type (
|
||||||
ID string `json:"id,omitempty"`
|
ID string `json:"id,omitempty"`
|
||||||
Status string `json:"status,omitempty"`
|
Status string `json:"status,omitempty"`
|
||||||
Payer *PayerWithNameAndPhone `json:"payer,omitempty"`
|
Payer *PayerWithNameAndPhone `json:"payer,omitempty"`
|
||||||
|
Address *Address `json:"address,omitempty"`
|
||||||
PurchaseUnits []CapturedPurchaseUnit `json:"purchase_units,omitempty"`
|
PurchaseUnits []CapturedPurchaseUnit `json:"purchase_units,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user