From 35aa6322add0a17305d51451ac1d4c96199ffbe6 Mon Sep 17 00:00:00 2001 From: Remi Jannel Date: Wed, 15 Apr 2020 19:39:54 -0700 Subject: [PATCH] Remove all beta features from Issuing APIs --- issuing/authorization/client.go | 8 +- issuing/authorization/client_test.go | 4 +- issuing/cardholder/client_test.go | 1 - issuing/dispute/client_test.go | 5 +- issuing_authorization.go | 114 +++++---------------------- issuing_card.go | 102 +----------------------- issuing_cardholder.go | 23 ------ issuing_dispute.go | 88 ++------------------- issuing_transaction.go | 5 +- 9 files changed, 36 insertions(+), 314 deletions(-) diff --git a/issuing/authorization/client.go b/issuing/authorization/client.go index d25d39d996..71b6c91e84 100644 --- a/issuing/authorization/client.go +++ b/issuing/authorization/client.go @@ -17,12 +17,12 @@ type Client struct { } // Approve approves an issuing authorization. -func Approve(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { +func Approve(id string, params *stripe.IssuingAuthorizationApproveParams) (*stripe.IssuingAuthorization, error) { return getC().Approve(id, params) } // Approve updates an issuing authorization. -func (c Client) Approve(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { +func (c Client) Approve(id string, params *stripe.IssuingAuthorizationApproveParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s/approve", id) authorization := &stripe.IssuingAuthorization{} err := c.B.Call(http.MethodPost, path, c.Key, params, authorization) @@ -30,12 +30,12 @@ func (c Client) Approve(id string, params *stripe.IssuingAuthorizationParams) (* } // Decline decline an issuing authorization. -func Decline(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { +func Decline(id string, params *stripe.IssuingAuthorizationDeclineParams) (*stripe.IssuingAuthorization, error) { return getC().Decline(id, params) } // Decline updates an issuing authorization. -func (c Client) Decline(id string, params *stripe.IssuingAuthorizationParams) (*stripe.IssuingAuthorization, error) { +func (c Client) Decline(id string, params *stripe.IssuingAuthorizationDeclineParams) (*stripe.IssuingAuthorization, error) { path := stripe.FormatURLPath("/v1/issuing/authorizations/%s/decline", id) authorization := &stripe.IssuingAuthorization{} err := c.B.Call(http.MethodPost, path, c.Key, params, authorization) diff --git a/issuing/authorization/client_test.go b/issuing/authorization/client_test.go index 48dd45e797..439b318cb8 100644 --- a/issuing/authorization/client_test.go +++ b/issuing/authorization/client_test.go @@ -9,14 +9,14 @@ import ( ) func TestIssuingAuthorizationApprove(t *testing.T) { - authorization, err := Approve("iauth_123", &stripe.IssuingAuthorizationParams{}) + authorization, err := Approve("iauth_123", &stripe.IssuingAuthorizationApproveParams{}) assert.Nil(t, err) assert.NotNil(t, authorization) assert.Equal(t, "issuing.authorization", authorization.Object) } func TestIssuingAuthorizationDecline(t *testing.T) { - authorization, err := Decline("iauth_123", &stripe.IssuingAuthorizationParams{}) + authorization, err := Decline("iauth_123", &stripe.IssuingAuthorizationDeclineParams{}) assert.Nil(t, err) assert.NotNil(t, authorization) assert.Equal(t, "issuing.authorization", authorization.Object) diff --git a/issuing/cardholder/client_test.go b/issuing/cardholder/client_test.go index 2189ca984f..db75a1cc6c 100644 --- a/issuing/cardholder/client_test.go +++ b/issuing/cardholder/client_test.go @@ -35,7 +35,6 @@ func TestIssuingCardholderNew(t *testing.T) { PostalCode: stripe.String("90210"), State: stripe.String("CA"), }, - Name: stripe.String("billing name"), }, Individual: &stripe.IssuingCardholderIndividualParams{ DOB: &stripe.IssuingCardholderIndividualDOBParams{ diff --git a/issuing/dispute/client_test.go b/issuing/dispute/client_test.go index 4cfeb64e2f..a6a942ae8e 100644 --- a/issuing/dispute/client_test.go +++ b/issuing/dispute/client_test.go @@ -26,9 +26,7 @@ func TestIssuingDisputeList(t *testing.T) { } func TestIssuingDisputeNew(t *testing.T) { - params := &stripe.IssuingDisputeParams{} - params.AddMetadata("key", "value") - dispute, err := New(params) + dispute, err := New(&stripe.IssuingDisputeParams{}) assert.Nil(t, err) assert.NotNil(t, dispute) assert.Equal(t, "issuing.dispute", dispute.Object) @@ -36,7 +34,6 @@ func TestIssuingDisputeNew(t *testing.T) { func TestIssuingDisputeUpdate(t *testing.T) { params := &stripe.IssuingDisputeParams{} - params.AddMetadata("key", "value") dispute, err := Update("idp_123", params) assert.Nil(t, err) assert.NotNil(t, dispute) diff --git a/issuing_authorization.go b/issuing_authorization.go index c419a1c79b..312eff45bb 100644 --- a/issuing_authorization.go +++ b/issuing_authorization.go @@ -59,14 +59,6 @@ const ( IssuingAuthorizationRequestHistoryReasonWebhookApproved IssuingAuthorizationRequestHistoryReason = "webhook_approved" IssuingAuthorizationRequestHistoryReasonWebhookDeclined IssuingAuthorizationRequestHistoryReason = "webhook_declined" IssuingAuthorizationRequestHistoryReasonWebhookTimeout IssuingAuthorizationRequestHistoryReason = "webhook_timeout" - - // The following value is deprecated. Use IssuingAuthorizationRequestHistoryReasonSpendingControls instead. - IssuingAuthorizationRequestHistoryReasonAuthorizationControls IssuingAuthorizationRequestHistoryReason = "authorization_controls" - - // The following values are deprecated. Use IssuingAuthorizationRequestHistoryReasonVerificationFailed instead - IssuingAuthorizationRequestHistoryReasonAuthenticationFailed IssuingAuthorizationRequestHistoryReason = "authentication_failed" - IssuingAuthorizationRequestHistoryReasonIncorrectCVC IssuingAuthorizationRequestHistoryReason = "incorrect_cvc" - IssuingAuthorizationRequestHistoryReasonIncorrectExpiry IssuingAuthorizationRequestHistoryReason = "incorrect_expiry" ) // IssuingAuthorizationStatus is the possible values for status for an issuing authorization. @@ -79,18 +71,6 @@ const ( IssuingAuthorizationStatusReversed IssuingAuthorizationStatus = "reversed" ) -// IssuingAuthorizationVerificationDataAuthentication is the list of possible values for the result -// of an authentication on an issuing authorization. -type IssuingAuthorizationVerificationDataAuthentication string - -// List of values that IssuingAuthorizationVerificationDataCheck can take. -const ( - IssuingAuthorizationVerificationDataAuthenticationExempt IssuingAuthorizationVerificationDataAuthentication = "exempt" - IssuingAuthorizationVerificationDataAuthenticationFailure IssuingAuthorizationVerificationDataAuthentication = "failure" - IssuingAuthorizationVerificationDataAuthenticationNone IssuingAuthorizationVerificationDataAuthentication = "none" - IssuingAuthorizationVerificationDataAuthenticationSuccess IssuingAuthorizationVerificationDataAuthentication = "success" -) - // IssuingAuthorizationVerificationDataCheck is the list of possible values for result of a check // for verification data on an issuing authorization. type IssuingAuthorizationVerificationDataCheck string @@ -122,25 +102,21 @@ const ( IssuingAuthorizationWalletTypeSamsungPay IssuingAuthorizationWalletType = "samsung_pay" ) -// IssuingAuthorizationWalletProviderType is the list of possible values for the authorization's wallet provider. -// TODO remove in the next major version -type IssuingAuthorizationWalletProviderType string - -// List of values that IssuingAuthorizationWalletProviderType can take. -const ( - IssuingAuthorizationWalletProviderTypeApplePay IssuingAuthorizationWalletProviderType = "apple_pay" - IssuingAuthorizationWalletProviderTypeGooglePay IssuingAuthorizationWalletProviderType = "google_pay" - IssuingAuthorizationWalletProviderTypeSamsungPay IssuingAuthorizationWalletProviderType = "samsung_pay" -) - // IssuingAuthorizationParams is the set of parameters that can be used when updating an issuing authorization. type IssuingAuthorizationParams struct { Params `form:"*"` Amount *int64 `form:"amount"` +} + +// IssuingAuthorizationApproveParams is the set of parameters that can be used when approving an issuing authorization. +type IssuingAuthorizationApproveParams struct { + Params `form:"*"` + Amount *int64 `form:"amount"` +} - // The following parameter is deprecated, use Amount instead. - // TODO: remove in a future major version - HeldAmount *int64 `form:"held_amount"` +// IssuingAuthorizationDeclineParams is the set of parameters that can be used when declining an issuing authorization. +type IssuingAuthorizationDeclineParams struct { + Params `form:"*"` } // IssuingAuthorizationListParams is the set of parameters that can be used when listing issuing authorizations. @@ -153,14 +129,16 @@ type IssuingAuthorizationListParams struct { Status *string `form:"status"` } -// IssuingAuthorizationAuthorizationControls is the resource representing authorization controls on an issuing authorization. -// This is deprecated and will be removed in the next major version -type IssuingAuthorizationAuthorizationControls struct { - AllowedCategories []string `json:"allowed_categories"` - BlockedCategories []string `json:"blocked_categories"` - Currency Currency `json:"currency"` - MaxAmount int64 `json:"max_amount"` - MaxApprovals int64 `json:"max_approvals"` +// IssuingAuthorizationMerchantData is the resource representing merchant data on Issuing APIs. +type IssuingAuthorizationMerchantData struct { + Category string `json:"category"` + City string `json:"city"` + Country string `json:"country"` + Name string `json:"name"` + NetworkID string `json:"network_id"` + PostalCode string `json:"postal_code"` + State string `json:"state"` + URL string `json:"url"` } // IssuingAuthorizationPendingRequest is the resource representing details about the pending authorization request. @@ -172,14 +150,6 @@ type IssuingAuthorizationPendingRequest struct { MerchantCurrency Currency `json:"merchant_currency"` } -// IssuingAuthorizationRequestHistoryViolatedAuthorizationControl is the resource representing an -// authorizaton control that caused the authorization to fail. -// This is deprecated and will be removed in the next major version -type IssuingAuthorizationRequestHistoryViolatedAuthorizationControl struct { - Entity IssuingAuthorizationRequestHistoryViolatedAuthorizationControlEntity `json:"entity"` - Name IssuingAuthorizationRequestHistoryViolatedAuthorizationControlName `json:"name"` -} - // IssuingAuthorizationRequestHistory is the resource representing a request history on an issuing authorization. type IssuingAuthorizationRequestHistory struct { Amount int64 `json:"amount"` @@ -189,14 +159,6 @@ type IssuingAuthorizationRequestHistory struct { MerchantAmount int64 `json:"merchant_amount"` MerchantCurrency Currency `json:"merchant_currency"` Reason IssuingAuthorizationRequestHistoryReason `json:"reason"` - - // The following properties are deprecated - // TODO: remove in the next major version - AuthorizedAmount int64 `json:"authorized_amount"` - AuthorizedCurrency Currency `json:"authorized_currency"` - HeldAmount int64 `json:"held_amount"` - HeldCurrency Currency `json:"held_currency"` - ViolatedAuthorizationControls []*IssuingAuthorizationRequestHistoryViolatedAuthorizationControl `json:"violated_authorization_controls"` } // IssuingAuthorizationVerificationDataThreeDSecure is the resource representing 3DS results. @@ -211,14 +173,6 @@ type IssuingAuthorizationVerificationData struct { CVCCheck IssuingAuthorizationVerificationDataCheck `json:"cvc_check"` ExpiryCheck IssuingAuthorizationVerificationDataCheck `json:"expiry_check"` ThreeDSecure *IssuingAuthorizationVerificationDataThreeDSecure `json:"three_d_secure"` - - // The property is considered deprecated. Use AddressPostalCodeCheck instead. - // TODO remove in the next major version - AddressZipCheck IssuingAuthorizationVerificationDataCheck `json:"address_zip_check"` - - // The property is considered deprecated. Use ThreeDSecure instead. - // TODO remove in the next major version - Authentication IssuingAuthorizationVerificationDataAuthentication `json:"authentication"` } // IssuingAuthorization is the resource representing a Stripe issuing authorization. @@ -236,7 +190,7 @@ type IssuingAuthorization struct { Livemode bool `json:"livemode"` MerchantAmount int64 `json:"merchant_amount"` MerchantCurrency Currency `json:"merchant_currency"` - MerchantData *IssuingMerchantData `json:"merchant_data"` + MerchantData *IssuingAuthorizationMerchantData `json:"merchant_data"` Metadata map[string]string `json:"metadata"` Object string `json:"object"` PendingRequest *IssuingAuthorizationPendingRequest `json:"pending_request"` @@ -245,32 +199,6 @@ type IssuingAuthorization struct { Transactions []*IssuingTransaction `json:"transactions"` VerificationData *IssuingAuthorizationVerificationData `json:"verification_data"` Wallet IssuingAuthorizationWalletType `json:"wallet"` - - // This property is deprecated and we recommend that you use Wallet instead. - // TODO: remove in the next major version - WalletProvider IssuingAuthorizationWalletProviderType `json:"wallet_provider"` - - // The following properties are considered deprecated - // TODO: remove in the next major version - AuthorizedAmount int64 `json:"authorized_amount"` - AuthorizedCurrency Currency `json:"authorized_currency"` - HeldAmount int64 `json:"held_amount"` - HeldCurrency Currency `json:"held_currency"` - IsHeldAmountControllable bool `json:"is_held_amount_controllable"` - PendingAuthorizedAmount int64 `json:"pending_authorized_amount"` - PendingHeldAmount int64 `json:"pending_held_amount"` -} - -// IssuingMerchantData is the resource representing merchant data on Issuing APIs. -type IssuingMerchantData struct { - Category string `json:"category"` - City string `json:"city"` - Country string `json:"country"` - Name string `json:"name"` - NetworkID string `json:"network_id"` - PostalCode string `json:"postal_code"` - State string `json:"state"` - URL string `json:"url"` } // IssuingAuthorizationList is a list of issuing authorizations as retrieved from a list endpoint. diff --git a/issuing_card.go b/issuing_card.go index b82cd1e530..87844b0e5d 100644 --- a/issuing_card.go +++ b/issuing_card.go @@ -2,7 +2,7 @@ package stripe import "encoding/json" -// IssuingCardPINStatus is the list of possible values for the status field of a Card PIN. +// IssuingCardPINStatus is the list of possible values for the status field of an issuing card PIN. type IssuingCardPINStatus string // List of values that IssuingCardPINStatus can take. @@ -60,20 +60,6 @@ const ( IssuingCardShippingServiceExpress IssuingCardShippingService = "express" IssuingCardShippingServicePriority IssuingCardShippingService = "priority" IssuingCardShippingServiceStandard IssuingCardShippingService = "standard" - - // The following value is deprecated, use IssuingCardShippingServicePriority instead - IssuingCardShippingServiceOvernight IssuingCardShippingService = "overnight" -) - -// IssuingCardShippingSpeed is the shipment speed for a card. -// This is deprecated, use IssuingCardShippingService instead -type IssuingCardShippingSpeed string - -// List of values that IssuingCardShippingSpeed can take -const ( - IssuingCardShippingSpeedExpress IssuingCardShippingSpeed = "express" - IssuingCardShippingSpeedOvernight IssuingCardShippingSpeed = "overnight" - IssuingCardShippingSpeedStandard IssuingCardShippingSpeed = "standard" ) // IssuingCardShippingType is the list of possible values for the shipping type @@ -120,55 +106,12 @@ const ( IssuingCardTypeVirtual IssuingCardType = "virtual" ) -// IssuingSpendingLimitInterval is the list of possible values for the interval of a given -// spending limit on an issuing card or cardholder. -// This is deprecated, use IssuingCardSpendingControlsSpendingLimitInterval instead -type IssuingSpendingLimitInterval string - -// List of values that IssuingCardShippingStatus can take. -const ( - IssuingSpendingLimitIntervalAllTime IssuingSpendingLimitInterval = "all_time" - IssuingSpendingLimitIntervalDaily IssuingSpendingLimitInterval = "daily" - IssuingSpendingLimitIntervalMonthly IssuingSpendingLimitInterval = "monthly" - IssuingSpendingLimitIntervalPerAuthorization IssuingSpendingLimitInterval = "per_authorization" - IssuingSpendingLimitIntervalWeekly IssuingSpendingLimitInterval = "weekly" - IssuingSpendingLimitIntervalYearly IssuingSpendingLimitInterval = "yearly" -) - -// IssuingAuthorizationControlsSpendingLimitsParams is the set of parameters that can be used for -// the spending limits associated with a given issuing card or cardholder. -// This is deprecated and will be removed in the next major version. -type IssuingAuthorizationControlsSpendingLimitsParams struct { - Amount *int64 `form:"amount"` - Categories []*string `form:"categories"` - Interval *string `form:"interval"` -} - -// AuthorizationControlsParams is the set of parameters that can be used for the shipping parameter. -// This is deprecated and will be removed in the next major version. -type AuthorizationControlsParams struct { - AllowedCategories []*string `form:"allowed_categories"` - BlockedCategories []*string `form:"blocked_categories"` - MaxApprovals *int64 `form:"max_approvals"` - SpendingLimits []*IssuingAuthorizationControlsSpendingLimitsParams `form:"spending_limits"` - - // The following parameter only applies to Cardholder - SpendingLimitsCurrency *string `form:"spending_limits_currency"` - - // The following parameter is deprecated - MaxAmount *int64 `form:"max_amount"` -} - // IssuingCardShippingParams is the set of parameters that can be used for the shipping parameter. type IssuingCardShippingParams struct { Address *AddressParams `form:"address"` Name string `form:"name"` Service *string `form:"service"` Type *string `form:"type"` - - // This parameter is deprecated. Use Service instead. - // TODO remove in the next major version - Speed *string `form:"speed"` } // IssuingCardSpendingControlsSpendingLimitParams is the set of parameters that can be used to @@ -202,12 +145,6 @@ type IssuingCardParams struct { Status *string `form:"status"` Shipping *IssuingCardShippingParams `form:"shipping"` Type *string `form:"type"` - - // The following parameter is deprecated, use SpendingControls instead. - AuthorizationControls *AuthorizationControlsParams `form:"authorization_controls"` - - // The following parameter is deprecated - Name *string `form:"name"` } // IssuingCardListParams is the set of parameters that can be used when listing issuing cards. @@ -221,10 +158,6 @@ type IssuingCardListParams struct { Last4 *string `form:"last4"` Status *string `form:"status"` Type *string `form:"type"` - - // The following parameters are deprecated - Name *string `form:"name"` - Source *string `form:"source"` } // IssuingCardDetails is the resource representing issuing card details. @@ -238,29 +171,6 @@ type IssuingCardDetails struct { Object string `json:"object"` } -// IssuingAuthorizationControlsSpendingLimits is the resource representing spending limits -// associated with a card or cardholder. -type IssuingAuthorizationControlsSpendingLimits struct { - Amount int64 `json:"amount"` - Categories []string `json:"categories"` - Interval IssuingSpendingLimitInterval `json:"interval"` -} - -// IssuingCardAuthorizationControls is the resource representing authorization controls on an issuing card. -// TODO: Add the Cardholder version to "un-share" between Card and Cardholder in the next major version. -type IssuingCardAuthorizationControls struct { - AllowedCategories []string `json:"allowed_categories"` - BlockedCategories []string `json:"blocked_categories"` - MaxApprovals int64 `json:"max_approvals"` - SpendingLimits []*IssuingAuthorizationControlsSpendingLimits `json:"spending_limits"` - SpendingLimitsCurrency Currency `json:"spending_limits_currency"` - - // The properties below are deprecated and can only be used for an issuing card. - // TODO remove in the next major version - Currency Currency `json:"currency"` - MaxAmount int64 `json:"max_amount"` -} - // IssuingCardPIN contains data about the Card's PIN. type IssuingCardPIN struct { Status IssuingCardPINStatus `json:"status"` @@ -278,10 +188,6 @@ type IssuingCardShipping struct { TrackingNumber string `json:"tracking_number"` TrackingURL string `json:"tracking_url"` Type IssuingCardShippingType `json:"type"` - - // The property is deprecated. Use AddressPostalCodeCheck instead. - // TODO remove in the next major version - Speed IssuingCardShippingSpeed `json:"speed"` } // IssuingCardSpendingControlsSpendingLimit is the resource representing a spending limit @@ -325,12 +231,6 @@ type IssuingCard struct { SpendingControls *IssuingCardSpendingControls `json:"spending_controls"` Status IssuingCardStatus `json:"status"` Type IssuingCardType `json:"type"` - - // The following property is deprecated, use SpendingControls instead. - AuthorizationControls *IssuingCardAuthorizationControls `json:"authorization_controls"` - - // The following property is deprecated, use Cardholder.Name instead. - Name string `json:"name"` } // IssuingCardList is a list of issuing cards as retrieved from a list endpoint. diff --git a/issuing_cardholder.go b/issuing_cardholder.go index 5b9ee6b21e..b70caf4ff4 100644 --- a/issuing_cardholder.go +++ b/issuing_cardholder.go @@ -34,9 +34,6 @@ type IssuingCardholderStatus string const ( IssuingCardholderStatusActive IssuingCardholderStatus = "active" IssuingCardholderStatusInactive IssuingCardholderStatus = "inactive" - - // This value is deprecated - IssuingCardholderStatusPending IssuingCardholderStatus = "pending" ) // IssuingCardholderType is the type of an issuing cardholder. @@ -46,17 +43,11 @@ type IssuingCardholderType string const ( IssuingCardholderTypeCompany IssuingCardholderType = "company" IssuingCardholderTypeIndividual IssuingCardholderType = "individual" - - // This value is deprecated. Use IssuingCardholderTypeCompany instead - IssuingCardholderTypeBusinessEntity IssuingCardholderType = "business_entity" ) // IssuingBillingParams is the set of parameters that can be used for billing with the Issuing APIs. type IssuingBillingParams struct { Address *AddressParams `form:"address"` - - // This parameter is deprecated - Name *string `form:"name"` } // IssuingCardholderCompanyParams represents additional information about a @@ -124,10 +115,6 @@ type IssuingCardholderParams struct { SpendingControls *IssuingCardholderSpendingControlsParams `form:"spending_controls"` Status *string `form:"status"` Type *string `form:"type"` - - // The following parameters are deprecated - IsDefault *bool `form:"is_default"` - AuthorizationControls *AuthorizationControlsParams `form:"authorization_controls"` } // IssuingCardholderListParams is the set of parameters that can be used when listing issuing cardholders. @@ -139,18 +126,11 @@ type IssuingCardholderListParams struct { PhoneNumber *string `form:"phone_number"` Status *string `form:"status"` Type *string `form:"type"` - - // The property is considered deprecated. - // TODO remove in the next major version - IsDefault *bool `form:"is_default"` } // IssuingBilling is the resource representing the billing hash with the Issuing APIs. type IssuingBilling struct { Address *Address `json:"address"` - - // This property is deprecated - Name string `json:"name"` } // IssuingCardholderRequirements contains the verification requirements for the cardholder. @@ -231,9 +211,6 @@ type IssuingCardholder struct { SpendingControls *IssuingCardholderSpendingControls `json:"spending_controls"` Status IssuingCardholderStatus `json:"status"` Type IssuingCardholderType `json:"type"` - - // The following property is deprecated, use SpendingControls instead - AuthorizationControls *IssuingCardAuthorizationControls `json:"authorization_controls"` } // IssuingCardholderList is a list of issuing cardholders as retrieved from a list endpoint. diff --git a/issuing_dispute.go b/issuing_dispute.go index f909ffc129..9e5e06d5af 100644 --- a/issuing_dispute.go +++ b/issuing_dispute.go @@ -2,100 +2,22 @@ package stripe import "encoding/json" -// IssuingDisputeReason is the list of possible values for status on an issuing dispute. -type IssuingDisputeReason string - -// List of values that IssuingDisputeReason can take. -const ( - IssuingDisputeReasonDuplicate IssuingDisputeReason = "duplicate" - IssuingDisputeReasonFraudulent IssuingDisputeReason = "fraudulent" - IssuingDisputeReasonOther IssuingDisputeReason = "other" - IssuingDisputeReasonProductNotReceived IssuingDisputeReason = "product_not_received" -) - -// IssuingDisputeStatus is the list of possible values for status on an issuing dispute. -type IssuingDisputeStatus string - -// List of values that IssuingDisputeStatus can take. -const ( - IssuingDisputeStatusLost IssuingDisputeStatus = "lost" - IssuingDisputeStatusUnderReview IssuingDisputeStatus = "under_review" - IssuingDisputeStatusUnsubmitted IssuingDisputeStatus = "unsubmitted" - IssuingDisputeStatusWon IssuingDisputeStatus = "won" -) - -// IssuingDisputeEvidenceFraudulentParams is the subset of parameters that can be sent as evidence for an issuing dispute -// with the reason set as fraudulent. -type IssuingDisputeEvidenceFraudulentParams struct { - DisputeExplanation *string `form:"dispute_explanation"` - UncategorizedFile *string `form:"uncategorized_file"` -} - -// IssuingDisputeEvidenceOtherParams is the subset of parameters that can be sent as evidence for an issuing dispute -// with the reason set as other. -type IssuingDisputeEvidenceOtherParams struct { - DisputeExplanation *string `form:"dispute_explanation"` - UncategorizedFile *string `form:"uncategorized_file"` -} - -// IssuingDisputeEvidenceParams is the set of parameters that can be sent as evidence for an issuing dispute. -type IssuingDisputeEvidenceParams struct { - Fraudulent *IssuingDisputeEvidenceFraudulentParams `form:"fraudulent"` - Other *IssuingDisputeEvidenceOtherParams `form:"other"` -} - // IssuingDisputeParams is the set of parameters that can be used when creating or updating an issuing dispute. type IssuingDisputeParams struct { - Params `form:"*"` - Amount *int64 `form:"amount"` - Evidence *IssuingDisputeEvidenceParams `form:"evidence"` - Reason *string `form:"reason"` - DisputedTransaction *string `form:"disputed_transaction"` + Params `form:"*"` } // IssuingDisputeListParams is the set of parameters that can be used when listing issuing dispute. type IssuingDisputeListParams struct { - ListParams `form:"*"` - Created *int64 `form:"created"` - CreatedRange *RangeQueryParams `form:"created"` - DisputedTransaction *string `form:"disputed_transaction"` - Transaction *string `form:"transaction"` -} - -// IssuingDisputeEvidenceFraudulent is the resource representing the evidence hash on an issuing dispute -// with the reason set as fraudulent. -type IssuingDisputeEvidenceFraudulent struct { - DisputeExplanation string `json:"dispute_explanation"` - UncategorizedFile *File `json:"uncategorized_file"` -} - -// IssuingDisputeEvidenceOther is the resource representing the evidence hash on an issuing dispute -// with the reason set as other. -type IssuingDisputeEvidenceOther struct { - DisputeExplanation string `json:"dispute_explanation"` - UncategorizedFile *File `json:"uncategorized_file"` -} - -// IssuingDisputeEvidence is the resource representing evidence on an issuing dispute. -type IssuingDisputeEvidence struct { - Fraudulent *IssuingDisputeEvidenceFraudulent `json:"fraudulent"` - Other *IssuingDisputeEvidenceOther `json:"other"` + ListParams `form:"*"` } // IssuingDispute is the resource representing an issuing dispute. type IssuingDispute struct { APIResource - Amount int64 `json:"amount"` - Created int64 `json:"created"` - Currency Currency `json:"currency"` - Evidence *IssuingDisputeEvidence `json:"evidence"` - ID string `json:"id"` - Livemode bool `json:"livemode"` - Metadata map[string]string `json:"metadata"` - Object string `json:"object"` - Reason IssuingDisputeReason `json:"reason"` - Status IssuingDisputeStatus `json:"status"` - Transaction *IssuingTransaction `json:"transaction"` + ID string `json:"id"` + Livemode bool `json:"livemode"` + Object string `json:"object"` } // IssuingDisputeList is a list of issuing disputes as retrieved from a list endpoint. diff --git a/issuing_transaction.go b/issuing_transaction.go index f8e569d9f0..44522dc6ed 100644 --- a/issuing_transaction.go +++ b/issuing_transaction.go @@ -8,9 +8,8 @@ type IssuingTransactionType string // List of values that IssuingTransactionType can take. const ( IssuingTransactionTypeCapture IssuingTransactionType = "capture" - IssuingTransactionTypeCashWithdrawal IssuingTransactionType = "cash_withdrawal" + IssuingTransactionTypeDispute IssuingTransactionType = "dispute" IssuingTransactionTypeRefund IssuingTransactionType = "refund" - IssuingTransactionTypeRefundReversal IssuingTransactionType = "refund_reversal" ) // IssuingTransactionParams is the set of parameters that can be used when creating or updating an issuing transaction. @@ -41,7 +40,7 @@ type IssuingTransaction struct { Dispute *IssuingDispute `json:"dispute"` ID string `json:"id"` Livemode bool `json:"livemode"` - MerchantData *IssuingMerchantData `json:"merchant_data"` + MerchantData *IssuingAuthorizationMerchantData `json:"merchant_data"` MerchantAmount int64 `json:"merchant_amount"` MerchantCurrency Currency `json:"merchant_currency"` Metadata map[string]string `json:"metadata"`