Skip to content

Commit

Permalink
Codegen for openapi v165 (#1497)
Browse files Browse the repository at this point in the history
  • Loading branch information
pakrym-stripe authored Jul 18, 2022
1 parent cea6514 commit 6e6feef
Show file tree
Hide file tree
Showing 11 changed files with 151 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v164
v165
20 changes: 20 additions & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ const (
AccountCapabilitiesBankTransferPaymentsPending AccountCapabilitiesBankTransferPayments = "pending"
)

// The status of the blik payments capability of the account, or whether the account can directly process blik charges.
type AccountCapabilitiesBLIKPayments string

// List of values that AccountCapabilitiesBLIKPayments can take
const (
AccountCapabilitiesBLIKPaymentsActive AccountCapabilitiesBLIKPayments = "active"
AccountCapabilitiesBLIKPaymentsInactive AccountCapabilitiesBLIKPayments = "inactive"
AccountCapabilitiesBLIKPaymentsPending AccountCapabilitiesBLIKPayments = "pending"
)

// The status of the konbini payments capability of the account, or whether the account can directly process konbini charges.
type AccountCapabilitiesKonbiniPayments string

Expand Down Expand Up @@ -355,6 +365,12 @@ type AccountCapabilitiesBankTransferPaymentsParams struct {
Requested *bool `form:"requested"`
}

// The blik_payments capability.
type AccountCapabilitiesBLIKPaymentsParams struct {
// Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
Requested *bool `form:"requested"`
}

// The boleto_payments capability.
type AccountCapabilitiesBoletoPaymentsParams struct {
// Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays.
Expand Down Expand Up @@ -521,6 +537,8 @@ type AccountCapabilitiesParams struct {
BancontactPayments *AccountCapabilitiesBancontactPaymentsParams `form:"bancontact_payments"`
// The bank_transfer_payments capability.
BankTransferPayments *AccountCapabilitiesBankTransferPaymentsParams `form:"bank_transfer_payments"`
// The blik_payments capability.
BLIKPayments *AccountCapabilitiesBLIKPaymentsParams `form:"blik_payments"`
// The boleto_payments capability.
BoletoPayments *AccountCapabilitiesBoletoPaymentsParams `form:"boleto_payments"`
// The card_issuing capability.
Expand Down Expand Up @@ -929,6 +947,8 @@ type AccountCapabilities struct {
BancontactPayments AccountCapabilityStatus `json:"bancontact_payments"`
// The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges.
BankTransferPayments AccountCapabilitiesBankTransferPayments `json:"bank_transfer_payments"`
// The status of the blik payments capability of the account, or whether the account can directly process blik charges.
BLIKPayments AccountCapabilitiesBLIKPayments `json:"blik_payments"`
// The status of the boleto payments capability of the account, or whether the account can directly process boleto charges.
BoletoPayments AccountCapabilityStatus `json:"boleto_payments"`
// The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards
Expand Down
2 changes: 2 additions & 0 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ type ChargePaymentMethodDetailsBancontact struct {
// (if supported) at the time of authorization or settlement. They cannot be set or mutated.
VerifiedName string `json:"verified_name"`
}
type ChargePaymentMethodDetailsBLIK struct{}
type ChargePaymentMethodDetailsBoleto struct {
// The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers)
TaxID string `json:"tax_id"`
Expand Down Expand Up @@ -864,6 +865,7 @@ type ChargePaymentMethodDetails struct {
AUBECSDebit *ChargePaymentMethodDetailsAUBECSDebit `json:"au_becs_debit"`
BACSDebit *ChargePaymentMethodDetailsBACSDebit `json:"bacs_debit"`
Bancontact *ChargePaymentMethodDetailsBancontact `json:"bancontact"`
BLIK *ChargePaymentMethodDetailsBLIK `json:"blik"`
Boleto *ChargePaymentMethodDetailsBoleto `json:"boleto"`
Card *ChargePaymentMethodDetailsCard `json:"card"`
CardPresent *ChargePaymentMethodDetailsCardPresent `json:"card_present"`
Expand Down
1 change: 1 addition & 0 deletions checkout_session.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ type CheckoutSessionConsentCollectionPromotions string
// List of values that CheckoutSessionConsentCollectionPromotions can take
const (
CheckoutSessionConsentCollectionPromotionsAuto CheckoutSessionConsentCollectionPromotions = "auto"
CheckoutSessionConsentCollectionPromotionsNone CheckoutSessionConsentCollectionPromotions = "none"
)

// Configure whether a Checkout Session creates a Customer when the Checkout Session completes.
Expand Down
2 changes: 1 addition & 1 deletion issuing_card.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ type IssuingCard struct {
Cardholder *IssuingCardholder `json:"cardholder"`
// Time at which the object was created. Measured in seconds since the Unix epoch.
Created int64 `json:"created"`
// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies).
// Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK.
Currency Currency `json:"currency"`
// The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint.
CVC string `json:"cvc"`
Expand Down
38 changes: 38 additions & 0 deletions mandate.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,26 @@ const (
MandatePaymentMethodDetailsBACSDebitNetworkStatusRevoked MandatePaymentMethodDetailsBACSDebitNetworkStatus = "revoked"
)

// Frequency interval of each recurring payment.
type MandatePaymentMethodDetailsBLIKOffSessionInterval string

// List of values that MandatePaymentMethodDetailsBLIKOffSessionInterval can take
const (
MandatePaymentMethodDetailsBLIKOffSessionIntervalDay MandatePaymentMethodDetailsBLIKOffSessionInterval = "day"
MandatePaymentMethodDetailsBLIKOffSessionIntervalMonth MandatePaymentMethodDetailsBLIKOffSessionInterval = "month"
MandatePaymentMethodDetailsBLIKOffSessionIntervalWeek MandatePaymentMethodDetailsBLIKOffSessionInterval = "week"
MandatePaymentMethodDetailsBLIKOffSessionIntervalYear MandatePaymentMethodDetailsBLIKOffSessionInterval = "year"
)

// Type of the mandate.
type MandatePaymentMethodDetailsBLIKType string

// List of values that MandatePaymentMethodDetailsBLIKType can take
const (
MandatePaymentMethodDetailsBLIKTypeOffSession MandatePaymentMethodDetailsBLIKType = "off_session"
MandatePaymentMethodDetailsBLIKTypeOnSession MandatePaymentMethodDetailsBLIKType = "on_session"
)

// The status of the mandate, which indicates whether it can be used to initiate a payment.
type MandateStatus string

Expand Down Expand Up @@ -117,6 +137,23 @@ type MandatePaymentMethodDetailsBACSDebit struct {
// The URL that will contain the mandate that the customer has signed.
URL string `json:"url"`
}
type MandatePaymentMethodDetailsBLIKOffSession struct {
// Amount of each recurring payment.
Amount int64 `json:"amount"`
// Currency of each recurring payment.
Currency Currency `json:"currency"`
// Frequency interval of each recurring payment.
Interval MandatePaymentMethodDetailsBLIKOffSessionInterval `json:"interval"`
// Frequency indicator of each recurring payment.
IntervalCount int64 `json:"interval_count"`
}
type MandatePaymentMethodDetailsBLIK struct {
// Date at which the mandate expires.
ExpiresAfter int64 `json:"expires_after"`
OffSession *MandatePaymentMethodDetailsBLIKOffSession `json:"off_session"`
// Type of the mandate.
Type MandatePaymentMethodDetailsBLIKType `json:"type"`
}
type MandatePaymentMethodDetailsCard struct{}
type MandatePaymentMethodDetailsLink struct{}
type MandatePaymentMethodDetailsSepaDebit struct {
Expand All @@ -130,6 +167,7 @@ type MandatePaymentMethodDetails struct {
ACSSDebit *MandatePaymentMethodDetailsACSSDebit `json:"acss_debit"`
AUBECSDebit *MandatePaymentMethodDetailsAUBECSDebit `json:"au_becs_debit"`
BACSDebit *MandatePaymentMethodDetailsBACSDebit `json:"bacs_debit"`
BLIK *MandatePaymentMethodDetailsBLIK `json:"blik"`
Card *MandatePaymentMethodDetailsCard `json:"card"`
Link *MandatePaymentMethodDetailsLink `json:"link"`
SepaDebit *MandatePaymentMethodDetailsSepaDebit `json:"sepa_debit"`
Expand Down
19 changes: 17 additions & 2 deletions paymentintent.go
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,9 @@ type PaymentIntentMandateDataParams struct {
// If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method.
type PaymentIntentPaymentMethodDataAffirmParams struct{}

// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
type PaymentIntentPaymentMethodDataBLIKParams struct{}

// If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method.
type PaymentIntentPaymentMethodDataCustomerBalanceParams struct{}

Expand Down Expand Up @@ -757,6 +760,8 @@ type PaymentIntentPaymentMethodDataParams struct {
Bancontact *PaymentMethodBancontactParams `form:"bancontact"`
// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
BillingDetails *BillingDetailsParams `form:"billing_details"`
// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
BLIK *PaymentIntentPaymentMethodDataBLIKParams `form:"blik"`
// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
Boleto *PaymentMethodBoletoParams `form:"boleto"`
Card *PaymentMethodCardParams `form:"card"`
Expand Down Expand Up @@ -923,6 +928,12 @@ type PaymentIntentPaymentMethodOptionsBancontactParams struct {
SetupFutureUsage *string `form:"setup_future_usage"`
}

// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
type PaymentIntentPaymentMethodOptionsBLIKParams struct {
// The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation.
Code *string `form:"code"`
}

// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
type PaymentIntentPaymentMethodOptionsBoletoParams struct {
// The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time.
Expand Down Expand Up @@ -1331,6 +1342,8 @@ type PaymentIntentPaymentMethodOptionsParams struct {
BACSDebit *PaymentIntentPaymentMethodOptionsBACSDebitParams `form:"bacs_debit"`
// If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options.
Bancontact *PaymentIntentPaymentMethodOptionsBancontactParams `form:"bancontact"`
// If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options.
BLIK *PaymentIntentPaymentMethodOptionsBLIKParams `form:"blik"`
// If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options.
Boleto *PaymentIntentPaymentMethodOptionsBoletoParams `form:"boleto"`
// Configuration for any card payments attempted on this PaymentIntent.
Expand Down Expand Up @@ -1698,7 +1711,7 @@ type PaymentIntentNextActionBoletoDisplayDetails struct {
type PaymentIntentNextActionCardAwaitNotification struct {
// The time that payment will be attempted. If customer approval is required, they need to provide approval before this time.
ChargeAttemptAt int64 `json:"charge_attempt_at"`
// For payments greater than INR 5000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required.
// For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required.
CustomerApprovalRequired bool `json:"customer_approval_required"`
}

Expand Down Expand Up @@ -2002,6 +2015,7 @@ type PaymentIntentPaymentMethodOptionsBancontact struct {
// When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication).
SetupFutureUsage PaymentIntentPaymentMethodOptionsBancontactSetupFutureUsage `json:"setup_future_usage"`
}
type PaymentIntentPaymentMethodOptionsBLIK struct{}
type PaymentIntentPaymentMethodOptionsBoleto struct {
// The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time.
ExpiresAfterDays int64 `json:"expires_after_days"`
Expand Down Expand Up @@ -2300,6 +2314,7 @@ type PaymentIntentPaymentMethodOptions struct {
AUBECSDebit *PaymentIntentPaymentMethodOptionsAUBECSDebit `json:"au_becs_debit"`
BACSDebit *PaymentIntentPaymentMethodOptionsBACSDebit `json:"bacs_debit"`
Bancontact *PaymentIntentPaymentMethodOptionsBancontact `json:"bancontact"`
BLIK *PaymentIntentPaymentMethodOptionsBLIK `json:"blik"`
Boleto *PaymentIntentPaymentMethodOptionsBoleto `json:"boleto"`
Card *PaymentIntentPaymentMethodOptionsCard `json:"card"`
CardPresent *PaymentIntentPaymentMethodOptionsCardPresent `json:"card_present"`
Expand All @@ -2323,7 +2338,7 @@ type PaymentIntentPaymentMethodOptions struct {
WechatPay *PaymentIntentPaymentMethodOptionsWechatPay `json:"wechat_pay"`
}
type PaymentIntentProcessingCardCustomerNotification struct {
// Whether customer approval has been requested for this payment. For payments greater than INR 5000 or mandate amount, the customer must provide explicit approval of the payment with their bank.
// Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank.
ApprovalRequested bool `json:"approval_requested"`
// If customer approval is required, they need to provide approval before this time.
CompletesAt int64 `json:"completes_at"`
Expand Down
2 changes: 2 additions & 0 deletions paymentlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ type PaymentLinkConsentCollectionPromotions string
// List of values that PaymentLinkConsentCollectionPromotions can take
const (
PaymentLinkConsentCollectionPromotionsAuto PaymentLinkConsentCollectionPromotions = "auto"
PaymentLinkConsentCollectionPromotionsNone PaymentLinkConsentCollectionPromotions = "none"
)

// Configuration for Customer creation during checkout.
Expand Down Expand Up @@ -72,6 +73,7 @@ const (
PaymentLinkPaymentMethodTypeAUBECSDebit PaymentLinkPaymentMethodType = "au_becs_debit"
PaymentLinkPaymentMethodTypeBACSDebit PaymentLinkPaymentMethodType = "bacs_debit"
PaymentLinkPaymentMethodTypeBancontact PaymentLinkPaymentMethodType = "bancontact"
PaymentLinkPaymentMethodTypeBLIK PaymentLinkPaymentMethodType = "blik"
PaymentLinkPaymentMethodTypeBoleto PaymentLinkPaymentMethodType = "boleto"
PaymentLinkPaymentMethodTypeCard PaymentLinkPaymentMethodType = "card"
PaymentLinkPaymentMethodTypeEPS PaymentLinkPaymentMethodType = "eps"
Expand Down
8 changes: 8 additions & 0 deletions paymentmethod.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const (
PaymentMethodTypeAUBECSDebit PaymentMethodType = "au_becs_debit"
PaymentMethodTypeBACSDebit PaymentMethodType = "bacs_debit"
PaymentMethodTypeBancontact PaymentMethodType = "bancontact"
PaymentMethodTypeBLIK PaymentMethodType = "blik"
PaymentMethodTypeBoleto PaymentMethodType = "boleto"
PaymentMethodTypeCard PaymentMethodType = "card"
PaymentMethodTypeCardPresent PaymentMethodType = "card_present"
Expand Down Expand Up @@ -173,6 +174,9 @@ type BillingDetailsParams struct {
Phone *string `form:"phone"`
}

// If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method.
type PaymentMethodBLIKParams struct{}

// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
type PaymentMethodBoletoParams struct {
// The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers)
Expand Down Expand Up @@ -318,6 +322,8 @@ type PaymentMethodParams struct {
Bancontact *PaymentMethodBancontactParams `form:"bancontact"`
// Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods.
BillingDetails *BillingDetailsParams `form:"billing_details"`
// This is a legacy parameter that will be removed in the future. It is a hash that does not accept any keys.
BLIK *PaymentMethodBLIKParams `form:"blik"`
// If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method.
Boleto *PaymentMethodBoletoParams `form:"boleto"`
// If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly.
Expand Down Expand Up @@ -441,6 +447,7 @@ type BillingDetails struct {
// Billing phone number (including extension).
Phone string `json:"phone"`
}
type PaymentMethodBLIK struct{}
type PaymentMethodBoleto struct {
// Uniquely identifies the customer tax id (CNPJ or CPF)
TaxID string `json:"tax_id"`
Expand Down Expand Up @@ -666,6 +673,7 @@ type PaymentMethod struct {
BACSDebit *PaymentMethodBACSDebit `json:"bacs_debit"`
Bancontact *PaymentMethodBancontact `json:"bancontact"`
BillingDetails *BillingDetails `json:"billing_details"`
BLIK *PaymentMethodBLIK `json:"blik"`
Boleto *PaymentMethodBoleto `json:"boleto"`
Card *PaymentMethodCard `json:"card"`
CardPresent *PaymentMethodCardPresent `json:"card_present"`
Expand Down
2 changes: 2 additions & 0 deletions setupattempt.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ type SetupAttemptPaymentMethodDetailsBancontact struct {
// (if supported) at the time of authorization or settlement. They cannot be set or mutated.
VerifiedName string `json:"verified_name"`
}
type SetupAttemptPaymentMethodDetailsBLIK struct{}
type SetupAttemptPaymentMethodDetailsBoleto struct{}

// Populated if this authorization used 3D Secure authentication.
Expand Down Expand Up @@ -190,6 +191,7 @@ type SetupAttemptPaymentMethodDetails struct {
AUBECSDebit *SetupAttemptPaymentMethodDetailsAUBECSDebit `json:"au_becs_debit"`
BACSDebit *SetupAttemptPaymentMethodDetailsBACSDebit `json:"bacs_debit"`
Bancontact *SetupAttemptPaymentMethodDetailsBancontact `json:"bancontact"`
BLIK *SetupAttemptPaymentMethodDetailsBLIK `json:"blik"`
Boleto *SetupAttemptPaymentMethodDetailsBoleto `json:"boleto"`
Card *SetupAttemptPaymentMethodDetailsCard `json:"card"`
CardPresent *SetupAttemptPaymentMethodDetailsCardPresent `json:"card_present"`
Expand Down
Loading

0 comments on commit 6e6feef

Please sign in to comment.