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

API Updates #1481

Merged
merged 2 commits into from
Jun 23, 2022
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 OPENAPI_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v157
v159
20 changes: 20 additions & 0 deletions account.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,16 @@ const (
AccountCapabilitiesPayNowPaymentsPending AccountCapabilitiesPayNowPayments = "pending"
)

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

// List of values that AccountCapabilitiesPromptPayPayments can take
const (
AccountCapabilitiesPromptPayPaymentsActive AccountCapabilitiesPromptPayPayments = "active"
AccountCapabilitiesPromptPayPaymentsInactive AccountCapabilitiesPromptPayPayments = "inactive"
AccountCapabilitiesPromptPayPaymentsPending AccountCapabilitiesPromptPayPayments = "pending"
)

// The status of the banking capability, or whether the account can have bank accounts.
type AccountCapabilitiesTreasury string

Expand Down Expand Up @@ -447,6 +457,12 @@ type AccountCapabilitiesPayNowPaymentsParams struct {
Requested *bool `form:"requested"`
}

// The promptpay_payments capability.
type AccountCapabilitiesPromptPayPaymentsParams 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 sepa_debit_payments capability.
type AccountCapabilitiesSEPADebitPaymentsParams 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 @@ -539,6 +555,8 @@ type AccountCapabilitiesParams struct {
P24Payments *AccountCapabilitiesP24PaymentsParams `form:"p24_payments"`
// The paynow_payments capability.
PayNowPayments *AccountCapabilitiesPayNowPaymentsParams `form:"paynow_payments"`
// The promptpay_payments capability.
PromptPayPayments *AccountCapabilitiesPromptPayPaymentsParams `form:"promptpay_payments"`
// The sepa_debit_payments capability.
SEPADebitPayments *AccountCapabilitiesSEPADebitPaymentsParams `form:"sepa_debit_payments"`
// The sofort_payments capability.
Expand Down Expand Up @@ -945,6 +963,8 @@ type AccountCapabilities struct {
P24Payments AccountCapabilityStatus `json:"p24_payments"`
// The status of the paynow payments capability of the account, or whether the account can directly process paynow charges.
PayNowPayments AccountCapabilitiesPayNowPayments `json:"paynow_payments"`
// The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges.
PromptPayPayments AccountCapabilitiesPromptPayPayments `json:"promptpay_payments"`
// The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges.
SEPADebitPayments AccountCapabilityStatus `json:"sepa_debit_payments"`
// The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges.
Expand Down
5 changes: 5 additions & 0 deletions charge.go
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,10 @@ type ChargePaymentMethodDetailsPayNow struct {
// Reference number associated with this PayNow payment
Reference string `json:"reference"`
}
type ChargePaymentMethodDetailsPromptPay struct {
// Bill reference generated by PromptPay
Reference string `json:"reference"`
}
type ChargePaymentMethodDetailsSepaCreditTransfer struct {
// Name of the bank associated with the bank account.
BankName string `json:"bank_name"`
Expand Down Expand Up @@ -877,6 +881,7 @@ type ChargePaymentMethodDetails struct {
OXXO *ChargePaymentMethodDetailsOXXO `json:"oxxo"`
P24 *ChargePaymentMethodDetailsP24 `json:"p24"`
PayNow *ChargePaymentMethodDetailsPayNow `json:"paynow"`
PromptPay *ChargePaymentMethodDetailsPromptPay `json:"promptpay"`
SepaCreditTransfer *ChargePaymentMethodDetailsSepaCreditTransfer `json:"sepa_credit_transfer"`
SepaDebit *ChargePaymentMethodDetailsSepaDebit `json:"sepa_debit"`
Sofort *ChargePaymentMethodDetailsSofort `json:"sofort"`
Expand Down
2 changes: 2 additions & 0 deletions creditnote.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ type CreditNote struct {
Status CreditNoteStatus `json:"status"`
// The integer amount in %s representing the amount of the credit note, excluding exclusive tax and invoice level discounts.
Subtotal int64 `json:"subtotal"`
// The integer amount in %s representing the amount of the credit note, excluding all tax and invoice level discounts.
SubtotalExcludingTax int64 `json:"subtotal_excluding_tax"`
// The aggregate amounts calculated per tax rate for all line items.
TaxAmounts []*CreditNoteTaxAmount `json:"tax_amounts"`
// The integer amount in %s representing the total amount of the credit note, including tax and all discount.
Expand Down
4 changes: 4 additions & 0 deletions creditnotelineitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ type CreditNoteLineItemDiscountAmount struct {
type CreditNoteLineItem struct {
// The integer amount in %s representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts.
Amount int64 `json:"amount"`
// The integer amount in %s representing the amount being credited for this line item, excluding all tax and discounts.
AmountExcludingTax int64 `json:"amount_excluding_tax"`
// Description of the item being credited.
Description string `json:"description"`
// The integer amount in %s representing the discount being credited for this line item.
Expand All @@ -54,6 +56,8 @@ type CreditNoteLineItem struct {
UnitAmount int64 `json:"unit_amount"`
// Same as `unit_amount`, but contains a decimal value with at most 12 decimal places.
UnitAmountDecimal float64 `json:"unit_amount_decimal,string"`
// The amount in %s representing the unit amount being credited for this line item, excluding all tax and discounts.
UnitAmountExcludingTax float64 `json:"unit_amount_excluding_tax,string"`
}

// CreditNoteLineItemList is a list of CreditNoteLineItems as retrieved from a list endpoint.
Expand Down
1 change: 1 addition & 0 deletions example/generated_examples_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// File generated from our OpenAPI spec
package example

import (
Expand Down
13 changes: 13 additions & 0 deletions invoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const (
InvoicePaymentSettingsPaymentMethodTypeKonbini InvoicePaymentSettingsPaymentMethodType = "konbini"
InvoicePaymentSettingsPaymentMethodTypeLink InvoicePaymentSettingsPaymentMethodType = "link"
InvoicePaymentSettingsPaymentMethodTypePayNow InvoicePaymentSettingsPaymentMethodType = "paynow"
InvoicePaymentSettingsPaymentMethodTypePromptPay InvoicePaymentSettingsPaymentMethodType = "promptpay"
InvoicePaymentSettingsPaymentMethodTypeSepaCreditTransfer InvoicePaymentSettingsPaymentMethodType = "sepa_credit_transfer"
InvoicePaymentSettingsPaymentMethodTypeSepaDebit InvoicePaymentSettingsPaymentMethodType = "sepa_debit"
InvoicePaymentSettingsPaymentMethodTypeSofort InvoicePaymentSettingsPaymentMethodType = "sofort"
Expand Down Expand Up @@ -281,6 +282,12 @@ type InvoicePaymentSettingsParams struct {
PaymentMethodTypes []*string `form:"payment_method_types"`
}

// Options for invoice PDF rendering.
type InvoiceRenderingOptionsParams struct {
// How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts.
AmountTaxDisplay *string `form:"amount_tax_display"`
}

// If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge.
type InvoiceTransferDataParams struct {
// The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred.
Expand Down Expand Up @@ -329,6 +336,8 @@ type InvoiceParams struct {
PaymentSettings *InvoicePaymentSettingsParams `form:"payment_settings"`
// How to handle pending invoice items on invoice creation. One of `include`, `exclude`, or `include_and_require`. `include` will include any pending invoice items, and will create an empty draft invoice if no pending invoice items exist. `include_and_require` will include any pending invoice items, if no pending invoice items exist then the request will fail. `exclude` will always create an empty invoice draft regardless if there are pending invoice items or not. Defaults to `include_and_require` if the parameter is omitted.
PendingInvoiceItemsBehavior *string `form:"pending_invoice_items_behavior"`
// Options for invoice PDF rendering.
RenderingOptions *InvoiceRenderingOptionsParams `form:"rendering_options"`
// The identifier of the unstarted schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields.
Schedule *string `form:"schedule"`
// Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`.
Expand Down Expand Up @@ -832,6 +841,8 @@ type Invoice struct {
SubscriptionProrationDate int64 `json:"subscription_proration_date"`
// Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated
Subtotal int64 `json:"subtotal"`
// The integer amount in %s representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated
SubtotalExcludingTax int64 `json:"subtotal_excluding_tax"`
// The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice.
Tax int64 `json:"tax"`
// ID of the test clock this invoice belongs to.
Expand All @@ -841,6 +852,8 @@ type Invoice struct {
Total int64 `json:"total"`
// The aggregate amounts calculated per discount across all line items.
TotalDiscountAmounts []*InvoiceDiscountAmount `json:"total_discount_amounts"`
// The integer amount in %s representing the total amount of the invoice including all discounts but excluding all tax.
TotalExcludingTax int64 `json:"total_excluding_tax"`
// The aggregate amounts calculated per tax rate for all line items.
TotalTaxAmounts []*InvoiceTaxAmount `json:"total_tax_amounts"`
// The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice.
Expand Down
4 changes: 4 additions & 0 deletions invoicelineitem.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type InvoiceLineProrationDetails struct {
type InvoiceLine struct {
// The amount, in %s.
Amount int64 `json:"amount"`
// The integer amount in %s representing the amount for this line item, excluding all tax and discounts.
AmountExcludingTax int64 `json:"amount_excluding_tax"`
// 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).
Currency Currency `json:"currency"`
// An arbitrary string attached to the object. Often useful for displaying to users.
Expand Down Expand Up @@ -81,6 +83,8 @@ type InvoiceLine struct {
// A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`.
Type InvoiceLineType `json:"type"`
UnifiedProration bool `json:"unified_proration"`
// The amount in %s representing the unit amount for this line item, excluding all tax and discounts.
UnitAmountExcludingTax float64 `json:"unit_amount_excluding_tax,string"`
}

// Period is a structure representing a start and end dates.
Expand Down
Loading