Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ReportingCategory to BalanceTransaction #1008

Merged
merged 1 commit into from
Jan 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 48 additions & 14 deletions balancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,39 @@ const (
BalanceTransactionSourceTypeTransfer BalanceTransactionSourceType = "transfer"
)

// BalanceTransactionReportingCategory represents reporting categories for balance transactions.
type BalanceTransactionReportingCategory string

// List of values that BalanceTransactionReportingCategory can take.
const (
BalanceTransactionReportingCategoryAdvance BalanceTransactionReportingCategory = "advance"
BalanceTransactionReportingCategoryAdvanceFunding BalanceTransactionReportingCategory = "advance_funding"
BalanceTransactionReportingCategoryCharge BalanceTransactionReportingCategory = "charge"
BalanceTransactionReportingCategoryChargeFailure BalanceTransactionReportingCategory = "charge_failure"
BalanceTransactionReportingCategoryConnectCollectionTransfer BalanceTransactionReportingCategory = "connect_collection_transfer"
BalanceTransactionReportingCategoryConnectReservedFunds BalanceTransactionReportingCategory = "connect_reserved_funds"
BalanceTransactionReportingCategoryDispute BalanceTransactionReportingCategory = "dispute"
BalanceTransactionReportingCategoryDisputeReversal BalanceTransactionReportingCategory = "dispute_reversal"
BalanceTransactionReportingCategoryFee BalanceTransactionReportingCategory = "fee"
BalanceTransactionReportingCategoryIssuingAuthorizationHold BalanceTransactionReportingCategory = "issuing_authorization_hold"
BalanceTransactionReportingCategoryIssuingAuthorizationRelease BalanceTransactionReportingCategory = "issuing_authorization_release"
BalanceTransactionReportingCategoryIssuingTransaction BalanceTransactionReportingCategory = "issuing_transaction"
BalanceTransactionReportingCategoryOtherAdjustment BalanceTransactionReportingCategory = "other_adjustment"
BalanceTransactionReportingCategoryPartialCaptureReversal BalanceTransactionReportingCategory = "partial_capture_reversal"
BalanceTransactionReportingCategoryPayout BalanceTransactionReportingCategory = "payout"
BalanceTransactionReportingCategoryPayoutReversal BalanceTransactionReportingCategory = "payout_reversal"
BalanceTransactionReportingCategoryPlatformEarning BalanceTransactionReportingCategory = "platform_earning"
BalanceTransactionReportingCategoryPlatformEarningRefund BalanceTransactionReportingCategory = "platform_earning_refund"
BalanceTransactionReportingCategoryRefund BalanceTransactionReportingCategory = "refund"
BalanceTransactionReportingCategoryRefundFailure BalanceTransactionReportingCategory = "refund_failure"
BalanceTransactionReportingCategoryRiskReservedFunds BalanceTransactionReportingCategory = "risk_reserved_funds"
BalanceTransactionReportingCategoryTax BalanceTransactionReportingCategory = "tax"
BalanceTransactionReportingCategoryTopup BalanceTransactionReportingCategory = "topup"
BalanceTransactionReportingCategoryTopupReversal BalanceTransactionReportingCategory = "topup_reversal"
BalanceTransactionReportingCategoryTransfer BalanceTransactionReportingCategory = "transfer"
BalanceTransactionReportingCategoryTransferReversal BalanceTransactionReportingCategory = "transfer_reversal"
)

// BalanceTransactionSource describes the source of a balance Transaction.
// The Type should indicate which object is fleshed out.
// For more details see https://stripe.com/docs/api#retrieve_balance_transaction
Expand Down Expand Up @@ -93,20 +126,21 @@ type BalanceTransactionListParams struct {
// BalanceTransaction is the resource representing the balance transaction.
// For more details see https://stripe.com/docs/api/#balance.
type BalanceTransaction struct {
Amount int64 `json:"amount"`
AvailableOn int64 `json:"available_on"`
Created int64 `json:"created"`
Currency Currency `json:"currency"`
Description string `json:"description"`
ExchangeRate float64 `json:"exchange_rate"`
ID string `json:"id"`
Fee int64 `json:"fee"`
FeeDetails []*BalanceTransactionFee `json:"fee_details"`
Net int64 `json:"net"`
Recipient string `json:"recipient"`
Source *BalanceTransactionSource `json:"source"`
Status BalanceTransactionStatus `json:"status"`
Type BalanceTransactionType `json:"type"`
Amount int64 `json:"amount"`
AvailableOn int64 `json:"available_on"`
Created int64 `json:"created"`
Currency Currency `json:"currency"`
Description string `json:"description"`
ExchangeRate float64 `json:"exchange_rate"`
ID string `json:"id"`
Fee int64 `json:"fee"`
FeeDetails []*BalanceTransactionFee `json:"fee_details"`
Net int64 `json:"net"`
Recipient string `json:"recipient"`
ReportingCategory BalanceTransactionReportingCategory `json:"reporting_category"`
Source *BalanceTransactionSource `json:"source"`
Status BalanceTransactionStatus `json:"status"`
Type BalanceTransactionType `json:"type"`
}

// BalanceTransactionList is a list of transactions as returned from a list endpoint.
Expand Down