From d1e5575c3542f5c97ef01bd3b903e0b516fd35c2 Mon Sep 17 00:00:00 2001 From: yunuseskisan Date: Fri, 23 Oct 2020 08:52:58 +0100 Subject: [PATCH] Add support for SellerReceivableBreakdown (#178) * Add support for SellerReceivableBreakdown https://developer.paypal.com/docs/api/orders/v2/#orders_capture * Update types.go * Update types.go --- types.go | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/types.go b/types.go index 655da70..ef46201 100644 --- a/types.go +++ b/types.go @@ -590,11 +590,32 @@ type ( UpdateTime *time.Time `json:"update_time,omitempty"` } + // ExchangeRate struct + // + // https://developer.paypal.com/docs/api/orders/v2/#definition-exchange_rate + ExchangeRate struct { + SourceCurrency string `json:"source_currency"` + TargetCurrency string `json:"target_currency"` + Value string `json:"value"` + } + + // SellerReceivableBreakdown has the detailed breakdown of the capture activity. + SellerReceivableBreakdown struct { + GrossAmount *Money `json:"gross_amount,omitempty"` + PaypalFee *Money `json:"paypal_fee,omitempty"` + PaypalFeeInReceivableCurrency *Money `json:"paypal_fee_in_receivable_currency,omitempty"` + NetAmount *Money `json:"net_amount,omitempty"` + ReceivableAmount *Money `json:"receivable_amount,omitempty"` + ExchangeRate *ExchangeRate `json:"exchange_rate,omitempty"` + PlatformFees []PlatformFee `json:"platform_fees,omitempty"` + } + // CaptureAmount struct CaptureAmount struct { - ID string `json:"id,omitempty"` - CustomID string `json:"custom_id,omitempty"` - Amount *PurchaseUnitAmount `json:"amount,omitempty"` + ID string `json:"id,omitempty"` + CustomID string `json:"custom_id,omitempty"` + Amount *PurchaseUnitAmount `json:"amount,omitempty"` + SellerReceivableBreakdown *SellerReceivableBreakdown `json:"seller_receivable_breakdown,omitempty"` } // CapturedPayments has the amounts for a captured order