Skip to content

Commit

Permalink
Add support for SellerReceivableBreakdown (#178)
Browse files Browse the repository at this point in the history
* Add support for SellerReceivableBreakdown

https://developer.paypal.com/docs/api/orders/v2/#orders_capture

* Update types.go

* Update types.go
  • Loading branch information
yunuseskisan committed Oct 23, 2020
1 parent 289b266 commit d1e5575
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d1e5575

Please sign in to comment.