Merge pull request #101 from dennisstritzke/master

Adding support for PayPal Order to contain Items
This commit is contained in:
Alex Pliutau 2019-08-02 12:54:44 +02:00 committed by GitHub
commit 37b06bc520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,6 +316,7 @@ type (
SKU string `json:"sku,omitempty"`
Description string `json:"description,omitempty"`
Tax string `json:"tax,omitempty"`
UnitAmount *Money `json:"unit_amount,omitempty"`
}
// ItemList struct
@ -336,6 +337,25 @@ type (
PurchaseUnitAmount struct {
Currency string `json:"currency_code"`
Value string `json:"value"`
Breakdown *PurchaseUnitAmountBreakdown `json:"breakdown,omitempty"`
}
PurchaseUnitAmountBreakdown struct {
ItemTotal *Money `json:"item_total,omitempty"`
Shipping *Money `json:"shipping,omitempty"`
Handling *Money `json:"handling,omitempty"`
TaxTotal *Money `json:"tax_total,omitempty"`
Insurance *Money `json:"insurance,omitempty"`
ShippingDiscount *Money `json:"shipping_discount,omitempty"`
Discount *Money `json:"discount,omitempty"`
}
// Money struct
//
// https://developer.paypal.com/docs/api/orders/v2/#definition-money
Money struct {
Currency string `json:"currency_code"`
Value string `json:"value"`
}
// PurchaseUnit struct