Skip to content

Commit

Permalink
Add ReportingCategory to BalanceTransaction
Browse files Browse the repository at this point in the history
  • Loading branch information
cjavilla-stripe committed Jan 6, 2020
1 parent 1d3e4c6 commit 22f5ea5
Showing 1 changed file with 51 additions and 14 deletions.
65 changes: 51 additions & 14 deletions balancetransaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,42 @@ const (
BalanceTransactionSourceTypeTransfer BalanceTransactionSourceType = "transfer"
)

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

// List of values that BalanceTransactionReportingCategory can take.
const (
BalanceTransactionReportingCategoryAdjustment BalanceTransactionReportingCategory = "adjustment"
BalanceTransactionReportingCategoryAdvance BalanceTransactionReportingCategory = "advance"
BalanceTransactionReportingCategoryAdvanceFunding BalanceTransactionReportingCategory = "advance_funding"
BalanceTransactionReportingCategoryApplicationFee BalanceTransactionReportingCategory = "application_fee"
BalanceTransactionReportingCategoryApplicationFeeRefund BalanceTransactionReportingCategory = "application_fee_refund"
BalanceTransactionReportingCategoryCharge BalanceTransactionReportingCategory = "charge"
BalanceTransactionReportingCategoryConnectCollectionTransfer BalanceTransactionReportingCategory = "connect_collection_transfer"
BalanceTransactionReportingCategoryIssuingAuthorizationHold BalanceTransactionReportingCategory = "issuing_authorization_hold"
BalanceTransactionReportingCategoryIssuingAuthorizationRelease BalanceTransactionReportingCategory = "issuing_authorization_release"
BalanceTransactionReportingCategoryIssuingTransaction BalanceTransactionReportingCategory = "issuing_transaction"
BalanceTransactionReportingCategoryPayment BalanceTransactionReportingCategory = "payment"
BalanceTransactionReportingCategoryPaymentFailureRefund BalanceTransactionReportingCategory = "payment_failure_refund"
BalanceTransactionReportingCategoryPaymentRefund BalanceTransactionReportingCategory = "payment_refund"
BalanceTransactionReportingCategoryPayout BalanceTransactionReportingCategory = "payout"
BalanceTransactionReportingCategoryPayoutCancel BalanceTransactionReportingCategory = "payout_cancel"
BalanceTransactionReportingCategoryPayoutFailure BalanceTransactionReportingCategory = "payout_failure"
BalanceTransactionReportingCategoryRefund BalanceTransactionReportingCategory = "refund"
BalanceTransactionReportingCategoryRefundFailure BalanceTransactionReportingCategory = "refund_failure"
BalanceTransactionReportingCategoryReserveTransaction BalanceTransactionReportingCategory = "reserve_transaction"
BalanceTransactionReportingCategoryReservedFunds BalanceTransactionReportingCategory = "reserved_funds"
BalanceTransactionReportingCategoryStripeFee BalanceTransactionReportingCategory = "stripe_fee"
BalanceTransactionReportingCategoryStripeFxFee BalanceTransactionReportingCategory = "stripe_fx_fee"
BalanceTransactionReportingCategoryTaxFee BalanceTransactionReportingCategory = "tax_fee"
BalanceTransactionReportingCategoryTopup BalanceTransactionReportingCategory = "topup"
BalanceTransactionReportingCategoryTopupReversal BalanceTransactionReportingCategory = "topup_reversal"
BalanceTransactionReportingCategoryTransfer BalanceTransactionReportingCategory = "transfer"
BalanceTransactionReportingCategoryTransferCancel BalanceTransactionReportingCategory = "transfer_cancel"
BalanceTransactionReportingCategoryTransferFailure BalanceTransactionReportingCategory = "transfer_failure"
BalanceTransactionReportingCategoryTransferRefund BalanceTransactionReportingCategory = "transfer_refund"
)

// 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 +129,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

0 comments on commit 22f5ea5

Please sign in to comment.