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

feat(api)!: remove some endpoints and other API updates #297

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 115
configured_endpoints: 110
62 changes: 5 additions & 57 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ import (
// automatically. You should not instantiate this service directly, and instead use
// the [NewAccountService] method instead.
type AccountService struct {
Options []option.RequestOption
CreditConfigurations *AccountCreditConfigurationService
Options []option.RequestOption
}

// NewAccountService generates a new service that applies the given options to each
Expand All @@ -35,7 +34,6 @@ type AccountService struct {
func NewAccountService(opts ...option.RequestOption) (r *AccountService) {
r = &AccountService{}
r.Options = opts
r.CreditConfigurations = NewAccountCreditConfigurationService(opts...)
return
}

Expand Down Expand Up @@ -111,6 +109,9 @@ type Account struct {
// account_token returned by the enroll endpoint. If using this parameter, do not
// include pagination.
Token string `json:"token,required" format:"uuid"`
// Timestamp of when the account was created. For accounts created before
// 2023-05-11, this field will be null.
Created time.Time `json:"created,required,nullable" format:"date-time"`
// Spend limit information for the user containing the daily, monthly, and lifetime
// spend limit of the account. Any charges to a card owned by this account will be
// declined once their transaction volume has surpassed the value in the applicable
Expand Down Expand Up @@ -139,6 +140,7 @@ type Account struct {
// accountJSON contains the JSON metadata for the struct [Account]
type accountJSON struct {
Token apijson.Field
Created apijson.Field
SpendLimit apijson.Field
State apijson.Field
AccountHolder apijson.Field
Expand Down Expand Up @@ -403,60 +405,6 @@ func (r accountSpendLimitsSpendVelocityJSON) RawJSON() string {
return r.raw
}

type BusinessAccount struct {
// Account token
Token string `json:"token,required" format:"uuid"`
CollectionsConfiguration BusinessAccountCollectionsConfiguration `json:"collections_configuration"`
// Credit limit extended to the Account
CreditLimit int64 `json:"credit_limit"`
JSON businessAccountJSON `json:"-"`
}

// businessAccountJSON contains the JSON metadata for the struct [BusinessAccount]
type businessAccountJSON struct {
Token apijson.Field
CollectionsConfiguration apijson.Field
CreditLimit apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *BusinessAccount) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r businessAccountJSON) RawJSON() string {
return r.raw
}

type BusinessAccountCollectionsConfiguration struct {
// Number of days within the billing period
BillingPeriod int64 `json:"billing_period,required"`
// Number of days after the billing period ends that a payment is required
PaymentPeriod int64 `json:"payment_period,required"`
// The external bank account token to use for auto-collections
ExternalBankAccountToken string `json:"external_bank_account_token" format:"uuid"`
JSON businessAccountCollectionsConfigurationJSON `json:"-"`
}

// businessAccountCollectionsConfigurationJSON contains the JSON metadata for the
// struct [BusinessAccountCollectionsConfiguration]
type businessAccountCollectionsConfigurationJSON struct {
BillingPeriod apijson.Field
PaymentPeriod apijson.Field
ExternalBankAccountToken apijson.Field
raw string
ExtraFields map[string]apijson.Field
}

func (r *BusinessAccountCollectionsConfiguration) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}

func (r businessAccountCollectionsConfigurationJSON) RawJSON() string {
return r.raw
}

type AccountUpdateParams struct {
// Amount (in cents) for the account's daily spend limit. By default the daily
// spend limit is set to $1,250.
Expand Down
73 changes: 0 additions & 73 deletions accountcreditconfiguration.go

This file was deleted.

67 changes: 0 additions & 67 deletions accountcreditconfiguration_test.go

This file was deleted.

69 changes: 52 additions & 17 deletions accountholder.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,15 @@ type AccountHolder struct {
//
// > Primary phone of Account Holder, entered in E.164 format.
PhoneNumber string `json:"phone_number"`
// <Deprecated. Use verification_application.status instead> KYC and KYB evaluation
// states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for
// the `ADVANCED` workflow.
// <Deprecated. Use verification_application.status instead>
//
// KYC and KYB evaluation states.
//
// Note:
//
// - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
// `KYC_ADVANCED` workflow.
// - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
Status AccountHolderStatus `json:"status"`
// <Deprecated. Use verification_application.status_reasons> Reason for the
// evaluation status.
Expand Down Expand Up @@ -531,21 +537,28 @@ func (r accountHolderIndividualJSON) RawJSON() string {
return r.raw
}

// <Deprecated. Use verification_application.status instead> KYC and KYB evaluation
// states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for
// the `ADVANCED` workflow.
// <Deprecated. Use verification_application.status instead>
//
// KYC and KYB evaluation states.
//
// Note:
//
// - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
// `KYC_ADVANCED` workflow.
// - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
type AccountHolderStatus string

const (
AccountHolderStatusAccepted AccountHolderStatus = "ACCEPTED"
AccountHolderStatusPendingReview AccountHolderStatus = "PENDING_REVIEW"
AccountHolderStatusPendingDocument AccountHolderStatus = "PENDING_DOCUMENT"
AccountHolderStatusPendingResubmit AccountHolderStatus = "PENDING_RESUBMIT"
AccountHolderStatusRejected AccountHolderStatus = "REJECTED"
)

func (r AccountHolderStatus) IsKnown() bool {
switch r {
case AccountHolderStatusAccepted, AccountHolderStatusPendingDocument, AccountHolderStatusPendingResubmit, AccountHolderStatusRejected:
case AccountHolderStatusAccepted, AccountHolderStatusPendingReview, AccountHolderStatusPendingDocument, AccountHolderStatusPendingResubmit, AccountHolderStatusRejected:
return true
}
return false
Expand Down Expand Up @@ -598,8 +611,13 @@ func (r AccountHolderUserType) IsKnown() bool {
type AccountHolderVerificationApplication struct {
// Timestamp of when the application was created.
Created time.Time `json:"created" format:"date-time"`
// KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT`
// are only applicable for the `ADVANCED` workflow.
// KYC and KYB evaluation states.
//
// Note:
//
// - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
// `KYC_ADVANCED` workflow.
// - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
Status AccountHolderVerificationApplicationStatus `json:"status"`
// Reason for the evaluation status.
StatusReasons []AccountHolderVerificationApplicationStatusReason `json:"status_reasons"`
Expand Down Expand Up @@ -627,20 +645,26 @@ func (r accountHolderVerificationApplicationJSON) RawJSON() string {
return r.raw
}

// KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT`
// are only applicable for the `ADVANCED` workflow.
// KYC and KYB evaluation states.
//
// Note:
//
// - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
// `KYC_ADVANCED` workflow.
// - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
type AccountHolderVerificationApplicationStatus string

const (
AccountHolderVerificationApplicationStatusAccepted AccountHolderVerificationApplicationStatus = "ACCEPTED"
AccountHolderVerificationApplicationStatusPendingReview AccountHolderVerificationApplicationStatus = "PENDING_REVIEW"
AccountHolderVerificationApplicationStatusPendingDocument AccountHolderVerificationApplicationStatus = "PENDING_DOCUMENT"
AccountHolderVerificationApplicationStatusPendingResubmit AccountHolderVerificationApplicationStatus = "PENDING_RESUBMIT"
AccountHolderVerificationApplicationStatusRejected AccountHolderVerificationApplicationStatus = "REJECTED"
)

func (r AccountHolderVerificationApplicationStatus) IsKnown() bool {
switch r {
case AccountHolderVerificationApplicationStatusAccepted, AccountHolderVerificationApplicationStatusPendingDocument, AccountHolderVerificationApplicationStatusPendingResubmit, AccountHolderVerificationApplicationStatusRejected:
case AccountHolderVerificationApplicationStatusAccepted, AccountHolderVerificationApplicationStatusPendingReview, AccountHolderVerificationApplicationStatusPendingDocument, AccountHolderVerificationApplicationStatusPendingResubmit, AccountHolderVerificationApplicationStatusRejected:
return true
}
return false
Expand Down Expand Up @@ -1131,8 +1155,13 @@ type AccountHolderNewResponse struct {
Token string `json:"token,required" format:"uuid"`
// Globally unique identifier for the account.
AccountToken string `json:"account_token,required" format:"uuid"`
// KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT`
// are only applicable for the `ADVANCED` workflow.
// KYC and KYB evaluation states.
//
// Note:
//
// - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
// `KYC_ADVANCED` workflow.
// - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
Status AccountHolderNewResponseStatus `json:"status,required"`
// Reason for the evaluation status.
StatusReasons []AccountHolderNewResponseStatusReason `json:"status_reasons,required"`
Expand Down Expand Up @@ -1165,20 +1194,26 @@ func (r accountHolderNewResponseJSON) RawJSON() string {
return r.raw
}

// KYC and KYB evaluation states. Note: `PENDING_RESUBMIT` and `PENDING_DOCUMENT`
// are only applicable for the `ADVANCED` workflow.
// KYC and KYB evaluation states.
//
// Note:
//
// - `PENDING_RESUBMIT` and `PENDING_DOCUMENT` are only applicable for the
// `KYC_ADVANCED` workflow.
// - `PENDING_REVIEW` is only applicable for the `KYB_BASIC` workflow.
type AccountHolderNewResponseStatus string

const (
AccountHolderNewResponseStatusAccepted AccountHolderNewResponseStatus = "ACCEPTED"
AccountHolderNewResponseStatusPendingReview AccountHolderNewResponseStatus = "PENDING_REVIEW"
AccountHolderNewResponseStatusPendingDocument AccountHolderNewResponseStatus = "PENDING_DOCUMENT"
AccountHolderNewResponseStatusPendingResubmit AccountHolderNewResponseStatus = "PENDING_RESUBMIT"
AccountHolderNewResponseStatusRejected AccountHolderNewResponseStatus = "REJECTED"
)

func (r AccountHolderNewResponseStatus) IsKnown() bool {
switch r {
case AccountHolderNewResponseStatusAccepted, AccountHolderNewResponseStatusPendingDocument, AccountHolderNewResponseStatusPendingResubmit, AccountHolderNewResponseStatusRejected:
case AccountHolderNewResponseStatusAccepted, AccountHolderNewResponseStatusPendingReview, AccountHolderNewResponseStatusPendingDocument, AccountHolderNewResponseStatusPendingResubmit, AccountHolderNewResponseStatusRejected:
return true
}
return false
Expand Down
Loading