From 1c83fd382739f0460d8d5c20a7fe3a26b63a9eee Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Mon, 2 Dec 2024 19:33:44 -0800 Subject: [PATCH] Add explicit attributes for fields in resources, and rbis for resources (#1490) * Add generated RBIs/fields * Manual changes, lint, rubocop, amount * fix accessors * Undo list param change and add extra fields to pass sorbet tc * add typed true * test fix * fix T.any * Ignore rbis in gem for now * fix docstrings and spaces * regen after rebase --- .rubocop.yml | 4 + lib/stripe/object_types.rb | 10 + lib/stripe/resources.rb | 10 + lib/stripe/resources/account.rb | 681 +++++ lib/stripe/resources/account_link.rb | 12 + lib/stripe/resources/account_notice.rb | 47 + lib/stripe/resources/account_session.rb | 218 ++ lib/stripe/resources/apple_pay_domain.rb | 18 + lib/stripe/resources/application.rb | 23 + lib/stripe/resources/application_fee.rb | 53 + .../resources/application_fee_refund.rb | 24 + lib/stripe/resources/apps/secret.rb | 33 + lib/stripe/resources/balance.rb | 128 + lib/stripe/resources/balance_transaction.rb | 57 + lib/stripe/resources/bank_account.rb | 105 +- lib/stripe/resources/billing/alert.rb | 37 + .../resources/billing/alert_triggered.rb | 31 + .../billing/credit_balance_summary.rb | 43 + .../billing/credit_balance_transaction.rb | 76 + lib/stripe/resources/billing/credit_grant.rb | 66 + lib/stripe/resources/billing/meter.rb | 60 + .../resources/billing/meter_error_report.rb | 65 + lib/stripe/resources/billing/meter_event.rb | 21 + .../billing/meter_event_adjustment.rb | 22 + .../resources/billing/meter_event_summary.rb | 21 + .../resources/billing_portal/configuration.rb | 130 + .../resources/billing_portal/session.rb | 108 + lib/stripe/resources/capability.rb | 91 + .../resources/capital/financing_offer.rb | 84 + .../resources/capital/financing_summary.rb | 43 + .../capital/financing_transaction.rb | 57 + lib/stripe/resources/card.rb | 105 + lib/stripe/resources/cash_balance.rb | 21 + lib/stripe/resources/charge.rb | 1329 +++++++++ lib/stripe/resources/checkout/session.rb | 1222 ++++++++ lib/stripe/resources/climate/order.rb | 95 + lib/stripe/resources/climate/product.rb | 37 + lib/stripe/resources/climate/supplier.rb | 33 + lib/stripe/resources/confirmation_token.rb | 847 ++++++ .../resources/connect_collection_transfer.rb | 29 + lib/stripe/resources/country_spec.rb | 43 + lib/stripe/resources/coupon.rb | 63 + lib/stripe/resources/credit_note.rb | 164 ++ lib/stripe/resources/credit_note_line_item.rb | 81 + lib/stripe/resources/customer.rb | 175 ++ .../resources/customer_balance_transaction.rb | 39 + .../customer_cash_balance_transaction.rb | 123 + lib/stripe/resources/customer_session.rb | 69 + lib/stripe/resources/discount.rb | 41 + lib/stripe/resources/dispute.rb | 248 ++ .../entitlements/active_entitlement.rb | 15 + .../active_entitlement_summary.rb | 26 + lib/stripe/resources/entitlements/feature.rb | 21 + lib/stripe/resources/ephemeral_key.rb | 18 + lib/stripe/resources/event.rb | 75 + lib/stripe/resources/exchange_rate.rb | 9 + lib/stripe/resources/file.rb | 33 + lib/stripe/resources/file_link.rb | 27 + .../financial_connections/account.rb | 153 + .../account_inferred_balance.rb | 16 + .../financial_connections/account_owner.rb | 24 + .../account_ownership.rb | 12 + .../financial_connections/institution.rb | 53 + .../financial_connections/session.rb | 75 + .../financial_connections/transaction.rb | 42 + lib/stripe/resources/forwarding/request.rb | 69 + lib/stripe/resources/funding_instructions.rb | 312 +++ lib/stripe/resources/gift_cards/card.rb | 61 + .../resources/gift_cards/transaction.rb | 64 + .../resources/identity/verification_report.rb | 214 ++ .../identity/verification_session.rb | 147 + lib/stripe/resources/invoice.rb | 695 +++++ lib/stripe/resources/invoice_item.rb | 81 + lib/stripe/resources/invoice_line_item.rb | 141 + lib/stripe/resources/invoice_payment.rb | 56 + .../resources/invoice_rendering_template.rb | 24 + lib/stripe/resources/issuing/authorization.rb | 290 ++ lib/stripe/resources/issuing/card.rb | 189 ++ lib/stripe/resources/issuing/cardholder.rb | 147 + .../issuing/credit_underwriting_record.rb | 105 + lib/stripe/resources/issuing/dispute.rb | 169 ++ .../issuing/dispute_settlement_detail.rb | 33 + .../issuing/fraud_liability_debit.rb | 24 + .../issuing/personalization_design.rb | 63 + .../resources/issuing/physical_bundle.rb | 29 + lib/stripe/resources/issuing/settlement.rb | 65 + lib/stripe/resources/issuing/token.rb | 113 + lib/stripe/resources/issuing/transaction.rb | 234 ++ lib/stripe/resources/line_item.rb | 90 + lib/stripe/resources/login_link.rb | 9 + lib/stripe/resources/mandate.rb | 170 ++ lib/stripe/resources/margin.rb | 27 + lib/stripe/resources/order.rb | 557 ++++ .../resources/payment_attempt_record.rb | 151 + lib/stripe/resources/payment_intent.rb | 1971 +++++++++++++ lib/stripe/resources/payment_link.rb | 354 +++ lib/stripe/resources/payment_method.rb | 831 ++++++ .../resources/payment_method_configuration.rb | 851 ++++++ lib/stripe/resources/payment_method_domain.rb | 87 + lib/stripe/resources/payment_record.rb | 161 ++ lib/stripe/resources/payout.rb | 84 + lib/stripe/resources/person.rb | 294 ++ lib/stripe/resources/plan.rb | 85 + lib/stripe/resources/price.rb | 155 + lib/stripe/resources/product.rb | 97 + lib/stripe/resources/product_feature.rb | 16 + lib/stripe/resources/promotion_code.rb | 55 + lib/stripe/resources/quote.rb | 557 ++++ lib/stripe/resources/quote_line.rb | 285 ++ lib/stripe/resources/quote_preview_invoice.rb | 689 +++++ .../quote_preview_subscription_schedule.rb | 368 +++ .../resources/radar/early_fraud_warning.rb | 24 + lib/stripe/resources/radar/value_list.rb | 33 + lib/stripe/resources/radar/value_list_item.rb | 24 + lib/stripe/resources/refund.rb | 270 ++ lib/stripe/resources/reporting/report_run.rb | 53 + lib/stripe/resources/reporting/report_type.rb | 27 + lib/stripe/resources/reserve_transaction.rb | 26 + lib/stripe/resources/reversal.rb | 30 + lib/stripe/resources/review.rb | 65 + lib/stripe/resources/setup_attempt.rb | 334 +++ lib/stripe/resources/setup_intent.rb | 374 +++ lib/stripe/resources/shipping_rate.rb | 70 + .../resources/sigma/scheduled_query_run.rb | 37 + lib/stripe/resources/source.rb | 677 +++++ .../resources/source_mandate_notification.rb | 77 + lib/stripe/resources/source_transaction.rb | 98 + lib/stripe/resources/subscription.rb | 380 +++ lib/stripe/resources/subscription_item.rb | 62 + lib/stripe/resources/subscription_schedule.rb | 356 +++ lib/stripe/resources/tax/association.rb | 58 + lib/stripe/resources/tax/calculation.rb | 178 ++ .../resources/tax/calculation_line_item.rb | 66 + lib/stripe/resources/tax/form.rb | 123 + lib/stripe/resources/tax/registration.rb | 679 +++++ lib/stripe/resources/tax/settings.rb | 57 + lib/stripe/resources/tax/transaction.rb | 153 + .../resources/tax/transaction_line_item.rb | 43 + lib/stripe/resources/tax_code.rb | 12 + .../resources/tax_deducted_at_source.rb | 26 + lib/stripe/resources/tax_id.rb | 52 + lib/stripe/resources/tax_rate.rb | 62 + .../resources/terminal/configuration.rb | 229 ++ .../resources/terminal/connection_token.rb | 9 + lib/stripe/resources/terminal/location.rb | 38 + lib/stripe/resources/terminal/reader.rb | 272 ++ .../terminal/reader_collected_data.rb | 22 + .../resources/test_helpers/test_clock.rb | 38 + lib/stripe/resources/token.rb | 37 + lib/stripe/resources/topup.rb | 48 + lib/stripe/resources/transfer.rb | 51 + .../resources/treasury/credit_reversal.rb | 46 + .../resources/treasury/debit_reversal.rb | 54 + .../resources/treasury/financial_account.rb | 97 + .../treasury/financial_account_features.rb | 198 ++ .../resources/treasury/inbound_transfer.rb | 128 + .../resources/treasury/outbound_payment.rb | 171 ++ .../resources/treasury/outbound_transfer.rb | 163 ++ .../resources/treasury/received_credit.rb | 157 ++ .../resources/treasury/received_debit.rb | 136 + lib/stripe/resources/treasury/transaction.rb | 95 + .../resources/treasury/transaction_entry.rb | 82 + lib/stripe/resources/usage_record.rb | 18 + lib/stripe/resources/usage_record_summary.rb | 27 + lib/stripe/resources/v2/amount.rb | 9 + .../resources/v2/billing/meter_event.rb | 24 + .../v2/billing/meter_event_adjustment.rb | 28 + .../v2/billing/meter_event_session.rb | 19 + lib/stripe/resources/v2/event.rb | 33 + lib/stripe/resources/v2/event_destination.rb | 75 + lib/stripe/resources/webhook_endpoint.rb | 39 + lib/stripe/stripe_object.rb | 5 + rbi/stripe/resources/account.rbi | 928 ++++++ rbi/stripe/resources/account_link.rbi | 27 + rbi/stripe/resources/account_notice.rbi | 72 + rbi/stripe/resources/account_session.rbi | 291 ++ rbi/stripe/resources/apple_pay_domain.rbi | 32 + rbi/stripe/resources/application.rbi | 23 + rbi/stripe/resources/application_fee.rbi | 78 + .../resources/application_fee_refund.rbi | 44 + rbi/stripe/resources/apps/secret.rbi | 62 + rbi/stripe/resources/balance.rbi | 186 ++ rbi/stripe/resources/balance_transaction.rbi | 90 + rbi/stripe/resources/bank_account.rbi | 146 + rbi/stripe/resources/billing/alert.rbi | 60 + .../resources/billing/alert_triggered.rbi | 33 + .../billing/credit_balance_summary.rbi | 66 + .../billing/credit_balance_transaction.rbi | 109 + rbi/stripe/resources/billing/credit_grant.rbi | 98 + rbi/stripe/resources/billing/meter.rbi | 87 + .../resources/billing/meter_error_report.rbi | 77 + rbi/stripe/resources/billing/meter_event.rbi | 39 + .../billing/meter_event_adjustment.rbi | 39 + .../resources/billing/meter_event_summary.rbi | 39 + .../billing_portal/configuration.rbi | 175 ++ .../resources/billing_portal/session.rbi | 161 ++ rbi/stripe/resources/capability.rbi | 132 + .../resources/capital/financing_offer.rbi | 121 + .../resources/capital/financing_summary.rbi | 70 + .../capital/financing_transaction.rbi | 87 + rbi/stripe/resources/card.rbi | 151 + rbi/stripe/resources/cash_balance.rbi | 36 + rbi/stripe/resources/charge.rbi | 1742 ++++++++++++ rbi/stripe/resources/checkout/session.rbi | 1505 ++++++++++ rbi/stripe/resources/climate/order.rbi | 138 + rbi/stripe/resources/climate/product.rbi | 60 + rbi/stripe/resources/climate/supplier.rbi | 55 + rbi/stripe/resources/confirmation_token.rbi | 1113 ++++++++ .../resources/connect_collection_transfer.rbi | 31 + rbi/stripe/resources/country_spec.rbi | 69 + rbi/stripe/resources/coupon.rbi | 92 + rbi/stripe/resources/credit_note.rbi | 226 ++ .../resources/credit_note_line_item.rbi | 115 + rbi/stripe/resources/customer.rbi | 242 ++ .../customer_balance_transaction.rbi | 65 + .../customer_cash_balance_transaction.rbi | 165 ++ rbi/stripe/resources/customer_session.rbi | 100 + rbi/stripe/resources/discount.rbi | 65 + rbi/stripe/resources/dispute.rbi | 351 +++ .../entitlements/active_entitlement.rbi | 30 + .../active_entitlement_summary.rbi | 26 + rbi/stripe/resources/entitlements/feature.rbi | 39 + rbi/stripe/resources/ephemeral_key.rbi | 31 + rbi/stripe/resources/event.rbi | 133 + rbi/stripe/resources/exchange_rate.rbi | 45 + rbi/stripe/resources/file.rbi | 58 + rbi/stripe/resources/file_link.rbi | 46 + .../financial_connections/account.rbi | 200 ++ .../account_inferred_balance.rbi | 30 + .../financial_connections/account_owner.rbi | 42 + .../account_ownership.rbi | 26 + .../financial_connections/institution.rbi | 76 + .../financial_connections/session.rbi | 104 + .../financial_connections/transaction.rbi | 66 + rbi/stripe/resources/forwarding/request.rbi | 115 + rbi/stripe/resources/funding_instructions.rbi | 441 +++ rbi/stripe/resources/gift_cards/card.rbi | 90 + .../resources/gift_cards/transaction.rbi | 98 + .../identity/verification_report.rbi | 300 ++ .../identity/verification_session.rbi | 209 ++ rbi/stripe/resources/invoice.rbi | 937 +++++++ rbi/stripe/resources/invoice_item.rbi | 126 + rbi/stripe/resources/invoice_line_item.rbi | 193 ++ rbi/stripe/resources/invoice_payment.rbi | 82 + .../resources/invoice_rendering_template.rbi | 41 + .../resources/issuing/authorization.rbi | 396 +++ rbi/stripe/resources/issuing/card.rbi | 263 ++ rbi/stripe/resources/issuing/cardholder.rbi | 203 ++ .../issuing/credit_underwriting_record.rbi | 146 + rbi/stripe/resources/issuing/dispute.rbi | 237 ++ .../issuing/dispute_settlement_detail.rbi | 54 + .../issuing/fraud_liability_debit.rbi | 42 + .../issuing/personalization_design.rbi | 92 + .../resources/issuing/physical_bundle.rbi | 49 + rbi/stripe/resources/issuing/settlement.rbi | 78 + rbi/stripe/resources/issuing/token.rbi | 163 ++ rbi/stripe/resources/issuing/transaction.rbi | 321 +++ rbi/stripe/resources/line_item.rbi | 123 + rbi/stripe/resources/login_link.rbi | 20 + rbi/stripe/resources/mandate.rbi | 222 ++ rbi/stripe/resources/margin.rbi | 45 + rbi/stripe/resources/order.rbi | 707 +++++ .../resources/payment_attempt_record.rbi | 208 ++ rbi/stripe/resources/payment_intent.rbi | 2488 +++++++++++++++++ rbi/stripe/resources/payment_link.rbi | 455 +++ rbi/stripe/resources/payment_method.rbi | 1074 +++++++ .../payment_method_configuration.rbi | 1111 ++++++++ .../resources/payment_method_domain.rbi | 120 + rbi/stripe/resources/payment_record.rbi | 220 ++ rbi/stripe/resources/payout.rbi | 127 + rbi/stripe/resources/person.rbi | 402 +++ rbi/stripe/resources/plan.rbi | 128 + rbi/stripe/resources/price.rbi | 217 ++ rbi/stripe/resources/product.rbi | 142 + rbi/stripe/resources/product_feature.rbi | 30 + rbi/stripe/resources/promotion_code.rbi | 82 + rbi/stripe/resources/quote.rbi | 732 +++++ rbi/stripe/resources/quote_line.rbi | 361 +++ .../resources/quote_preview_invoice.rbi | 928 ++++++ .../quote_preview_subscription_schedule.rbi | 489 ++++ .../resources/radar/early_fraud_warning.rbi | 45 + rbi/stripe/resources/radar/value_list.rbi | 56 + .../resources/radar/value_list_item.rbi | 44 + rbi/stripe/resources/refund.rbi | 352 +++ rbi/stripe/resources/reporting/report_run.rbi | 88 + .../resources/reporting/report_type.rbi | 53 + rbi/stripe/resources/reserve_transaction.rbi | 27 + rbi/stripe/resources/reversal.rbi | 60 + rbi/stripe/resources/review.rbi | 98 + rbi/stripe/resources/setup_attempt.rbi | 440 +++ rbi/stripe/resources/setup_intent.rbi | 502 ++++ rbi/stripe/resources/shipping_rate.rbi | 100 + .../resources/sigma/scheduled_query_run.rbi | 62 + rbi/stripe/resources/source.rbi | 944 +++++++ .../resources/source_mandate_notification.rbi | 88 + rbi/stripe/resources/source_transaction.rbi | 140 + rbi/stripe/resources/subscription.rbi | 497 ++++ rbi/stripe/resources/subscription_item.rbi | 86 + .../resources/subscription_schedule.rbi | 477 ++++ rbi/stripe/resources/tax/association.rbi | 84 + rbi/stripe/resources/tax/calculation.rbi | 252 ++ .../resources/tax/calculation_line_item.rbi | 98 + rbi/stripe/resources/tax/form.rbi | 164 ++ rbi/stripe/resources/tax/registration.rbi | 831 ++++++ rbi/stripe/resources/tax/settings.rbi | 83 + rbi/stripe/resources/tax/transaction.rbi | 216 ++ .../resources/tax/transaction_line_item.rbi | 66 + rbi/stripe/resources/tax_code.rbi | 24 + .../resources/tax_deducted_at_source.rbi | 27 + rbi/stripe/resources/tax_id.rbi | 80 + rbi/stripe/resources/tax_rate.rbi | 92 + .../resources/terminal/configuration.rbi | 298 ++ .../resources/terminal/connection_token.rbi | 24 + rbi/stripe/resources/terminal/location.rbi | 64 + rbi/stripe/resources/terminal/reader.rbi | 366 +++ .../terminal/reader_collected_data.rbi | 39 + .../resources/test_helpers/test_clock.rbi | 62 + rbi/stripe/resources/token.rbi | 73 + rbi/stripe/resources/topup.rbi | 76 + rbi/stripe/resources/transfer.rbi | 85 + .../resources/treasury/credit_reversal.rbi | 71 + .../resources/treasury/debit_reversal.rbi | 80 + .../resources/treasury/financial_account.rbi | 137 + .../treasury/financial_account_features.rbi | 270 ++ .../resources/treasury/inbound_transfer.rbi | 181 ++ .../resources/treasury/outbound_payment.rbi | 238 ++ .../resources/treasury/outbound_transfer.rbi | 228 ++ .../resources/treasury/received_credit.rbi | 214 ++ .../resources/treasury/received_debit.rbi | 189 ++ rbi/stripe/resources/treasury/transaction.rbi | 132 + .../resources/treasury/transaction_entry.rbi | 116 + rbi/stripe/resources/usage_record.rbi | 37 + rbi/stripe/resources/usage_record_summary.rbi | 44 + rbi/stripe/resources/v2/amount.rbi | 14 + .../resources/v2/billing/meter_event.rbi | 43 + .../v2/billing/meter_event_adjustment.rbi | 48 + .../v2/billing/meter_event_session.rbi | 36 + rbi/stripe/resources/v2/event.rbi | 53 + rbi/stripe/resources/v2/event_destination.rbi | 106 + rbi/stripe/resources/webhook_endpoint.rbi | 66 + stripe.gemspec | 3 +- 341 files changed, 61202 insertions(+), 3 deletions(-) create mode 100644 lib/stripe/resources/application.rb create mode 100644 lib/stripe/resources/billing/alert_triggered.rb create mode 100644 lib/stripe/resources/billing/meter_error_report.rb create mode 100644 lib/stripe/resources/connect_collection_transfer.rb create mode 100644 lib/stripe/resources/entitlements/active_entitlement_summary.rb create mode 100644 lib/stripe/resources/issuing/settlement.rb create mode 100644 lib/stripe/resources/quote_line.rb create mode 100644 lib/stripe/resources/reserve_transaction.rb create mode 100644 lib/stripe/resources/source_mandate_notification.rb create mode 100644 lib/stripe/resources/tax_deducted_at_source.rb create mode 100644 lib/stripe/resources/v2/amount.rb create mode 100644 rbi/stripe/resources/account.rbi create mode 100644 rbi/stripe/resources/account_link.rbi create mode 100644 rbi/stripe/resources/account_notice.rbi create mode 100644 rbi/stripe/resources/account_session.rbi create mode 100644 rbi/stripe/resources/apple_pay_domain.rbi create mode 100644 rbi/stripe/resources/application.rbi create mode 100644 rbi/stripe/resources/application_fee.rbi create mode 100644 rbi/stripe/resources/application_fee_refund.rbi create mode 100644 rbi/stripe/resources/apps/secret.rbi create mode 100644 rbi/stripe/resources/balance.rbi create mode 100644 rbi/stripe/resources/balance_transaction.rbi create mode 100644 rbi/stripe/resources/bank_account.rbi create mode 100644 rbi/stripe/resources/billing/alert.rbi create mode 100644 rbi/stripe/resources/billing/alert_triggered.rbi create mode 100644 rbi/stripe/resources/billing/credit_balance_summary.rbi create mode 100644 rbi/stripe/resources/billing/credit_balance_transaction.rbi create mode 100644 rbi/stripe/resources/billing/credit_grant.rbi create mode 100644 rbi/stripe/resources/billing/meter.rbi create mode 100644 rbi/stripe/resources/billing/meter_error_report.rbi create mode 100644 rbi/stripe/resources/billing/meter_event.rbi create mode 100644 rbi/stripe/resources/billing/meter_event_adjustment.rbi create mode 100644 rbi/stripe/resources/billing/meter_event_summary.rbi create mode 100644 rbi/stripe/resources/billing_portal/configuration.rbi create mode 100644 rbi/stripe/resources/billing_portal/session.rbi create mode 100644 rbi/stripe/resources/capability.rbi create mode 100644 rbi/stripe/resources/capital/financing_offer.rbi create mode 100644 rbi/stripe/resources/capital/financing_summary.rbi create mode 100644 rbi/stripe/resources/capital/financing_transaction.rbi create mode 100644 rbi/stripe/resources/card.rbi create mode 100644 rbi/stripe/resources/cash_balance.rbi create mode 100644 rbi/stripe/resources/charge.rbi create mode 100644 rbi/stripe/resources/checkout/session.rbi create mode 100644 rbi/stripe/resources/climate/order.rbi create mode 100644 rbi/stripe/resources/climate/product.rbi create mode 100644 rbi/stripe/resources/climate/supplier.rbi create mode 100644 rbi/stripe/resources/confirmation_token.rbi create mode 100644 rbi/stripe/resources/connect_collection_transfer.rbi create mode 100644 rbi/stripe/resources/country_spec.rbi create mode 100644 rbi/stripe/resources/coupon.rbi create mode 100644 rbi/stripe/resources/credit_note.rbi create mode 100644 rbi/stripe/resources/credit_note_line_item.rbi create mode 100644 rbi/stripe/resources/customer.rbi create mode 100644 rbi/stripe/resources/customer_balance_transaction.rbi create mode 100644 rbi/stripe/resources/customer_cash_balance_transaction.rbi create mode 100644 rbi/stripe/resources/customer_session.rbi create mode 100644 rbi/stripe/resources/discount.rbi create mode 100644 rbi/stripe/resources/dispute.rbi create mode 100644 rbi/stripe/resources/entitlements/active_entitlement.rbi create mode 100644 rbi/stripe/resources/entitlements/active_entitlement_summary.rbi create mode 100644 rbi/stripe/resources/entitlements/feature.rbi create mode 100644 rbi/stripe/resources/ephemeral_key.rbi create mode 100644 rbi/stripe/resources/event.rbi create mode 100644 rbi/stripe/resources/exchange_rate.rbi create mode 100644 rbi/stripe/resources/file.rbi create mode 100644 rbi/stripe/resources/file_link.rbi create mode 100644 rbi/stripe/resources/financial_connections/account.rbi create mode 100644 rbi/stripe/resources/financial_connections/account_inferred_balance.rbi create mode 100644 rbi/stripe/resources/financial_connections/account_owner.rbi create mode 100644 rbi/stripe/resources/financial_connections/account_ownership.rbi create mode 100644 rbi/stripe/resources/financial_connections/institution.rbi create mode 100644 rbi/stripe/resources/financial_connections/session.rbi create mode 100644 rbi/stripe/resources/financial_connections/transaction.rbi create mode 100644 rbi/stripe/resources/forwarding/request.rbi create mode 100644 rbi/stripe/resources/funding_instructions.rbi create mode 100644 rbi/stripe/resources/gift_cards/card.rbi create mode 100644 rbi/stripe/resources/gift_cards/transaction.rbi create mode 100644 rbi/stripe/resources/identity/verification_report.rbi create mode 100644 rbi/stripe/resources/identity/verification_session.rbi create mode 100644 rbi/stripe/resources/invoice.rbi create mode 100644 rbi/stripe/resources/invoice_item.rbi create mode 100644 rbi/stripe/resources/invoice_line_item.rbi create mode 100644 rbi/stripe/resources/invoice_payment.rbi create mode 100644 rbi/stripe/resources/invoice_rendering_template.rbi create mode 100644 rbi/stripe/resources/issuing/authorization.rbi create mode 100644 rbi/stripe/resources/issuing/card.rbi create mode 100644 rbi/stripe/resources/issuing/cardholder.rbi create mode 100644 rbi/stripe/resources/issuing/credit_underwriting_record.rbi create mode 100644 rbi/stripe/resources/issuing/dispute.rbi create mode 100644 rbi/stripe/resources/issuing/dispute_settlement_detail.rbi create mode 100644 rbi/stripe/resources/issuing/fraud_liability_debit.rbi create mode 100644 rbi/stripe/resources/issuing/personalization_design.rbi create mode 100644 rbi/stripe/resources/issuing/physical_bundle.rbi create mode 100644 rbi/stripe/resources/issuing/settlement.rbi create mode 100644 rbi/stripe/resources/issuing/token.rbi create mode 100644 rbi/stripe/resources/issuing/transaction.rbi create mode 100644 rbi/stripe/resources/line_item.rbi create mode 100644 rbi/stripe/resources/login_link.rbi create mode 100644 rbi/stripe/resources/mandate.rbi create mode 100644 rbi/stripe/resources/margin.rbi create mode 100644 rbi/stripe/resources/order.rbi create mode 100644 rbi/stripe/resources/payment_attempt_record.rbi create mode 100644 rbi/stripe/resources/payment_intent.rbi create mode 100644 rbi/stripe/resources/payment_link.rbi create mode 100644 rbi/stripe/resources/payment_method.rbi create mode 100644 rbi/stripe/resources/payment_method_configuration.rbi create mode 100644 rbi/stripe/resources/payment_method_domain.rbi create mode 100644 rbi/stripe/resources/payment_record.rbi create mode 100644 rbi/stripe/resources/payout.rbi create mode 100644 rbi/stripe/resources/person.rbi create mode 100644 rbi/stripe/resources/plan.rbi create mode 100644 rbi/stripe/resources/price.rbi create mode 100644 rbi/stripe/resources/product.rbi create mode 100644 rbi/stripe/resources/product_feature.rbi create mode 100644 rbi/stripe/resources/promotion_code.rbi create mode 100644 rbi/stripe/resources/quote.rbi create mode 100644 rbi/stripe/resources/quote_line.rbi create mode 100644 rbi/stripe/resources/quote_preview_invoice.rbi create mode 100644 rbi/stripe/resources/quote_preview_subscription_schedule.rbi create mode 100644 rbi/stripe/resources/radar/early_fraud_warning.rbi create mode 100644 rbi/stripe/resources/radar/value_list.rbi create mode 100644 rbi/stripe/resources/radar/value_list_item.rbi create mode 100644 rbi/stripe/resources/refund.rbi create mode 100644 rbi/stripe/resources/reporting/report_run.rbi create mode 100644 rbi/stripe/resources/reporting/report_type.rbi create mode 100644 rbi/stripe/resources/reserve_transaction.rbi create mode 100644 rbi/stripe/resources/reversal.rbi create mode 100644 rbi/stripe/resources/review.rbi create mode 100644 rbi/stripe/resources/setup_attempt.rbi create mode 100644 rbi/stripe/resources/setup_intent.rbi create mode 100644 rbi/stripe/resources/shipping_rate.rbi create mode 100644 rbi/stripe/resources/sigma/scheduled_query_run.rbi create mode 100644 rbi/stripe/resources/source.rbi create mode 100644 rbi/stripe/resources/source_mandate_notification.rbi create mode 100644 rbi/stripe/resources/source_transaction.rbi create mode 100644 rbi/stripe/resources/subscription.rbi create mode 100644 rbi/stripe/resources/subscription_item.rbi create mode 100644 rbi/stripe/resources/subscription_schedule.rbi create mode 100644 rbi/stripe/resources/tax/association.rbi create mode 100644 rbi/stripe/resources/tax/calculation.rbi create mode 100644 rbi/stripe/resources/tax/calculation_line_item.rbi create mode 100644 rbi/stripe/resources/tax/form.rbi create mode 100644 rbi/stripe/resources/tax/registration.rbi create mode 100644 rbi/stripe/resources/tax/settings.rbi create mode 100644 rbi/stripe/resources/tax/transaction.rbi create mode 100644 rbi/stripe/resources/tax/transaction_line_item.rbi create mode 100644 rbi/stripe/resources/tax_code.rbi create mode 100644 rbi/stripe/resources/tax_deducted_at_source.rbi create mode 100644 rbi/stripe/resources/tax_id.rbi create mode 100644 rbi/stripe/resources/tax_rate.rbi create mode 100644 rbi/stripe/resources/terminal/configuration.rbi create mode 100644 rbi/stripe/resources/terminal/connection_token.rbi create mode 100644 rbi/stripe/resources/terminal/location.rbi create mode 100644 rbi/stripe/resources/terminal/reader.rbi create mode 100644 rbi/stripe/resources/terminal/reader_collected_data.rbi create mode 100644 rbi/stripe/resources/test_helpers/test_clock.rbi create mode 100644 rbi/stripe/resources/token.rbi create mode 100644 rbi/stripe/resources/topup.rbi create mode 100644 rbi/stripe/resources/transfer.rbi create mode 100644 rbi/stripe/resources/treasury/credit_reversal.rbi create mode 100644 rbi/stripe/resources/treasury/debit_reversal.rbi create mode 100644 rbi/stripe/resources/treasury/financial_account.rbi create mode 100644 rbi/stripe/resources/treasury/financial_account_features.rbi create mode 100644 rbi/stripe/resources/treasury/inbound_transfer.rbi create mode 100644 rbi/stripe/resources/treasury/outbound_payment.rbi create mode 100644 rbi/stripe/resources/treasury/outbound_transfer.rbi create mode 100644 rbi/stripe/resources/treasury/received_credit.rbi create mode 100644 rbi/stripe/resources/treasury/received_debit.rbi create mode 100644 rbi/stripe/resources/treasury/transaction.rbi create mode 100644 rbi/stripe/resources/treasury/transaction_entry.rbi create mode 100644 rbi/stripe/resources/usage_record.rbi create mode 100644 rbi/stripe/resources/usage_record_summary.rbi create mode 100644 rbi/stripe/resources/v2/amount.rbi create mode 100644 rbi/stripe/resources/v2/billing/meter_event.rbi create mode 100644 rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi create mode 100644 rbi/stripe/resources/v2/billing/meter_event_session.rbi create mode 100644 rbi/stripe/resources/v2/event.rbi create mode 100644 rbi/stripe/resources/v2/event_destination.rbi create mode 100644 rbi/stripe/resources/webhook_endpoint.rbi diff --git a/.rubocop.yml b/.rubocop.yml index 755642edd..0ec0fe3e4 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -66,6 +66,10 @@ Metrics/ParameterLists: - "lib/stripe/api_operations/request.rb" - "lib/stripe/stripe_object.rb" +Naming/VariableNumber: + # We use a variety of variable number syntaxes + Enabled: false + Style/AccessModifierDeclarations: EnforcedStyle: inline diff --git a/lib/stripe/object_types.rb b/lib/stripe/object_types.rb index fcc6fc283..a63797f9c 100644 --- a/lib/stripe/object_types.rb +++ b/lib/stripe/object_types.rb @@ -17,6 +17,7 @@ def self.object_names_to_classes AccountNotice.object_name => AccountNotice, AccountSession.object_name => AccountSession, ApplePayDomain.object_name => ApplePayDomain, + Application.object_name => Application, ApplicationFee.object_name => ApplicationFee, ApplicationFeeRefund.object_name => ApplicationFeeRefund, Apps::Secret.object_name => Apps::Secret, @@ -24,10 +25,12 @@ def self.object_names_to_classes BalanceTransaction.object_name => BalanceTransaction, BankAccount.object_name => BankAccount, Billing::Alert.object_name => Billing::Alert, + Billing::AlertTriggered.object_name => Billing::AlertTriggered, Billing::CreditBalanceSummary.object_name => Billing::CreditBalanceSummary, Billing::CreditBalanceTransaction.object_name => Billing::CreditBalanceTransaction, Billing::CreditGrant.object_name => Billing::CreditGrant, Billing::Meter.object_name => Billing::Meter, + Billing::MeterErrorReport.object_name => Billing::MeterErrorReport, Billing::MeterEvent.object_name => Billing::MeterEvent, Billing::MeterEventAdjustment.object_name => Billing::MeterEventAdjustment, Billing::MeterEventSummary.object_name => Billing::MeterEventSummary, @@ -45,6 +48,7 @@ def self.object_names_to_classes Climate::Product.object_name => Climate::Product, Climate::Supplier.object_name => Climate::Supplier, ConfirmationToken.object_name => ConfirmationToken, + ConnectCollectionTransfer.object_name => ConnectCollectionTransfer, CountrySpec.object_name => CountrySpec, Coupon.object_name => Coupon, CreditNote.object_name => CreditNote, @@ -56,6 +60,7 @@ def self.object_names_to_classes Discount.object_name => Discount, Dispute.object_name => Dispute, Entitlements::ActiveEntitlement.object_name => Entitlements::ActiveEntitlement, + Entitlements::ActiveEntitlementSummary.object_name => Entitlements::ActiveEntitlementSummary, Entitlements::Feature.object_name => Entitlements::Feature, EphemeralKey.object_name => EphemeralKey, Event.object_name => Event, @@ -90,6 +95,7 @@ def self.object_names_to_classes Issuing::FraudLiabilityDebit.object_name => Issuing::FraudLiabilityDebit, Issuing::PersonalizationDesign.object_name => Issuing::PersonalizationDesign, Issuing::PhysicalBundle.object_name => Issuing::PhysicalBundle, + Issuing::Settlement.object_name => Issuing::Settlement, Issuing::Token.object_name => Issuing::Token, Issuing::Transaction.object_name => Issuing::Transaction, LineItem.object_name => LineItem, @@ -112,6 +118,7 @@ def self.object_names_to_classes ProductFeature.object_name => ProductFeature, PromotionCode.object_name => PromotionCode, Quote.object_name => Quote, + QuoteLine.object_name => QuoteLine, QuotePreviewInvoice.object_name => QuotePreviewInvoice, QuotePreviewSubscriptionSchedule.object_name => QuotePreviewSubscriptionSchedule, Radar::EarlyFraudWarning.object_name => Radar::EarlyFraudWarning, @@ -120,6 +127,7 @@ def self.object_names_to_classes Refund.object_name => Refund, Reporting::ReportRun.object_name => Reporting::ReportRun, Reporting::ReportType.object_name => Reporting::ReportType, + ReserveTransaction.object_name => ReserveTransaction, Reversal.object_name => Reversal, Review.object_name => Review, SetupAttempt.object_name => SetupAttempt, @@ -127,6 +135,7 @@ def self.object_names_to_classes ShippingRate.object_name => ShippingRate, Sigma::ScheduledQueryRun.object_name => Sigma::ScheduledQueryRun, Source.object_name => Source, + SourceMandateNotification.object_name => SourceMandateNotification, SourceTransaction.object_name => SourceTransaction, Subscription.object_name => Subscription, SubscriptionItem.object_name => SubscriptionItem, @@ -140,6 +149,7 @@ def self.object_names_to_classes Tax::Transaction.object_name => Tax::Transaction, Tax::TransactionLineItem.object_name => Tax::TransactionLineItem, TaxCode.object_name => TaxCode, + TaxDeductedAtSource.object_name => TaxDeductedAtSource, TaxId.object_name => TaxId, TaxRate.object_name => TaxRate, Terminal::Configuration.object_name => Terminal::Configuration, diff --git a/lib/stripe/resources.rb b/lib/stripe/resources.rb index 58a12bcb8..b66848372 100644 --- a/lib/stripe/resources.rb +++ b/lib/stripe/resources.rb @@ -6,6 +6,7 @@ require "stripe/resources/account_notice" require "stripe/resources/account_session" require "stripe/resources/apple_pay_domain" +require "stripe/resources/application" require "stripe/resources/application_fee" require "stripe/resources/application_fee_refund" require "stripe/resources/apps/secret" @@ -13,10 +14,12 @@ require "stripe/resources/balance_transaction" require "stripe/resources/bank_account" require "stripe/resources/billing/alert" +require "stripe/resources/billing/alert_triggered" require "stripe/resources/billing/credit_balance_summary" require "stripe/resources/billing/credit_balance_transaction" require "stripe/resources/billing/credit_grant" require "stripe/resources/billing/meter" +require "stripe/resources/billing/meter_error_report" require "stripe/resources/billing/meter_event" require "stripe/resources/billing/meter_event_adjustment" require "stripe/resources/billing/meter_event_summary" @@ -34,6 +37,7 @@ require "stripe/resources/climate/product" require "stripe/resources/climate/supplier" require "stripe/resources/confirmation_token" +require "stripe/resources/connect_collection_transfer" require "stripe/resources/country_spec" require "stripe/resources/coupon" require "stripe/resources/credit_note" @@ -45,6 +49,7 @@ require "stripe/resources/discount" require "stripe/resources/dispute" require "stripe/resources/entitlements/active_entitlement" +require "stripe/resources/entitlements/active_entitlement_summary" require "stripe/resources/entitlements/feature" require "stripe/resources/ephemeral_key" require "stripe/resources/event" @@ -78,6 +83,7 @@ require "stripe/resources/issuing/fraud_liability_debit" require "stripe/resources/issuing/personalization_design" require "stripe/resources/issuing/physical_bundle" +require "stripe/resources/issuing/settlement" require "stripe/resources/issuing/token" require "stripe/resources/issuing/transaction" require "stripe/resources/line_item" @@ -100,6 +106,7 @@ require "stripe/resources/product_feature" require "stripe/resources/promotion_code" require "stripe/resources/quote" +require "stripe/resources/quote_line" require "stripe/resources/quote_preview_invoice" require "stripe/resources/quote_preview_subscription_schedule" require "stripe/resources/radar/early_fraud_warning" @@ -108,6 +115,7 @@ require "stripe/resources/refund" require "stripe/resources/reporting/report_run" require "stripe/resources/reporting/report_type" +require "stripe/resources/reserve_transaction" require "stripe/resources/reversal" require "stripe/resources/review" require "stripe/resources/setup_attempt" @@ -115,6 +123,7 @@ require "stripe/resources/shipping_rate" require "stripe/resources/sigma/scheduled_query_run" require "stripe/resources/source" +require "stripe/resources/source_mandate_notification" require "stripe/resources/source_transaction" require "stripe/resources/subscription" require "stripe/resources/subscription_item" @@ -128,6 +137,7 @@ require "stripe/resources/tax/transaction" require "stripe/resources/tax/transaction_line_item" require "stripe/resources/tax_code" +require "stripe/resources/tax_deducted_at_source" require "stripe/resources/tax_id" require "stripe/resources/tax_rate" require "stripe/resources/terminal/configuration" diff --git a/lib/stripe/resources/account.rb b/lib/stripe/resources/account.rb index aaa3f36f9..700487bc9 100644 --- a/lib/stripe/resources/account.rb +++ b/lib/stripe/resources/account.rb @@ -34,6 +34,687 @@ def self.object_name nested_resource_class_methods :login_link, operations: %i[create] nested_resource_class_methods :person, operations: %i[create retrieve update delete list] + class BusinessProfile < Stripe::StripeObject + class AnnualRevenue < Stripe::StripeObject + # A non-negative integer representing the amount in the [smallest currency unit](/currencies#zero-decimal). + attr_reader :amount + # 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). + attr_reader :currency + # The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + attr_reader :fiscal_year_end + end + + class MonthlyEstimatedRevenue < Stripe::StripeObject + # A non-negative integer representing how much to charge in the [smallest currency unit](/currencies#zero-decimal). + attr_reader :amount + # 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). + attr_reader :currency + end + + class SupportAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # The applicant's gross annual revenue for its preceding fiscal year. + attr_reader :annual_revenue + # An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + attr_reader :estimated_worker_count + # [The merchant category code for the account](/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + attr_reader :mcc + # Attribute for field monthly_estimated_revenue + attr_reader :monthly_estimated_revenue + # The customer-facing business name. + attr_reader :name + # Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. + attr_reader :product_description + # A publicly available mailing address for sending support issues to. + attr_reader :support_address + # A publicly available email address for sending support issues to. + attr_reader :support_email + # A publicly available phone number to call with support issues. + attr_reader :support_phone + # A publicly available website for handling support issues. + attr_reader :support_url + # The business's publicly available website. + attr_reader :url + end + + class Capabilities < Stripe::StripeObject + # The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. + attr_reader :acss_debit_payments + # The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. + attr_reader :affirm_payments + # The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. + attr_reader :afterpay_clearpay_payments + # The status of the Alma capability of the account, or whether the account can directly process Alma payments. + attr_reader :alma_payments + # The status of the AmazonPay capability of the account, or whether the account can directly process AmazonPay payments. + attr_reader :amazon_pay_payments + # The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. + attr_reader :au_becs_debit_payments + # The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. + attr_reader :bacs_debit_payments + # The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. + attr_reader :bancontact_payments + # The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. + attr_reader :bank_transfer_payments + # The status of the blik payments capability of the account, or whether the account can directly process blik charges. + attr_reader :blik_payments + # The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. + attr_reader :boleto_payments + # The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards + attr_reader :card_issuing + # The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. + attr_reader :card_payments + # The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. + attr_reader :cartes_bancaires_payments + # The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + attr_reader :cashapp_payments + # The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. + attr_reader :eps_payments + # The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. + attr_reader :fpx_payments + # The status of the GB customer_balance payments (GBP currency) capability of the account, or whether the account can directly process GB customer_balance charges. + attr_reader :gb_bank_transfer_payments + # The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. + attr_reader :giropay_payments + # The status of the Gopay capability of the account, or whether the account can directly process Gopay payments. + attr_reader :gopay_payments + # The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. + attr_reader :grabpay_payments + # The status of the Indonesia Bank Transfer payments capability of the account, or whether the account can directly process Indonesia Bank Transfer charges. + attr_reader :id_bank_transfer_payments + # The status of Bank BCA onboarding of the account. + attr_reader :id_bank_transfer_payments_bca + # The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. + attr_reader :ideal_payments + # The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. + attr_reader :india_international_payments + # The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. + attr_reader :jcb_payments + # The status of the Japanese customer_balance payments (JPY currency) capability of the account, or whether the account can directly process Japanese customer_balance charges. + attr_reader :jp_bank_transfer_payments + # The status of the KakaoPay capability of the account, or whether the account can directly process KakaoPay payments. + attr_reader :kakao_pay_payments + # The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. + attr_reader :klarna_payments + # The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. + attr_reader :konbini_payments + # The status of the KrCard capability of the account, or whether the account can directly process KrCard payments. + attr_reader :kr_card_payments + # The status of the legacy payments capability of the account. + attr_reader :legacy_payments + # The status of the link_payments capability of the account, or whether the account can directly process Link charges. + attr_reader :link_payments + # The status of the MB WAY payments capability of the account, or whether the account can directly process MB WAY charges. + attr_reader :mb_way_payments + # The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. + attr_reader :mobilepay_payments + # The status of the Multibanco payments capability of the account, or whether the account can directly process Multibanco charges. + attr_reader :multibanco_payments + # The status of the Mexican customer_balance payments (MXN currency) capability of the account, or whether the account can directly process Mexican customer_balance charges. + attr_reader :mx_bank_transfer_payments + # The status of the NaverPay capability of the account, or whether the account can directly process NaverPay payments. + attr_reader :naver_pay_payments + # The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. + attr_reader :oxxo_payments + # The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. + attr_reader :p24_payments + # The status of the Payco capability of the account, or whether the account can directly process Payco payments. + attr_reader :payco_payments + # The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. + attr_reader :paynow_payments + # The status of the PayPal payments capability of the account, or whether the account can directly process PayPal charges. + attr_reader :paypal_payments + # The status of the PayTo capability of the account, or whether the account can directly process PayTo charges. + attr_reader :payto_payments + # The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. + attr_reader :promptpay_payments + # The status of the Qris capability of the account, or whether the account can directly process Qris payments. + attr_reader :qris_payments + # The status of the Rechnung capability of the account, or whether the account can directly process Rechnung payments. + attr_reader :rechnung_payments + # The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. + attr_reader :revolut_pay_payments + # The status of the SamsungPay capability of the account, or whether the account can directly process SamsungPay payments. + attr_reader :samsung_pay_payments + # The status of the SEPA customer_balance payments (EUR currency) capability of the account, or whether the account can directly process SEPA customer_balance charges. + attr_reader :sepa_bank_transfer_payments + # The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. + attr_reader :sepa_debit_payments + # The status of the ShopeePay capability of the account, or whether the account can directly process ShopeePay payments. + attr_reader :shopeepay_payments + # The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. + attr_reader :sofort_payments + # The status of the Swish capability of the account, or whether the account can directly process Swish payments. + attr_reader :swish_payments + # The status of the tax reporting 1099-K (US) capability of the account. + attr_reader :tax_reporting_us_1099_k + # The status of the tax reporting 1099-MISC (US) capability of the account. + attr_reader :tax_reporting_us_1099_misc + # The status of the transfers capability of the account, or whether your platform can transfer funds to the account. + attr_reader :transfers + # The status of the banking capability, or whether the account can have bank accounts. + attr_reader :treasury + # The status of the treasury_evolve capability of the account. + attr_reader :treasury_evolve + # The status of the treasury_fifth_third capability of the account. + attr_reader :treasury_fifth_third + # The status of the treasury_goldman_sachs capability of the account. + attr_reader :treasury_goldman_sachs + # The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. + attr_reader :twint_payments + # The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. + attr_reader :us_bank_account_ach_payments + # The status of the US customer_balance payments (USD currency) capability of the account, or whether the account can directly process US customer_balance charges. + attr_reader :us_bank_transfer_payments + # The status of the Zip capability of the account, or whether the account can directly process Zip charges. + attr_reader :zip_payments + end + + class Company < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class AddressKana < Stripe::StripeObject + # City/Ward. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Block/Building number. + attr_reader :line1 + # Building details. + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # Prefecture. + attr_reader :state + # Town/cho-me. + attr_reader :town + end + + class AddressKanji < Stripe::StripeObject + # City/Ward. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Block/Building number. + attr_reader :line1 + # Building details. + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # Prefecture. + attr_reader :state + # Town/cho-me. + attr_reader :town + end + + class OwnershipDeclaration < Stripe::StripeObject + # The Unix timestamp marking when the beneficial owner attestation was made. + attr_reader :date + # The IP address from which the beneficial owner attestation was made. + attr_reader :ip + # The user-agent string from the browser where the beneficial owner attestation was made. + attr_reader :user_agent + end + + class Verification < Stripe::StripeObject + class Document < Stripe::StripeObject + # The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + attr_reader :back + # A user-displayable string describing the verification state of this document. + attr_reader :details + # One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document. + attr_reader :details_code + # The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + attr_reader :front + end + # Attribute for field document + attr_reader :document + end + # Attribute for field address + attr_reader :address + # The Kana variation of the company's primary address (Japan only). + attr_reader :address_kana + # The Kanji variation of the company's primary address (Japan only). + attr_reader :address_kanji + # Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). + attr_reader :directors_provided + # Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. + attr_reader :executives_provided + # The export license ID number of the company, also referred as Import Export Code (India only). + attr_reader :export_license_id + # The purpose code to use for export transactions (India only). + attr_reader :export_purpose_code + # The company's legal name. + attr_reader :name + # The Kana variation of the company's legal name (Japan only). + attr_reader :name_kana + # The Kanji variation of the company's legal name (Japan only). + attr_reader :name_kanji + # Whether the company's owners have been provided. This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). + attr_reader :owners_provided + # This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + attr_reader :ownership_declaration + # The company's phone number (used for verification). + attr_reader :phone + # The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + attr_reader :structure + # Whether the company's business ID number was provided. + attr_reader :tax_id_provided + # The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + attr_reader :tax_id_registrar + # Whether the company's business VAT number was provided. + attr_reader :vat_id_provided + # Information on the verification state of the company. + attr_reader :verification + end + + class Controller < Stripe::StripeObject + class Application < Stripe::StripeObject + # `true` if the Connect application is responsible for negative balances and should manage credit and fraud risk on the account. + attr_reader :loss_liable + # `true` if the Connect application is responsible for onboarding the account. + attr_reader :onboarding_owner + # `true` if the Connect application is responsible for paying Stripe fees on pricing-control eligible products. + attr_reader :pricing_controls + end + + class Dashboard < Stripe::StripeObject + # Whether this account has access to the full Stripe dashboard (`full`), to the Express dashboard (`express`), or to no dashboard (`none`). + attr_reader :type + end + + class Fees < Stripe::StripeObject + # A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). + attr_reader :payer + end + + class Losses < Stripe::StripeObject + # A value indicating who is liable when this account can't pay back negative balances from payments. + attr_reader :payments + end + + class StripeDashboard < Stripe::StripeObject + # A value indicating the Stripe dashboard this account has access to independent of the Connect application. + attr_reader :type + end + # Attribute for field application + attr_reader :application + # Attribute for field dashboard + attr_reader :dashboard + # Attribute for field fees + attr_reader :fees + # `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). Otherwise, this field is null. + attr_reader :is_controller + # Attribute for field losses + attr_reader :losses + # A value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account. + attr_reader :requirement_collection + # Attribute for field stripe_dashboard + attr_reader :stripe_dashboard + # The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. + attr_reader :type + end + + class FutureRequirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + attr_reader :original_fields_due + end + + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + attr_reader :alternatives + # Date on which `future_requirements` becomes the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. + attr_reader :current_deadline + # Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + attr_reader :currently_due + # This is typed as an enum for consistency with `requirements.disabled_reason`. + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + attr_reader :eventually_due + # Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + + class Groups < Stripe::StripeObject + # The group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://stripe.com/docs/connect/platform-pricing-tools) for details. + attr_reader :payments_pricing + end + + class Requirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + attr_reader :original_fields_due + end + + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + attr_reader :alternatives + # Date by which the fields in `currently_due` must be collected to keep the account enabled. These fields may disable the account sooner if the next threshold is reached before they are collected. + attr_reader :current_deadline + # Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + attr_reader :currently_due + # If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + attr_reader :eventually_due + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the account. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + + class RiskControls < Stripe::StripeObject + class Charges < Stripe::StripeObject + # Whether a pause of the risk control has been requested. + attr_reader :pause_requested + end + + class Payouts < Stripe::StripeObject + # Whether a pause of the risk control has been requested. + attr_reader :pause_requested + end + # Attribute for field charges + attr_reader :charges + # Attribute for field payouts + attr_reader :payouts + end + + class Settings < Stripe::StripeObject + class BacsDebitPayments < Stripe::StripeObject + # The Bacs Direct Debit display name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + attr_reader :display_name + # The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. + attr_reader :service_user_number + end + + class BankBcaOnboarding < Stripe::StripeObject + # Bank BCA business account holder name. + attr_reader :account_holder_name + # Bank BCA business account number. + attr_reader :business_account_number + end + + class Branding < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. + attr_reader :icon + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + attr_reader :logo + # A CSS hex color value representing the primary branding color for this account + attr_reader :primary_color + # A CSS hex color value representing the secondary branding color for this account + attr_reader :secondary_color + end + + class Capital < Stripe::StripeObject + # Per-currency mapping of user-selected destination accounts used to pay out loans. + attr_reader :payout_destination + # Per-currency mapping of all destination accounts eligible to receive loan payouts. + attr_reader :payout_destination_selector + end + + class CardIssuing < Stripe::StripeObject + class TosAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the account representative accepted the service agreement. + attr_reader :date + # The IP address from which the account representative accepted the service agreement. + attr_reader :ip + # The user agent of the browser from which the account representative accepted the service agreement. + attr_reader :user_agent + end + # Attribute for field tos_acceptance + attr_reader :tos_acceptance + end + + class CardPayments < Stripe::StripeObject + class DeclineOn < Stripe::StripeObject + # Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + attr_reader :avs_failure + # Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + attr_reader :cvc_failure + end + # Attribute for field decline_on + attr_reader :decline_on + # The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + attr_reader :statement_descriptor_prefix + # The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + attr_reader :statement_descriptor_prefix_kana + # The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + attr_reader :statement_descriptor_prefix_kanji + end + + class Dashboard < Stripe::StripeObject + # The display name for this account. This is used on the Stripe Dashboard to differentiate between accounts. + attr_reader :display_name + # The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + attr_reader :timezone + end + + class Invoices < Stripe::StripeObject + # The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. + attr_reader :default_account_tax_ids + end + + class Payments < Stripe::StripeObject + # The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + attr_reader :statement_descriptor + # The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + attr_reader :statement_descriptor_kana + # The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + attr_reader :statement_descriptor_kanji + # The Kana variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + attr_reader :statement_descriptor_prefix_kana + # The Kanji variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + attr_reader :statement_descriptor_prefix_kanji + end + + class Payouts < Stripe::StripeObject + class Schedule < Stripe::StripeObject + # The number of days charges for the account will be held before being paid out. + attr_reader :delay_days + # How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. + attr_reader :interval + # The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + attr_reader :monthly_anchor + # The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. + attr_reader :weekly_anchor + end + # A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. + attr_reader :debit_negative_balances + # Attribute for field schedule + attr_reader :schedule + # The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + attr_reader :statement_descriptor + end + + class SepaDebitPayments < Stripe::StripeObject + # SEPA creditor identifier that identifies the company making the payment. + attr_reader :creditor_id + end + + class TaxForms < Stripe::StripeObject + # Whether the account opted out of receiving their tax forms by postal delivery. + attr_reader :consented_to_paperless_delivery + end + + class Treasury < Stripe::StripeObject + class TosAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the account representative accepted the service agreement. + attr_reader :date + # The IP address from which the account representative accepted the service agreement. + attr_reader :ip + # The user agent of the browser from which the account representative accepted the service agreement. + attr_reader :user_agent + end + # Attribute for field tos_acceptance + attr_reader :tos_acceptance + end + # Attribute for field bacs_debit_payments + attr_reader :bacs_debit_payments + # Attribute for field bank_bca_onboarding + attr_reader :bank_bca_onboarding + # Attribute for field branding + attr_reader :branding + # Attribute for field capital + attr_reader :capital + # Attribute for field card_issuing + attr_reader :card_issuing + # Attribute for field card_payments + attr_reader :card_payments + # Attribute for field dashboard + attr_reader :dashboard + # Attribute for field invoices + attr_reader :invoices + # Attribute for field payments + attr_reader :payments + # Attribute for field payouts + attr_reader :payouts + # Attribute for field sepa_debit_payments + attr_reader :sepa_debit_payments + # Attribute for field tax_forms + attr_reader :tax_forms + # Attribute for field treasury + attr_reader :treasury + end + + class TosAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the account representative accepted their service agreement + attr_reader :date + # The IP address from which the account representative accepted their service agreement + attr_reader :ip + # The user's service agreement type + attr_reader :service_agreement + # The user agent of the browser from which the account representative accepted their service agreement + attr_reader :user_agent + end + # Business information about the account. + attr_reader :business_profile + + # The business type. After you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + attr_reader :business_type + + # Attribute for field capabilities + attr_reader :capabilities + + # Whether the account can process charges. + attr_reader :charges_enabled + + # Attribute for field company + attr_reader :company + + # Attribute for field controller + attr_reader :controller + + # The account's country. + attr_reader :country + + # Time at which the account was connected. Measured in seconds since the Unix epoch. + attr_reader :created + + # Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + attr_reader :default_currency + + # Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](/connect/onboarding) to finish submitting account details. + attr_reader :details_submitted + + # An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. + attr_reader :email + + # External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true. + attr_reader :external_accounts + + # Attribute for field future_requirements + attr_reader :future_requirements + + # The groups associated with the account. + attr_reader :groups + + # Unique identifier for the object. + attr_reader :id + + # This is an object representing a person associated with a Stripe account. + # + # A platform cannot access a person for an account where [account.controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. + # + # See the [Standard onboarding](/connect/standard-accounts) or [Express onboarding](/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](/connect/handling-api-verification#person-information). + attr_reader :individual + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Whether the funds in this account can be paid out. + attr_reader :payouts_enabled + + # Attribute for field requirements + attr_reader :requirements + + # Attribute for field risk_controls + attr_reader :risk_controls + + # Options for customizing how the account functions within Stripe. + attr_reader :settings + + # Attribute for field tos_acceptance + attr_reader :tos_acceptance + + # The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. + attr_reader :type + + # Always true for a deleted object + attr_reader :deleted + # With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. # To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). # diff --git a/lib/stripe/resources/account_link.rb b/lib/stripe/resources/account_link.rb index 49a1bffd5..368d81591 100644 --- a/lib/stripe/resources/account_link.rb +++ b/lib/stripe/resources/account_link.rb @@ -14,6 +14,18 @@ def self.object_name "account_link" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The timestamp at which this account link will expire. + attr_reader :expires_at + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The URL for the account link. + attr_reader :url + # Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/account_links", params: params, opts: opts) diff --git a/lib/stripe/resources/account_notice.rb b/lib/stripe/resources/account_notice.rb index 5e157e101..82dfcb57e 100644 --- a/lib/stripe/resources/account_notice.rb +++ b/lib/stripe/resources/account_notice.rb @@ -14,6 +14,53 @@ def self.object_name "account_notice" end + class Email < Stripe::StripeObject + # Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use. + attr_reader :plain_text + # Email address of the recipient. + attr_reader :recipient + # Subject of the email. + attr_reader :subject + end + + class LinkedObjects < Stripe::StripeObject + # Associated [Capability](https://stripe.com/docs/api/capabilities) + attr_reader :capability + # Associated [Credit Underwriting Record](https://stripe.com/docs/api/issuing/credit_underwriting_record) + attr_reader :issuing_credit_underwriting_record + # Associated [Issuing Dispute](https://stripe.com/docs/api/issuing/disputes) + attr_reader :issuing_dispute + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # When present, the deadline for sending the notice to meet the relevant regulations. + attr_reader :deadline + + # Information about the email when sent. + attr_reader :email + + # Unique identifier for the object. + attr_reader :id + + # Information about objects related to the notice. + attr_reader :linked_objects + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Reason the notice is being sent. The reason determines what copy the notice must contain. See the [regulated customer notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) guide. All reasons might not apply to your integration, and Stripe might add new reasons in the future, so we recommend an internal warning when you receive an unknown reason. + attr_reader :reason + + # Date when the notice was sent. When absent, you must send the notice, update the content of the email and date when it was sent. + attr_reader :sent_at + # Retrieves a list of AccountNotice objects. The objects are sorted in descending order by creation date, with the most-recently-created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/account_notices", params: filters, opts: opts) diff --git a/lib/stripe/resources/account_session.rb b/lib/stripe/resources/account_session.rb index 847edd7d2..704770da3 100644 --- a/lib/stripe/resources/account_session.rb +++ b/lib/stripe/resources/account_session.rb @@ -17,6 +17,224 @@ def self.object_name "account_session" end + class Components < Stripe::StripeObject + class AccountManagement < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + attr_reader :disable_stripe_user_authentication + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + attr_reader :external_account_collection + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class AccountOnboarding < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + attr_reader :disable_stripe_user_authentication + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + attr_reader :external_account_collection + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class Balances < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + attr_reader :disable_stripe_user_authentication + # Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + attr_reader :edit_payout_schedule + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + attr_reader :external_account_collection + # Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + attr_reader :instant_payouts + # Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + attr_reader :standard_payouts + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class CapitalFinancing < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class CapitalFinancingApplication < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class CapitalFinancingPromotion < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class Documents < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class NotificationBanner < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + attr_reader :disable_stripe_user_authentication + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + attr_reader :external_account_collection + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class PaymentDetails < Stripe::StripeObject + class Features < Stripe::StripeObject + # Whether to allow capturing and cancelling payment intents. This is `true` by default. + attr_reader :capture_payments + # Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + attr_reader :destination_on_behalf_of_charge_management + # Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + attr_reader :dispute_management + # Whether to allow sending refunds. This is `true` by default. + attr_reader :refund_management + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class Payments < Stripe::StripeObject + class Features < Stripe::StripeObject + # Whether to allow capturing and cancelling payment intents. This is `true` by default. + attr_reader :capture_payments + # Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + attr_reader :destination_on_behalf_of_charge_management + # Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + attr_reader :dispute_management + # Whether to allow sending refunds. This is `true` by default. + attr_reader :refund_management + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class Payouts < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + attr_reader :disable_stripe_user_authentication + # Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + attr_reader :edit_payout_schedule + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + attr_reader :external_account_collection + # Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + attr_reader :instant_payouts + # Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + attr_reader :standard_payouts + end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class PayoutsList < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class TaxRegistrations < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + + class TaxSettings < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + attr_reader :enabled + # Attribute for field features + attr_reader :features + end + # Attribute for field account_management + attr_reader :account_management + # Attribute for field account_onboarding + attr_reader :account_onboarding + # Attribute for field balances + attr_reader :balances + # Attribute for field capital_financing + attr_reader :capital_financing + # Attribute for field capital_financing_application + attr_reader :capital_financing_application + # Attribute for field capital_financing_promotion + attr_reader :capital_financing_promotion + # Attribute for field documents + attr_reader :documents + # Attribute for field notification_banner + attr_reader :notification_banner + # Attribute for field payment_details + attr_reader :payment_details + # Attribute for field payments + attr_reader :payments + # Attribute for field payouts + attr_reader :payouts + # Attribute for field payouts_list + attr_reader :payouts_list + # Attribute for field tax_registrations + attr_reader :tax_registrations + # Attribute for field tax_settings + attr_reader :tax_settings + end + # The ID of the account the AccountSession was created for + attr_reader :account + + # The client secret of this AccountSession. Used on the client to set up secure access to the given `account`. + # + # The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret. + # + # Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. + attr_reader :client_secret + + # Attribute for field components + attr_reader :components + + # The timestamp at which this AccountSession will expire. + attr_reader :expires_at + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + # Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/account_sessions", params: params, opts: opts) diff --git a/lib/stripe/resources/apple_pay_domain.rb b/lib/stripe/resources/apple_pay_domain.rb index 2ac3d9389..9591dd34d 100644 --- a/lib/stripe/resources/apple_pay_domain.rb +++ b/lib/stripe/resources/apple_pay_domain.rb @@ -13,6 +13,24 @@ def self.object_name "apple_pay_domain" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Attribute for field domain_name + attr_reader :domain_name + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Always true for a deleted object + attr_reader :deleted + # Create an apple pay domain. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/application.rb b/lib/stripe/resources/application.rb new file mode 100644 index 000000000..22c9d820c --- /dev/null +++ b/lib/stripe/resources/application.rb @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class Application < APIResource + OBJECT_NAME = "application" + def self.object_name + "application" + end + + # Unique identifier for the object. + attr_reader :id + + # The name of the application. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Always true for a deleted object + attr_reader :deleted + end +end diff --git a/lib/stripe/resources/application_fee.rb b/lib/stripe/resources/application_fee.rb index ed31b569a..b7f89da17 100644 --- a/lib/stripe/resources/application_fee.rb +++ b/lib/stripe/resources/application_fee.rb @@ -13,6 +13,59 @@ def self.object_name nested_resource_class_methods :refund, operations: %i[create retrieve update list] + class FeeSource < Stripe::StripeObject + # Charge ID that created this application fee. + attr_reader :charge + # Payout ID that created this application fee. + attr_reader :payout + # Type of object that created the application fee, either `charge` or `payout`. + attr_reader :type + end + # ID of the Stripe account this fee was taken from. + attr_reader :account + + # Amount earned, in cents (or local equivalent). + attr_reader :amount + + # Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued) + attr_reader :amount_refunded + + # ID of the Connect application that earned the fee. + attr_reader :application + + # Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). + attr_reader :balance_transaction + + # ID of the charge that the application fee was taken from. + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. + attr_reader :fee_source + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. + attr_reader :originating_transaction + + # Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. + attr_reader :refunded + + # A list of refunds that have been applied to the fee. + attr_reader :refunds + # Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/application_fees", params: filters, opts: opts) diff --git a/lib/stripe/resources/application_fee_refund.rb b/lib/stripe/resources/application_fee_refund.rb index 45dba49f3..ef38db767 100644 --- a/lib/stripe/resources/application_fee_refund.rb +++ b/lib/stripe/resources/application_fee_refund.rb @@ -15,6 +15,30 @@ def self.object_name "fee_refund" end + # Amount, in cents (or local equivalent). + attr_reader :amount + + # Balance transaction that describes the impact on your account balance. + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # ID of the application fee that was refunded. + attr_reader :fee + + # Unique identifier for the object. + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + def resource_url "#{ApplicationFee.resource_url}/#{CGI.escape(fee)}/refunds" \ "/#{CGI.escape(id)}" diff --git a/lib/stripe/resources/apps/secret.rb b/lib/stripe/resources/apps/secret.rb index c670aa707..d6feca9a7 100644 --- a/lib/stripe/resources/apps/secret.rb +++ b/lib/stripe/resources/apps/secret.rb @@ -21,6 +21,39 @@ def self.object_name "apps.secret" end + class Scope < Stripe::StripeObject + # The secret scope type. + attr_reader :type + # The user ID, if type is set to "user" + attr_reader :user + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # If true, indicates that this secret has been deleted + attr_reader :deleted + + # The Unix timestamp for the expiry time of the secret, after which the secret deletes. + attr_reader :expires_at + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # A name for the secret that's unique within the scope. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The plaintext secret value to be stored. + attr_reader :payload + + # Attribute for field scope + attr_reader :scope + # Create or replace a secret in the secret store. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/apps/secrets", params: params, opts: opts) diff --git a/lib/stripe/resources/balance.rb b/lib/stripe/resources/balance.rb index 141c41909..db95d9cad 100644 --- a/lib/stripe/resources/balance.rb +++ b/lib/stripe/resources/balance.rb @@ -18,5 +18,133 @@ class Balance < SingletonAPIResource def self.object_name "balance" end + + class Available < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + attr_reader :bank_account + # Amount for card. + attr_reader :card + # Amount for FPX. + attr_reader :fpx + end + # Balance amount. + attr_reader :amount + # 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). + attr_reader :currency + # Attribute for field source_types + attr_reader :source_types + end + + class ConnectReserved < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + attr_reader :bank_account + # Amount for card. + attr_reader :card + # Amount for FPX. + attr_reader :fpx + end + # Balance amount. + attr_reader :amount + # 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). + attr_reader :currency + # Attribute for field source_types + attr_reader :source_types + end + + class InstantAvailable < Stripe::StripeObject + class NetAvailable < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + attr_reader :bank_account + # Amount for card. + attr_reader :card + # Amount for FPX. + attr_reader :fpx + end + # Net balance amount, subtracting fees from platform-set pricing. + attr_reader :amount + # ID of the external account for this net balance (not expandable). + attr_reader :destination + # Attribute for field source_types + attr_reader :source_types + end + + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + attr_reader :bank_account + # Amount for card. + attr_reader :card + # Amount for FPX. + attr_reader :fpx + end + # Balance amount. + attr_reader :amount + # 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). + attr_reader :currency + # Breakdown of balance by destination. + attr_reader :net_available + # Attribute for field source_types + attr_reader :source_types + end + + class Issuing < Stripe::StripeObject + class Available < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + attr_reader :bank_account + # Amount for card. + attr_reader :card + # Amount for FPX. + attr_reader :fpx + end + # Balance amount. + attr_reader :amount + # 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). + attr_reader :currency + # Attribute for field source_types + attr_reader :source_types + end + # Funds that are available for use. + attr_reader :available + end + + class Pending < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + attr_reader :bank_account + # Amount for card. + attr_reader :card + # Amount for FPX. + attr_reader :fpx + end + # Balance amount. + attr_reader :amount + # 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). + attr_reader :currency + # Attribute for field source_types + attr_reader :source_types + end + # Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. + attr_reader :available + + # Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. + attr_reader :connect_reserved + + # Funds that you can pay out using Instant Payouts. + attr_reader :instant_available + + # Attribute for field issuing + attr_reader :issuing + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property. + attr_reader :pending end end diff --git a/lib/stripe/resources/balance_transaction.rb b/lib/stripe/resources/balance_transaction.rb index 298355256..f621a5694 100644 --- a/lib/stripe/resources/balance_transaction.rb +++ b/lib/stripe/resources/balance_transaction.rb @@ -14,6 +14,63 @@ def self.object_name "balance_transaction" end + class FeeDetail < Stripe::StripeObject + # Amount of the fee, in cents. + attr_reader :amount + # ID of the Connect application that earned the fee. + attr_reader :application + # 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). + attr_reader :currency + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + # Type of the fee, one of: `application_fee`, `payment_method_passthrough_fee`, `stripe_fee` or `tax`. + attr_reader :type + end + # Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party. + attr_reader :amount + + # The date that the transaction's net funds become available in the Stripe balance. + attr_reader :available_on + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. + attr_reader :exchange_rate + + # Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. + attr_reader :fee + + # Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. + attr_reader :fee_details + + # Unique identifier for the object. + attr_reader :id + + # Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by `amount` - `fee` + attr_reader :net + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + attr_reader :reporting_category + + # This transaction relates to the Stripe object. + attr_reader :source + + # The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. + attr_reader :status + + # Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + attr_reader :type + # Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. # # Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. diff --git a/lib/stripe/resources/bank_account.rb b/lib/stripe/resources/bank_account.rb index 5f4c17a25..babead1f1 100644 --- a/lib/stripe/resources/bank_account.rb +++ b/lib/stripe/resources/bank_account.rb @@ -19,6 +19,105 @@ def self.object_name "bank_account" end + class FutureRequirements < Stripe::StripeObject + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + + class Requirements < Stripe::StripeObject + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + # The ID of the account that the bank account is associated with. + attr_reader :account + + # The name of the person or business that owns the bank account. + attr_reader :account_holder_name + + # The type of entity that holds the account. This can be either `individual` or `company`. + attr_reader :account_holder_type + + # The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. + attr_reader :account_type + + # A set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout. + attr_reader :available_payout_methods + + # Name of the bank associated with the routing number (e.g., `WELLS FARGO`). + attr_reader :bank_name + + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + + # Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + attr_reader :currency + + # The ID of the customer that the bank account is associated with. + attr_reader :customer + + # Whether this bank account is the default external account for its currency. + attr_reader :default_for_currency + + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + + # Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + attr_reader :future_requirements + + # Unique identifier for the object. + attr_reader :id + + # The last four digits of the bank account number. + attr_reader :last4 + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Information about the requirements for the bank account, including what information needs to be collected. + attr_reader :requirements + + # The routing transit number for the bank account. + attr_reader :routing_number + + # For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. + # + # For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. + attr_reader :status + + # Always true for a deleted object + attr_reader :deleted + def verify(params = {}, opts = {}) request_stripe_object( method: :post, @@ -38,10 +137,12 @@ def self.verify(customer, id, params = {}, opts = {}) end def resource_url - if respond_to?(:customer) + if !customer.nil? "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}" - elsif respond_to?(:account) + elsif !account.nil? "#{Account.resource_url}/#{CGI.escape(account)}/external_accounts/#{CGI.escape(id)}" + else + raise InvalidRequestError, "Could not determine which URL to request: [account, customer] fields are all null" end end diff --git a/lib/stripe/resources/billing/alert.rb b/lib/stripe/resources/billing/alert.rb index 90451eb8e..80e07a356 100644 --- a/lib/stripe/resources/billing/alert.rb +++ b/lib/stripe/resources/billing/alert.rb @@ -13,6 +13,43 @@ def self.object_name "billing.alert" end + class UsageThreshold < Stripe::StripeObject + class Filter < Stripe::StripeObject + # Limit the scope of the alert to this customer ID + attr_reader :customer + # Attribute for field type + attr_reader :type + end + # The filters allow limiting the scope of this usage alert. You can only specify up to one filter at this time. + attr_reader :filters + # The value at which this alert will trigger. + attr_reader :gte + # The [Billing Meter](/api/billing/meter) ID whose usage is monitored. + attr_reader :meter + # Defines how the alert will behave. + attr_reader :recurrence + end + # Defines the type of the alert. + attr_reader :alert_type + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Status of the alert. This can be active, inactive or archived. + attr_reader :status + + # Title of the alert. + attr_reader :title + + # Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter). + attr_reader :usage_threshold + # Reactivates this alert, allowing it to trigger again. def activate(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/billing/alert_triggered.rb b/lib/stripe/resources/billing/alert_triggered.rb new file mode 100644 index 000000000..dae67e1b0 --- /dev/null +++ b/lib/stripe/resources/billing/alert_triggered.rb @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Billing + class AlertTriggered < APIResource + OBJECT_NAME = "billing.alert_triggered" + def self.object_name + "billing.alert_triggered" + end + + # A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. + attr_reader :alert + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # ID of customer for which the alert triggered + attr_reader :customer + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The value triggering the alert + attr_reader :value + end + end +end diff --git a/lib/stripe/resources/billing/credit_balance_summary.rb b/lib/stripe/resources/billing/credit_balance_summary.rb index 928967a07..ce61e18ca 100644 --- a/lib/stripe/resources/billing/credit_balance_summary.rb +++ b/lib/stripe/resources/billing/credit_balance_summary.rb @@ -9,6 +9,49 @@ class CreditBalanceSummary < SingletonAPIResource def self.object_name "billing.credit_balance_summary" end + + class Balance < Stripe::StripeObject + class AvailableBalance < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount. + attr_reader :value + end + # The monetary amount. + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + attr_reader :type + end + + class LedgerBalance < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount. + attr_reader :value + end + # The monetary amount. + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + attr_reader :type + end + # Attribute for field available_balance + attr_reader :available_balance + # Attribute for field ledger_balance + attr_reader :ledger_balance + end + # The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. + attr_reader :balances + + # The customer the balance is for. + attr_reader :customer + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object end end end diff --git a/lib/stripe/resources/billing/credit_balance_transaction.rb b/lib/stripe/resources/billing/credit_balance_transaction.rb index 113cb9861..840f67067 100644 --- a/lib/stripe/resources/billing/credit_balance_transaction.rb +++ b/lib/stripe/resources/billing/credit_balance_transaction.rb @@ -12,6 +12,82 @@ def self.object_name "billing.credit_balance_transaction" end + class Credit < Stripe::StripeObject + class Amount < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount. + attr_reader :value + end + # The monetary amount. + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + attr_reader :type + end + # Attribute for field amount + attr_reader :amount + # The type of credit transaction. + attr_reader :type + end + + class Debit < Stripe::StripeObject + class Amount < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount. + attr_reader :value + end + # The monetary amount. + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + attr_reader :type + end + + class CreditsApplied < Stripe::StripeObject + # The invoice to which the billing credits were applied. + attr_reader :invoice + # The invoice line item to which the billing credits were applied. + attr_reader :invoice_line_item + end + # Attribute for field amount + attr_reader :amount + # Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`. + attr_reader :credits_applied + # The type of debit transaction. + attr_reader :type + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Credit details for this credit balance transaction. Only present if type is `credit`. + attr_reader :credit + + # The credit grant associated with this credit balance transaction. + attr_reader :credit_grant + + # Debit details for this credit balance transaction. Only present if type is `debit`. + attr_reader :debit + + # The effective time of this credit balance transaction. + attr_reader :effective_at + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the test clock this credit balance transaction belongs to. + attr_reader :test_clock + + # The type of credit balance transaction (credit or debit). + attr_reader :type + # Retrieve a list of credit balance transactions def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/billing/credit_grant.rb b/lib/stripe/resources/billing/credit_grant.rb index 43839816a..96e6fb2dc 100644 --- a/lib/stripe/resources/billing/credit_grant.rb +++ b/lib/stripe/resources/billing/credit_grant.rb @@ -16,6 +16,72 @@ def self.object_name "billing.credit_grant" end + class Amount < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount. + attr_reader :value + end + # The monetary amount. + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + attr_reader :type + end + + class ApplicabilityConfig < Stripe::StripeObject + class Scope < Stripe::StripeObject + # The price type for which credit grants can apply. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + attr_reader :price_type + end + # Attribute for field scope + attr_reader :scope + end + # Attribute for field amount + attr_reader :amount + + # Attribute for field applicability_config + attr_reader :applicability_config + + # The category of this credit grant. This is for tracking purposes and isn't displayed to the customer. + attr_reader :category + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # ID of the customer receiving the billing credits. + attr_reader :customer + + # The time when the billing credits become effective—when they're eligible for use. + attr_reader :effective_at + + # The time when the billing credits expire. If not present, the billing credits don't expire. + attr_reader :expires_at + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # A descriptive name shown in dashboard. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the test clock this credit grant belongs to. + attr_reader :test_clock + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + attr_reader :updated + + # The time when this credit grant was voided. If not present, the credit grant hasn't been voided. + attr_reader :voided_at + # Creates a credit grant def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/billing/meter.rb b/lib/stripe/resources/billing/meter.rb index 6ef7ad9ec..467dae72d 100644 --- a/lib/stripe/resources/billing/meter.rb +++ b/lib/stripe/resources/billing/meter.rb @@ -21,6 +21,66 @@ def self.object_name operations: %i[list], resource_plural: "event_summaries" + class CustomerMapping < Stripe::StripeObject + # The key in the meter event payload to use for mapping the event to a customer. + attr_reader :event_payload_key + # The method for mapping a meter event to a customer. + attr_reader :type + end + + class DefaultAggregation < Stripe::StripeObject + # Specifies how events are aggregated. + attr_reader :formula + end + + class StatusTransitions < Stripe::StripeObject + # The time the meter was deactivated, if any. Measured in seconds since Unix epoch. + attr_reader :deactivated_at + end + + class ValueSettings < Stripe::StripeObject + # The key in the meter event payload to use as the value for this meter. + attr_reader :event_payload_key + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Attribute for field customer_mapping + attr_reader :customer_mapping + + # Attribute for field default_aggregation + attr_reader :default_aggregation + + # The meter's name. + attr_reader :display_name + + # The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. + attr_reader :event_name + + # The time window to pre-aggregate meter events for, if any. + attr_reader :event_time_window + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The meter's status. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + attr_reader :updated + + # Attribute for field value_settings + attr_reader :value_settings + # Creates a billing meter def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/billing/meters", params: params, opts: opts) diff --git a/lib/stripe/resources/billing/meter_error_report.rb b/lib/stripe/resources/billing/meter_error_report.rb new file mode 100644 index 000000000..90b42650b --- /dev/null +++ b/lib/stripe/resources/billing/meter_error_report.rb @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Billing + class MeterErrorReport < APIResource + OBJECT_NAME = "billing.meter_error_report" + def self.object_name + "billing.meter_error_report" + end + + class Reason < Stripe::StripeObject + class ErrorType < Stripe::StripeObject + class SampleError < Stripe::StripeObject + class ApiRequest < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + # idempotency_key of the request + attr_reader :idempotency_key + end + # Attribute for field api_request + attr_reader :api_request + # message of the error + attr_reader :error_message + end + # Attribute for field sample_errors + attr_reader :sample_errors + end + # The number of errors generated + attr_reader :error_count + # More information about errors + attr_reader :error_types + end + + class RelatedObject < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + # The type of meter error related object. Should be 'meter' + attr_reader :object + # The url of the meter object + attr_reader :url + end + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field reason + attr_reader :reason + + # The related objects about the error + attr_reader :related_object + + # Summary of invalid events + attr_reader :summary + + # Time when validation ended. Measured in seconds since the Unix epoch + attr_reader :validation_end + + # Time when validation started. Measured in seconds since the Unix epoch + attr_reader :validation_start + end + end +end diff --git a/lib/stripe/resources/billing/meter_event.rb b/lib/stripe/resources/billing/meter_event.rb index 53190ce8a..eb102b29e 100644 --- a/lib/stripe/resources/billing/meter_event.rb +++ b/lib/stripe/resources/billing/meter_event.rb @@ -13,6 +13,27 @@ def self.object_name "billing.meter_event" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + attr_reader :event_name + + # A unique identifier for the event. + attr_reader :identifier + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). + attr_reader :payload + + # The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. + attr_reader :timestamp + # Creates a billing meter event def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/billing/meter_event_adjustment.rb b/lib/stripe/resources/billing/meter_event_adjustment.rb index 8cd345852..27675170a 100644 --- a/lib/stripe/resources/billing/meter_event_adjustment.rb +++ b/lib/stripe/resources/billing/meter_event_adjustment.rb @@ -12,6 +12,28 @@ def self.object_name "billing.meter_event_adjustment" end + class Cancel < Stripe::StripeObject + # Unique identifier for the event. + attr_reader :identifier + end + # Specifies which event to cancel. + attr_reader :cancel + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + attr_reader :event_name + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The meter event adjustment's status. + attr_reader :status + + # Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + attr_reader :type + # Creates a billing meter event adjustment def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/billing/meter_event_summary.rb b/lib/stripe/resources/billing/meter_event_summary.rb index 0fb71afd5..4e3c6cc0a 100644 --- a/lib/stripe/resources/billing/meter_event_summary.rb +++ b/lib/stripe/resources/billing/meter_event_summary.rb @@ -10,6 +10,27 @@ class MeterEventSummary < APIResource def self.object_name "billing.meter_event_summary" end + + # Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. + attr_reader :aggregated_value + + # End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. + attr_reader :end_time + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The meter associated with this event summary. + attr_reader :meter + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries. + attr_reader :start_time end end end diff --git a/lib/stripe/resources/billing_portal/configuration.rb b/lib/stripe/resources/billing_portal/configuration.rb index 0375ab996..75234340d 100644 --- a/lib/stripe/resources/billing_portal/configuration.rb +++ b/lib/stripe/resources/billing_portal/configuration.rb @@ -14,6 +14,136 @@ def self.object_name "billing_portal.configuration" end + class BusinessProfile < Stripe::StripeObject + # The messaging shown to customers in the portal. + attr_reader :headline + # A link to the business’s publicly available privacy policy. + attr_reader :privacy_policy_url + # A link to the business’s publicly available terms of service. + attr_reader :terms_of_service_url + end + + class Features < Stripe::StripeObject + class CustomerUpdate < Stripe::StripeObject + # The types of customer updates that are supported. When empty, customers are not updateable. + attr_reader :allowed_updates + # Whether the feature is enabled. + attr_reader :enabled + end + + class InvoiceHistory < Stripe::StripeObject + # Whether the feature is enabled. + attr_reader :enabled + end + + class PaymentMethodUpdate < Stripe::StripeObject + # Whether the feature is enabled. + attr_reader :enabled + end + + class SubscriptionCancel < Stripe::StripeObject + class CancellationReason < Stripe::StripeObject + # Whether the feature is enabled. + attr_reader :enabled + # Which cancellation reasons will be given as options to the customer. + attr_reader :options + end + # Attribute for field cancellation_reason + attr_reader :cancellation_reason + # Whether the feature is enabled. + attr_reader :enabled + # Whether to cancel subscriptions immediately or at the end of the billing period. + attr_reader :mode + # Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`. + attr_reader :proration_behavior + end + + class SubscriptionUpdate < Stripe::StripeObject + class Product < Stripe::StripeObject + # The list of price IDs which, when subscribed to, a subscription can be updated. + attr_reader :prices + # The product ID. + attr_reader :product + end + + class ScheduleAtPeriodEnd < Stripe::StripeObject + class Condition < Stripe::StripeObject + # The type of condition. + attr_reader :type + end + # List of conditions. When any condition is true, an update will be scheduled at the end of the current period. + attr_reader :conditions + end + # The types of subscription updates that are supported for items listed in the `products` attribute. When empty, subscriptions are not updateable. + attr_reader :default_allowed_updates + # Whether the feature is enabled. + attr_reader :enabled + # The list of up to 10 products that support subscription updates. + attr_reader :products + # Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. + attr_reader :proration_behavior + # Attribute for field schedule_at_period_end + attr_reader :schedule_at_period_end + end + # Attribute for field customer_update + attr_reader :customer_update + # Attribute for field invoice_history + attr_reader :invoice_history + # Attribute for field payment_method_update + attr_reader :payment_method_update + # Attribute for field subscription_cancel + attr_reader :subscription_cancel + # Attribute for field subscription_update + attr_reader :subscription_update + end + + class LoginPage < Stripe::StripeObject + # If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. + # + # If `false`, the previously generated `url`, if any, will be deactivated. + attr_reader :enabled + # A shareable URL to the hosted portal login page. Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. + attr_reader :url + end + # Whether the configuration is active and can be used to create portal sessions. + attr_reader :active + + # ID of the Connect Application that created the configuration. + attr_reader :application + + # Attribute for field business_profile + attr_reader :business_profile + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + attr_reader :default_return_url + + # Attribute for field features + attr_reader :features + + # Unique identifier for the object. + attr_reader :id + + # Whether the configuration is the default. If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + attr_reader :is_default + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Attribute for field login_page + attr_reader :login_page + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + attr_reader :updated + # Creates a configuration that describes the functionality and behavior of a PortalSession def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/billing_portal/session.rb b/lib/stripe/resources/billing_portal/session.rb index ec681a385..eedb26d3c 100644 --- a/lib/stripe/resources/billing_portal/session.rb +++ b/lib/stripe/resources/billing_portal/session.rb @@ -25,6 +25,114 @@ def self.object_name "billing_portal.session" end + class Flow < Stripe::StripeObject + class AfterCompletion < Stripe::StripeObject + class HostedConfirmation < Stripe::StripeObject + # A custom message to display to the customer after the flow is completed. + attr_reader :custom_message + end + + class Redirect < Stripe::StripeObject + # The URL the customer will be redirected to after the flow is completed. + attr_reader :return_url + end + # Configuration when `after_completion.type=hosted_confirmation`. + attr_reader :hosted_confirmation + # Configuration when `after_completion.type=redirect`. + attr_reader :redirect + # The specified type of behavior after the flow is completed. + attr_reader :type + end + + class SubscriptionCancel < Stripe::StripeObject + class Retention < Stripe::StripeObject + class CouponOffer < Stripe::StripeObject + # The ID of the coupon to be offered. + attr_reader :coupon + end + # Configuration when `retention.type=coupon_offer`. + attr_reader :coupon_offer + # Type of retention strategy that will be used. + attr_reader :type + end + # Specify a retention strategy to be used in the cancellation flow. + attr_reader :retention + # The ID of the subscription to be canceled. + attr_reader :subscription + end + + class SubscriptionUpdate < Stripe::StripeObject + # The ID of the subscription to be updated. + attr_reader :subscription + end + + class SubscriptionUpdateConfirm < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The ID of the coupon to apply to this subscription update. + attr_reader :coupon + # The ID of a promotion code to apply to this subscription update. + attr_reader :promotion_code + end + + class Item < Stripe::StripeObject + # The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. + attr_reader :id + # The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). + attr_reader :price + # [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. + attr_reader :quantity + end + # The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + attr_reader :discounts + # The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. Currently, only up to one may be specified and subscriptions with multiple items are not updatable. + attr_reader :items + # The ID of the subscription to be updated. + attr_reader :subscription + end + # Attribute for field after_completion + attr_reader :after_completion + # Configuration when `flow.type=subscription_cancel`. + attr_reader :subscription_cancel + # Configuration when `flow.type=subscription_update`. + attr_reader :subscription_update + # Configuration when `flow.type=subscription_update_confirm`. + attr_reader :subscription_update_confirm + # Type of flow that the customer will go through. + attr_reader :type + end + # The configuration used by this session, describing the features available. + attr_reader :configuration + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The ID of the customer for this session. + attr_reader :customer + + # Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. + attr_reader :flow + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + attr_reader :locale + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + attr_reader :on_behalf_of + + # The URL to redirect customers to when they click on the portal's link to return to your website. + attr_reader :return_url + + # The short-lived URL of the session that gives customers access to the customer portal. + attr_reader :url + # Creates a session of the customer portal. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/capability.rb b/lib/stripe/resources/capability.rb index 9f0cdad4b..d5bab2b96 100644 --- a/lib/stripe/resources/capability.rb +++ b/lib/stripe/resources/capability.rb @@ -13,6 +13,97 @@ def self.object_name "capability" end + class FutureRequirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + attr_reader :original_fields_due + end + + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + attr_reader :alternatives + # Date on which `future_requirements` becomes the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. + attr_reader :current_deadline + # Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + attr_reader :currently_due + # This is typed as an enum for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is null because fields in `future_requirements` will never disable the account. + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + attr_reader :eventually_due + # Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + + class Requirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + attr_reader :original_fields_due + end + + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + attr_reader :alternatives + # Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. These fields may disable the capability sooner if the next threshold is reached before they are collected. + attr_reader :current_deadline + # Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. + attr_reader :currently_due + # Description of why the capability is disabled. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + attr_reader :eventually_due + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the capability on the account. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + # The account for which the capability enables functionality. + attr_reader :account + + # Attribute for field future_requirements + attr_reader :future_requirements + + # The identifier for the capability. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Whether the capability has been requested. + attr_reader :requested + + # Time at which the capability was requested. Measured in seconds since the Unix epoch. + attr_reader :requested_at + + # Attribute for field requirements + attr_reader :requirements + + # The status of the capability. + attr_reader :status + def resource_url if !respond_to?(:account) || account.nil? raise NotImplementedError, diff --git a/lib/stripe/resources/capital/financing_offer.rb b/lib/stripe/resources/capital/financing_offer.rb index cd982e08d..a347d4c1b 100644 --- a/lib/stripe/resources/capital/financing_offer.rb +++ b/lib/stripe/resources/capital/financing_offer.rb @@ -13,6 +13,90 @@ def self.object_name "capital.financing_offer" end + class AcceptedTerms < Stripe::StripeObject + # Amount of financing offered, in minor units. + attr_reader :advance_amount + # Currency that the financing offer is transacted in. For example, `usd`. + attr_reader :currency + # Fixed fee amount, in minor units. + attr_reader :fee_amount + # Populated when the `product_type` of the `financingoffer` is `refill`. + # Represents the discount amount on remaining premium for the existing loan at payout time. + attr_reader :previous_financing_fee_discount_amount + # Per-transaction rate at which Stripe will withhold funds to repay the financing. + attr_reader :withhold_rate + end + + class OfferedTerms < Stripe::StripeObject + # Amount of financing offered, in minor units. + attr_reader :advance_amount + # Describes the type of user the offer is being extended to. + attr_reader :campaign_type + # Currency that the financing offer is transacted in. For example, `usd`. + attr_reader :currency + # Fixed fee amount, in minor units. + attr_reader :fee_amount + # Populated when the `product_type` of the `financingoffer` is `refill`. + # Represents the discount rate percentage on remaining fee on the existing loan. When the `financing_offer` + # is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate + # and the remaining fee. + attr_reader :previous_financing_fee_discount_rate + # Per-transaction rate at which Stripe will withhold funds to repay the financing. + attr_reader :withhold_rate + end + # This is an object representing the terms of an offer of financing from + # Stripe Capital to a Connected account. This resource represents + # the terms accepted by the Connected account, which may differ from those + # offered. + attr_reader :accepted_terms + + # The ID of the merchant associated with this financing object. + attr_reader :account + + # The time at which this financing offer was charged off, if applicable. Given in seconds since unix epoch. + attr_reader :charged_off_at + + # Time at which the offer was created. Given in seconds since unix epoch. + attr_reader :created + + # Time at which the offer expires. Given in seconds since unix epoch. + attr_reader :expires_after + + # The type of financing being offered. + attr_reader :financing_type + + # A unique identifier for the financing object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The object type: financing_offer. + attr_reader :object + + # This is an object representing the terms of an offer of financing from + # Stripe Capital to a Connected account. This resource represents + # both the terms offered to the Connected account. + attr_reader :offered_terms + + # Financing product identifier. + attr_reader :product_type + + # The ID of the financing offer that replaced this offer. + attr_reader :replacement + + # The ID of the financing offer that this offer is a replacement for. + attr_reader :replacement_for + + # The current status of the offer. + attr_reader :status + + # See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type). + attr_reader :type + # Retrieves the financing offers available for Connected accounts that belong to your platform. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/capital/financing_summary.rb b/lib/stripe/resources/capital/financing_summary.rb index 67b61c1dc..dc902a45f 100644 --- a/lib/stripe/resources/capital/financing_summary.rb +++ b/lib/stripe/resources/capital/financing_summary.rb @@ -10,6 +10,49 @@ class FinancingSummary < SingletonAPIResource def self.object_name "capital.financing_summary" end + + class Details < Stripe::StripeObject + class CurrentRepaymentInterval < Stripe::StripeObject + # The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited. + # Given in seconds since unix epoch. + attr_reader :due_at + # The amount that has already been paid in the current repayment interval. + attr_reader :paid_amount + # The amount that is yet to be paid in the current repayment interval. + attr_reader :remaining_amount + end + # Amount of financing offered, in minor units. + attr_reader :advance_amount + # The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch. + attr_reader :advance_paid_out_at + # Currency that the financing offer is transacted in. For example, `usd`. + attr_reader :currency + # The chronologically current repayment interval for the financing offer. + attr_reader :current_repayment_interval + # Fixed fee amount, in minor units. + attr_reader :fee_amount + # The amount the Connected account has paid toward the financing debt so far. + attr_reader :paid_amount + # The balance remaining to be paid on the financing, in minor units. + attr_reader :remaining_amount + # The time at which Capital will begin withholding from payments. Given in seconds since unix epoch. + attr_reader :repayments_begin_at + # Per-transaction rate at which Stripe will withhold funds to repay the financing. + attr_reader :withhold_rate + end + # Additional information about the financing summary. Describes currency, advance amount, + # fee amount, withhold rate, remaining amount, paid amount, current repayment interval, + # repayment start date, and advance payout date. + attr_reader :details + + # The Financing Offer ID this Financing Summary corresponds to + attr_reader :financing_offer + + # The object type: financing_summary + attr_reader :object + + # Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing. + attr_reader :status end end end diff --git a/lib/stripe/resources/capital/financing_transaction.rb b/lib/stripe/resources/capital/financing_transaction.rb index df89c1f78..851d1dcbc 100644 --- a/lib/stripe/resources/capital/financing_transaction.rb +++ b/lib/stripe/resources/capital/financing_transaction.rb @@ -12,6 +12,63 @@ def self.object_name "capital.financing_transaction" end + class Details < Stripe::StripeObject + class Transaction < Stripe::StripeObject + # The linked payment ID. + attr_reader :charge + # The linked Treasury Financing Transaction ID. + attr_reader :treasury_transaction + end + # The advance amount being repaid, paid out, or reversed in minor units. + attr_reader :advance_amount + # The currency of the financing transaction. + attr_reader :currency + # The fee amount being repaid, paid out, or reversed in minor units. + attr_reader :fee_amount + # The linked payment for the transaction. This field only applies to financing transactions of type `paydown` and reason `automatic_withholding`. + attr_reader :linked_payment + # The reason for the financing transaction (if applicable). + attr_reader :reason + # The reversed transaction. This field only applies to financing + # transactions of type `reversal`. + attr_reader :reversed_transaction + # The advance and fee amount being repaid, paid out, or reversed in minor units. + attr_reader :total_amount + # This is an object representing a linked transaction on a Capital Financing Transaction. + attr_reader :transaction + end + # The ID of the merchant associated with this financing transaction. + attr_reader :account + + # Time at which the financing transaction was created. Given in seconds since unix epoch. + attr_reader :created_at + + # This is an object representing a transaction on a Capital financing offer. + attr_reader :details + + # The Capital financing offer for this financing transaction. + attr_reader :financing_offer + + # A unique identifier for the financing transaction object. + attr_reader :id + + # The Capital transaction object that predates the Financing Transactions API and + # corresponds with the balance transaction that was created as a result of this + # financing transaction. + attr_reader :legacy_balance_transaction_source + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The object type: financing_transaction + attr_reader :object + + # The type of the financing transaction. + attr_reader :type + + # A human-friendly description of the financing transaction. + attr_reader :user_facing_description + # Returns a list of financing transactions. The transactions are returned in sorted order, # with the most recent transactions appearing first. def self.list(filters = {}, opts = {}) diff --git a/lib/stripe/resources/card.rb b/lib/stripe/resources/card.rb index 5f9f3c160..20f66d2b9 100644 --- a/lib/stripe/resources/card.rb +++ b/lib/stripe/resources/card.rb @@ -17,6 +17,111 @@ def self.object_name "card" end + class Networks < Stripe::StripeObject + # The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + attr_reader :preferred + end + # The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + attr_reader :account + + # City/District/Suburb/Town/Village. + attr_reader :address_city + + # Billing address country, if provided when creating card. + attr_reader :address_country + + # Address line 1 (Street address/PO Box/Company name). + attr_reader :address_line1 + + # If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_line1_check + + # Address line 2 (Apartment/Suite/Unit/Building). + attr_reader :address_line2 + + # State/County/Province/Region. + attr_reader :address_state + + # ZIP or postal code. + attr_reader :address_zip + + # If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_zip_check + + # A set of available payout methods for this card. Only values from this set should be passed as the `method` when creating a payout. + attr_reader :available_payout_methods + + # Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + attr_reader :brand + + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + + # Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + attr_reader :currency + + # The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + attr_reader :customer + + # If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). + attr_reader :cvc_check + + # Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + attr_reader :default_for_currency + + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + + # (For tokenized numbers only.) The last four digits of the device account number. + attr_reader :dynamic_last4 + + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + + # Unique identifier for the object. + attr_reader :id + + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + + # The last four digits of the card. + attr_reader :last4 + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Cardholder name. + attr_reader :name + + # Attribute for field networks + attr_reader :networks + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # For external accounts that are cards, possible values are `new` and `errored`. If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated. + attr_reader :status + + # If the card number is tokenized, this is the method that was used. Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. + attr_reader :tokenization_method + + # Always true for a deleted object + attr_reader :deleted + def resource_url if respond_to?(:customer) && !customer.nil? && !customer.empty? "#{Customer.resource_url}/#{CGI.escape(customer)}/sources/#{CGI.escape(id)}" diff --git a/lib/stripe/resources/cash_balance.rb b/lib/stripe/resources/cash_balance.rb index 4f3740584..4aa57ffb2 100644 --- a/lib/stripe/resources/cash_balance.rb +++ b/lib/stripe/resources/cash_balance.rb @@ -9,6 +9,27 @@ def self.object_name "cash_balance" end + class Settings < Stripe::StripeObject + # The configuration for how funds that land in the customer cash balance are reconciled. + attr_reader :reconciliation_mode + # A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance + attr_reader :using_merchant_default + end + # A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :available + + # The ID of the customer whose cash balance this object represents. + attr_reader :customer + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field settings + attr_reader :settings + def resource_url if !respond_to?(:customer) || customer.nil? raise NotImplementedError, diff --git a/lib/stripe/resources/charge.rb b/lib/stripe/resources/charge.rb index 8177b75f6..ebc1d0825 100644 --- a/lib/stripe/resources/charge.rb +++ b/lib/stripe/resources/charge.rb @@ -20,6 +20,1335 @@ def self.object_name nested_resource_class_methods :refund, operations: %i[retrieve list] + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Billing address. + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + # Billing phone number (including extension). + attr_reader :phone + end + + class FraudDetails < Stripe::StripeObject + # Assessments from Stripe. If set, the value is `fraudulent`. + attr_reader :stripe_report + # Assessments reported by you. If set, possible values of are `safe` and `fraudulent`. + attr_reader :user_report + end + + class Level3 < Stripe::StripeObject + class LineItem < Stripe::StripeObject + # Attribute for field discount_amount + attr_reader :discount_amount + # Attribute for field product_code + attr_reader :product_code + # Attribute for field product_description + attr_reader :product_description + # Attribute for field quantity + attr_reader :quantity + # Attribute for field tax_amount + attr_reader :tax_amount + # Attribute for field unit_cost + attr_reader :unit_cost + end + # Attribute for field customer_reference + attr_reader :customer_reference + # Attribute for field line_items + attr_reader :line_items + # Attribute for field merchant_reference + attr_reader :merchant_reference + # Attribute for field shipping_address_zip + attr_reader :shipping_address_zip + # Attribute for field shipping_amount + attr_reader :shipping_amount + # Attribute for field shipping_from_zip + attr_reader :shipping_from_zip + end + + class Outcome < Stripe::StripeObject + class Rule < Stripe::StripeObject + # The action taken on the payment. + attr_reader :action + # Unique identifier for the object. + attr_reader :id + # The predicate to evaluate the payment against. + attr_reader :predicate + end + # For charges declined by the network, a 2 digit code which indicates the advice returned by the network on how to proceed with an error. + attr_reader :network_advice_code + # For charges declined by the network, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + attr_reader :network_decline_code + # Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. + attr_reader :network_status + # An enumerated value providing a more detailed explanation of the outcome's `type`. Charges blocked by Radar's default block rule have the value `highest_risk_level`. Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. Charges authorized, blocked, or placed in review by custom rules have the value `rule`. See [understanding declines](https://stripe.com/docs/declines) for more details. + attr_reader :reason + # Stripe Radar's evaluation of the riskiness of the payment. Possible values for evaluated payments are `normal`, `elevated`, `highest`. For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. In the event of an error in the evaluation, this field will have the value `unknown`. This field is only available with Radar. + attr_reader :risk_level + # Stripe Radar's evaluation of the riskiness of the payment. Possible values for evaluated payments are between 0 and 100. For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. This field is only available with Radar for Fraud Teams. + attr_reader :risk_score + # The ID of the Radar rule that matched the payment, if applicable. + attr_reader :rule + # A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. + attr_reader :seller_message + # Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. + attr_reader :type + end + + class PaymentMethodDetails < Stripe::StripeObject + class AchCreditTransfer < Stripe::StripeObject + # Account number to transfer funds to. + attr_reader :account_number + # Name of the bank associated with the routing number. + attr_reader :bank_name + # Routing transit number for the bank account to transfer funds to. + attr_reader :routing_number + # SWIFT code of the bank associated with the routing number. + attr_reader :swift_code + end + + class AchDebit < Stripe::StripeObject + # Type of entity that holds the account. This can be either `individual` or `company`. + attr_reader :account_holder_type + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # Routing transit number of the bank account. + attr_reader :routing_number + end + + class AcssDebit < Stripe::StripeObject + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Institution number of the bank account + attr_reader :institution_number + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # Transit number of the bank account. + attr_reader :transit_number + end + + class Affirm < Stripe::StripeObject + # The Affirm transaction ID associated with this payment. + attr_reader :transaction_id + end + + class AfterpayClearpay < Stripe::StripeObject + # The Afterpay order ID associated with this payment intent. + attr_reader :order_id + # Order identifier shown to the merchant in Afterpay’s online portal. + attr_reader :reference + end + + class Alipay < Stripe::StripeObject + # Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + attr_reader :buyer_id + # Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + attr_reader :fingerprint + # Transaction ID of this particular Alipay transaction. + attr_reader :transaction_id + end + + class Alma < Stripe::StripeObject; end + + class AmazonPay < Stripe::StripeObject + class Funding < Stripe::StripeObject + class Card < Stripe::StripeObject + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # The last four digits of the card. + attr_reader :last4 + end + # Attribute for field card + attr_reader :card + # funding type of the underlying payment method. + attr_reader :type + end + # Attribute for field funding + attr_reader :funding + end + + class AuBecsDebit < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + attr_reader :bsb_number + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + end + + class BacsDebit < Stripe::StripeObject + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # Sort code of the bank account. (e.g., `10-20-30`) + attr_reader :sort_code + end + + class Bancontact < Stripe::StripeObject + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + attr_reader :iban_last4 + # Preferred language of the Bancontact authorization page that the customer is redirected to. + # Can be one of `en`, `de`, `fr`, or `nl` + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by Bancontact directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class Blik < Stripe::StripeObject + # A unique and immutable identifier assigned by BLIK to every buyer. + attr_reader :buyer_id + end + + class Boleto < Stripe::StripeObject + # The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) + attr_reader :tax_id + end + + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :cvc_check + end + + class DecrementalAuthorization < Stripe::StripeObject + # Indicates whether or not the decremental authorization feature is supported. + attr_reader :status + end + + class ExtendedAuthorization < Stripe::StripeObject + # Indicates whether or not the capture window is extended beyond the standard authorization. + attr_reader :status + end + + class IncrementalAuthorization < Stripe::StripeObject + # Indicates whether or not the incremental authorization feature is supported. + attr_reader :status + end + + class Installments < Stripe::StripeObject + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + attr_reader :type + end + # Installment plan selected for the payment. + attr_reader :plan + end + + class Multicapture < Stripe::StripeObject + # Indicates whether or not multiple captures are supported. + attr_reader :status + end + + class NetworkToken < Stripe::StripeObject + # Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. + attr_reader :used + end + + class Overcapture < Stripe::StripeObject + # The maximum amount that can be captured. + attr_reader :maximum_amount_capturable + # Indicates whether or not the authorized amount can be over-captured. + attr_reader :status + end + + class PartialAuthorization < Stripe::StripeObject + # Indicates whether the transaction requested for partial authorization feature and the authorization outcome. + attr_reader :status + end + + class ThreeDSecure < Stripe::StripeObject + # For authenticated transactions: how the customer was authenticated by + # the issuing bank. + attr_reader :authentication_flow + # The Electronic Commerce Indicator (ECI). A protocol-level field + # indicating what degree of authentication was performed. + attr_reader :electronic_commerce_indicator + # The exemption requested via 3DS and accepted by the issuer at authentication time. + attr_reader :exemption_indicator + # Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on + # the outcome of Stripe's internal risk assessment. + attr_reader :exemption_indicator_applied + # Indicates the outcome of 3D Secure authentication. + attr_reader :result + # Additional information about why 3D Secure succeeded or failed based + # on the `result`. + attr_reader :result_reason + # The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + # (dsTransId) for this payment. + attr_reader :transaction_id + # The version of 3D Secure that was used. + attr_reader :version + end + + class Wallet < Stripe::StripeObject + class AmexExpressCheckout < Stripe::StripeObject; end + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + + class Masterpass < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :shipping_address + end + + class SamsungPay < Stripe::StripeObject; end + + class VisaCheckout < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :shipping_address + end + # Attribute for field amex_express_checkout + attr_reader :amex_express_checkout + # Attribute for field apple_pay + attr_reader :apple_pay + # (For tokenized numbers only.) The last four digits of the device account number. + attr_reader :dynamic_last4 + # Attribute for field google_pay + attr_reader :google_pay + # Attribute for field link + attr_reader :link + # Attribute for field masterpass + attr_reader :masterpass + # Attribute for field samsung_pay + attr_reader :samsung_pay + # The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + attr_reader :type + # Attribute for field visa_checkout + attr_reader :visa_checkout + end + # The authorized amount. + attr_reader :amount_authorized + # The latest amount intended to be authorized by this charge. + attr_reader :amount_requested + # Authorization code on the charge. + attr_reader :authorization_code + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. + attr_reader :capture_before + # Check results by Card networks on Card address and CVC at time of payment. + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # Attribute for field decremental_authorization + attr_reader :decremental_authorization + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Attribute for field extended_authorization + attr_reader :extended_authorization + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # Attribute for field incremental_authorization + attr_reader :incremental_authorization + # Installment details for this payment (Mexico only). + # + # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + attr_reader :installments + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # ID of the mandate used to make this payment or created by it. + attr_reader :mandate + # True if this payment was marked as MOTO and out of scope for SCA. + attr_reader :moto + # Attribute for field multicapture + attr_reader :multicapture + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :network + # If this card has network token credentials, this contains the details of the network token credentials. + attr_reader :network_token + # Attribute for field overcapture + attr_reader :overcapture + # Attribute for field partial_authorization + attr_reader :partial_authorization + # Populated if this transaction used 3D Secure authentication. + attr_reader :three_d_secure + # If this Card is part of a card wallet, this contains the details of the card wallet. + attr_reader :wallet + end + + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + attr_reader :type + end + + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + attr_reader :application_preferred_name + # Identifier for this transaction. + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + attr_reader :transaction_status_information + end + + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + attr_reader :type + end + # The authorized amount + attr_reader :amount_authorized + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + attr_reader :brand_product + # When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + attr_reader :capture_before + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Authorization response cryptogram. + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + attr_reader :incremental_authorization_supported + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + attr_reader :network_transaction_id + # Details about payments collected offline. + attr_reader :offline + # Defines whether the authorized amount can be over-captured or not + attr_reader :overcapture_supported + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + attr_reader :receipt + # Attribute for field wallet + attr_reader :wallet + end + + class Cashapp < Stripe::StripeObject + # A unique and immutable identifier assigned by Cash App to every buyer. + attr_reader :buyer_id + # A public identifier for buyers using Cash App. + attr_reader :cashtag + end + + class CustomerBalance < Stripe::StripeObject; end + + class Eps < Stripe::StripeObject + # The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + attr_reader :bank + # Owner's verified full name. Values are verified or provided by EPS directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + # EPS rarely provides this information so the attribute is usually empty. + attr_reader :verified_name + end + + class Fpx < Stripe::StripeObject + # Account holder type, if provided. Can be one of `individual` or `company`. + attr_reader :account_holder_type + # The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + attr_reader :bank + # Unique transaction id generated by FPX for every request from the merchant + attr_reader :transaction_id + end + + class Giropay < Stripe::StripeObject + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + attr_reader :bic + # Owner's verified full name. Values are verified or provided by Giropay directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + # Giropay rarely provides this information so the attribute is usually empty. + attr_reader :verified_name + end + + class Gopay < Stripe::StripeObject; end + + class Grabpay < Stripe::StripeObject + # Unique transaction id generated by GrabPay + attr_reader :transaction_id + end + + class IdBankTransfer < Stripe::StripeObject + # Account number of the bank account to transfer funds to. + attr_reader :account_number + # Bank where the account is located. + attr_reader :bank + # Local bank code of the bank. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + attr_reader :display_name + end + + class Ideal < Stripe::StripeObject + # The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + attr_reader :bank + # The Bank Identifier Code of the customer's bank. + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + attr_reader :iban_last4 + # Owner's verified full name. Values are verified or provided by iDEAL directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class InteracPresent < Stripe::StripeObject + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + attr_reader :application_preferred_name + # Identifier for this transaction. + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + attr_reader :transaction_status_information + end + # Card brand. Can be `interac`, `mastercard` or `visa`. + attr_reader :brand + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Authorization response cryptogram. + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + attr_reader :network_transaction_id + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + attr_reader :receipt + end + + class KakaoPay < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + attr_reader :buyer_id + end + + class Klarna < Stripe::StripeObject + class PayerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # The payer address country + attr_reader :country + end + # The payer's address + attr_reader :address + end + # The payer details for this transaction. + attr_reader :payer_details + # The Klarna payment method used for this transaction. + # Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` + attr_reader :payment_method_category + # Preferred language of the Klarna authorization page that the customer is redirected to. + # Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` + attr_reader :preferred_locale + end + + class Konbini < Stripe::StripeObject + class Store < Stripe::StripeObject + # The name of the convenience store chain where the payment was completed. + attr_reader :chain + end + # If the payment succeeded, this contains the details of the convenience store where the payment was completed. + attr_reader :store + end + + class KrCard < Stripe::StripeObject + # The local credit or debit card brand. + attr_reader :brand + # A unique identifier for the buyer as determined by the local payment processor. + attr_reader :buyer_id + # The last four digits of the card. This may not be present for American Express cards. + attr_reader :last4 + end + + class Link < Stripe::StripeObject + # Two-letter ISO code representing the funding source country beneath the Link payment. + # You could use this attribute to get a sense of international fees. + attr_reader :country + end + + class MbWay < Stripe::StripeObject; end + + class Mobilepay < Stripe::StripeObject + class Card < Stripe::StripeObject + # Brand of the card used in the transaction + attr_reader :brand + # Two-letter ISO code representing the country of the card + attr_reader :country + # Two digit number representing the card's expiration month + attr_reader :exp_month + # Two digit number representing the card's expiration year + attr_reader :exp_year + # The last 4 digits of the card + attr_reader :last4 + end + # Internal card details + attr_reader :card + end + + class Multibanco < Stripe::StripeObject + # Entity number associated with this Multibanco payment. + attr_reader :entity + # Reference number associated with this Multibanco payment. + attr_reader :reference + end + + class NaverPay < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + attr_reader :buyer_id + end + + class Oxxo < Stripe::StripeObject + # OXXO reference number + attr_reader :number + end + + class P24 < Stripe::StripeObject + # The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + attr_reader :bank + # Unique reference for this Przelewy24 payment. + attr_reader :reference + # Owner's verified full name. Values are verified or provided by Przelewy24 directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + # Przelewy24 rarely provides this information so the attribute is usually empty. + attr_reader :verified_name + end + + class Payco < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + attr_reader :buyer_id + end + + class Paynow < Stripe::StripeObject + # Reference number associated with this PayNow payment + attr_reader :reference + end + + class Paypal < Stripe::StripeObject + class SellerProtection < Stripe::StripeObject + # An array of conditions that are covered for the transaction, if applicable. + attr_reader :dispute_categories + # Indicates whether the transaction is eligible for PayPal's seller protection. + attr_reader :status + end + + class Shipping < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class VerifiedAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's email. Values are provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :payer_email + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + attr_reader :payer_id + # Owner's full name. Values provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :payer_name + # The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. + attr_reader :seller_protection + # The shipping address for the customer, as supplied by the merchant at the point of payment + # execution. This shipping address will not be updated if the merchant updates the shipping + # address on the PaymentIntent after the PaymentIntent was successfully confirmed. + attr_reader :shipping + # A unique ID generated by PayPal for this transaction. + attr_reader :transaction_id + # The shipping address for the customer, as supplied by the merchant at the point of payment + # execution. This shipping address will not be updated if the merchant updates the shipping + # address on the PaymentIntent after the PaymentIntent was successfully confirmed. + attr_reader :verified_address + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_email + # Owner's verified full name. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class Payto < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + attr_reader :bsb_number + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # The PayID alias for the bank account. + attr_reader :pay_id + end + + class Pix < Stripe::StripeObject + # Unique transaction id generated by BCB + attr_reader :bank_transaction_id + end + + class Promptpay < Stripe::StripeObject + # Bill reference generated by PromptPay + attr_reader :reference + end + + class Qris < Stripe::StripeObject; end + class Rechnung < Stripe::StripeObject; end + + class RevolutPay < Stripe::StripeObject + class Funding < Stripe::StripeObject + class Card < Stripe::StripeObject + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # The last four digits of the card. + attr_reader :last4 + end + # Attribute for field card + attr_reader :card + # funding type of the underlying payment method. + attr_reader :type + end + # Attribute for field funding + attr_reader :funding + end + + class SamsungPay < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + attr_reader :buyer_id + end + + class SepaCreditTransfer < Stripe::StripeObject + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + attr_reader :bic + # IBAN of the bank account to transfer funds to. + attr_reader :iban + end + + class SepaDebit < Stripe::StripeObject + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Branch code of bank associated with the bank account. + attr_reader :branch_code + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four characters of the IBAN. + attr_reader :last4 + # Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). + attr_reader :mandate + end + + class Shopeepay < Stripe::StripeObject; end + + class Sofort < Stripe::StripeObject + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + attr_reader :bic + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + attr_reader :iban_last4 + # Preferred language of the SOFORT authorization page that the customer is redirected to. + # Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by SOFORT directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class StripeAccount < Stripe::StripeObject; end + + class Swish < Stripe::StripeObject + # Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer + attr_reader :fingerprint + # Payer bank reference number for the payment + attr_reader :payment_reference + # The last four digits of the Swish account phone number + attr_reader :verified_phone_last4 + end + + class Twint < Stripe::StripeObject; end + + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + attr_reader :account_type + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # Reference number to locate ACH payments with customer's bank. + attr_reader :payment_reference + # Routing number of the bank account. + attr_reader :routing_number + end + + class Wechat < Stripe::StripeObject; end + + class WechatPay < Stripe::StripeObject + # Uniquely identifies this particular WeChat Pay account. You can use this attribute to check whether two WeChat accounts are the same. + attr_reader :fingerprint + # Transaction ID of this particular WeChat Pay transaction. + attr_reader :transaction_id + end + + class Zip < Stripe::StripeObject; end + # Attribute for field ach_credit_transfer + attr_reader :ach_credit_transfer + # Attribute for field ach_debit + attr_reader :ach_debit + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field affirm + attr_reader :affirm + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + # Attribute for field alipay + attr_reader :alipay + # Attribute for field alma + attr_reader :alma + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field bancontact + attr_reader :bancontact + # Attribute for field blik + attr_reader :blik + # Attribute for field boleto + attr_reader :boleto + # Attribute for field card + attr_reader :card + # Attribute for field card_present + attr_reader :card_present + # Attribute for field cashapp + attr_reader :cashapp + # Attribute for field customer_balance + attr_reader :customer_balance + # Attribute for field eps + attr_reader :eps + # Attribute for field fpx + attr_reader :fpx + # Attribute for field giropay + attr_reader :giropay + # Attribute for field gopay + attr_reader :gopay + # Attribute for field grabpay + attr_reader :grabpay + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + # Attribute for field ideal + attr_reader :ideal + # Attribute for field interac_present + attr_reader :interac_present + # Attribute for field kakao_pay + attr_reader :kakao_pay + # Attribute for field klarna + attr_reader :klarna + # Attribute for field konbini + attr_reader :konbini + # Attribute for field kr_card + attr_reader :kr_card + # Attribute for field link + attr_reader :link + # Attribute for field mb_way + attr_reader :mb_way + # Attribute for field mobilepay + attr_reader :mobilepay + # Attribute for field multibanco + attr_reader :multibanco + # Attribute for field naver_pay + attr_reader :naver_pay + # Attribute for field oxxo + attr_reader :oxxo + # Attribute for field p24 + attr_reader :p24 + # Attribute for field payco + attr_reader :payco + # Attribute for field paynow + attr_reader :paynow + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field pix + attr_reader :pix + # Attribute for field promptpay + attr_reader :promptpay + # Attribute for field qris + attr_reader :qris + # Attribute for field rechnung + attr_reader :rechnung + # Attribute for field revolut_pay + attr_reader :revolut_pay + # Attribute for field samsung_pay + attr_reader :samsung_pay + # Attribute for field sepa_credit_transfer + attr_reader :sepa_credit_transfer + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field shopeepay + attr_reader :shopeepay + # Attribute for field sofort + attr_reader :sofort + # Attribute for field stripe_account + attr_reader :stripe_account + # Attribute for field swish + attr_reader :swish + # Attribute for field twint + attr_reader :twint + # The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. + # An additional hash is included on `payment_method_details` with a name matching this value. + # It contains information specific to the payment method. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + # Attribute for field wechat + attr_reader :wechat + # Attribute for field wechat_pay + attr_reader :wechat_pay + # Attribute for field zip + attr_reader :zip + end + + class RadarOptions < Stripe::StripeObject + # A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + attr_reader :session + end + + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class TransferData < Stripe::StripeObject + # The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + attr_reader :amount + # ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. + attr_reader :destination + end + # Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + attr_reader :amount + + # Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). + attr_reader :amount_captured + + # Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). + attr_reader :amount_refunded + + # ID of the Connect application that created the charge. + attr_reader :application + + # The application fee (if any) for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. + attr_reader :application_fee + + # The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. + attr_reader :application_fee_amount + + # Authorization code on the charge. + attr_reader :authorization_code + + # ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + attr_reader :balance_transaction + + # Attribute for field billing_details + attr_reader :billing_details + + # The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments. + attr_reader :calculated_statement_descriptor + + # If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + attr_reader :captured + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # ID of the customer this charge is for if one exists. + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Whether the charge has been disputed. + attr_reader :disputed + + # ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + attr_reader :failure_balance_transaction + + # Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). + attr_reader :failure_code + + # Message to user further explaining reason for charge failure if available. + attr_reader :failure_message + + # Information on fraud assessments for the charge. + attr_reader :fraud_details + + # Unique identifier for the object. + attr_reader :id + + # ID of the invoice this charge is for if one exists. + attr_reader :invoice + + # Attribute for field level3 + attr_reader :level3 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + attr_reader :on_behalf_of + + # Details about whether the payment was accepted, and why. See [understanding declines](https://stripe.com/docs/declines) for details. + attr_reader :outcome + + # `true` if the charge succeeded, or was successfully authorized for later capture. + attr_reader :paid + + # ID of the PaymentIntent associated with this charge, if one exists. + attr_reader :payment_intent + + # ID of the payment method used in this charge. + attr_reader :payment_method + + # Details about the payment method at the time of the transaction. + attr_reader :payment_method_details + + # Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + attr_reader :radar_options + + # This is the email address that the receipt for this charge was sent to. + attr_reader :receipt_email + + # This is the transaction number that appears on email receipts sent for this charge. This attribute will be `null` until a receipt has been sent. + attr_reader :receipt_number + + # This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + attr_reader :receipt_url + + # Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. + attr_reader :refunded + + # A list of refunds that have been applied to the charge. + attr_reader :refunds + + # ID of the review associated with this charge if one exists. + attr_reader :review + + # Shipping information for the charge. + attr_reader :shipping + + # This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. + attr_reader :source + + # The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details. + attr_reader :source_transfer + + # For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + # + # For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + attr_reader :statement_descriptor + + # Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + attr_reader :statement_descriptor_suffix + + # The status of the payment is either `succeeded`, `pending`, or `failed`. + attr_reader :status + + # ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). + attr_reader :transfer + + # An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + attr_reader :transfer_data + + # A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + attr_reader :transfer_group + # Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. # # Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. diff --git a/lib/stripe/resources/checkout/session.rb b/lib/stripe/resources/checkout/session.rb index a05371292..e7e1b64e3 100644 --- a/lib/stripe/resources/checkout/session.rb +++ b/lib/stripe/resources/checkout/session.rb @@ -27,6 +27,1228 @@ def self.object_name "checkout.session" end + class AdaptivePricing < Stripe::StripeObject + # Whether Adaptive Pricing is enabled. + attr_reader :enabled + end + + class AfterExpiration < Stripe::StripeObject + class Recovery < Stripe::StripeObject + # Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` + attr_reader :allow_promotion_codes + # If `true`, a recovery url will be generated to recover this Checkout Session if it + # expires before a transaction is completed. It will be attached to the + # Checkout Session object upon expiration. + attr_reader :enabled + # The timestamp at which the recovery URL will expire. + attr_reader :expires_at + # URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session + attr_reader :url + end + # When set, configuration used to recover the Checkout Session on expiry. + attr_reader :recovery + end + + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Indicates whether automatic tax is enabled for the session + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + # The status of the most recent automated tax calculation for this session. + attr_reader :status + end + + class CollectedInformation < Stripe::StripeObject + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + # Customer’s business name for this Checkout Session + attr_reader :business_name + # Customer’s email for this Checkout Session + attr_reader :email + # Customer’s phone number for this Checkout Session + attr_reader :phone + # Shipping information for this Checkout Session. + attr_reader :shipping_details + # Customer’s tax ids for this Checkout Session. + attr_reader :tax_ids + end + + class Consent < Stripe::StripeObject + # If `opt_in`, the customer consents to receiving promotional communications + # from the merchant about this Checkout Session. + attr_reader :promotions + # If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. + attr_reader :terms_of_service + end + + class ConsentCollection < Stripe::StripeObject + class PaymentMethodReuseAgreement < Stripe::StripeObject + # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. + # + # When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + attr_reader :position + end + # If set to `hidden`, it will hide legal text related to the reuse of a payment method. + attr_reader :payment_method_reuse_agreement + # If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + # Session will determine whether to display an option to opt into promotional communication + # from the merchant depending on the customer's locale. Only available to US merchants. + attr_reader :promotions + # If set to `required`, it requires customers to accept the terms of service before being able to pay. + attr_reader :terms_of_service + end + + class CurrencyConversion < Stripe::StripeObject + # Total of all items in source currency before discounts or taxes are applied. + attr_reader :amount_subtotal + # Total of all items in source currency after discounts and taxes are applied. + attr_reader :amount_total + # Exchange rate used to convert source currency amounts to customer currency amounts + attr_reader :fx_rate + # Creation currency of the CheckoutSession before localization + attr_reader :source_currency + end + + class CustomField < Stripe::StripeObject + class Dropdown < Stripe::StripeObject + class Option < Stripe::StripeObject + # The label for the option, displayed to the customer. Up to 100 characters. + attr_reader :label + # The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. + attr_reader :value + end + # The value that will pre-fill on the payment page. + attr_reader :default_value + # The options available for the customer to select. Up to 200 options allowed. + attr_reader :options + # The option selected by the customer. This will be the `value` for the option. + attr_reader :value + end + + class Label < Stripe::StripeObject + # Custom text for the label, displayed to the customer. Up to 50 characters. + attr_reader :custom + # The type of the label. + attr_reader :type + end + + class Numeric < Stripe::StripeObject + # The value that will pre-fill the field on the payment page. + attr_reader :default_value + # The maximum character length constraint for the customer's input. + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + attr_reader :minimum_length + # The value entered by the customer, containing only digits. + attr_reader :value + end + + class Text < Stripe::StripeObject + # The value that will pre-fill the field on the payment page. + attr_reader :default_value + # The maximum character length constraint for the customer's input. + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + attr_reader :minimum_length + # The value entered by the customer. + attr_reader :value + end + # Attribute for field dropdown + attr_reader :dropdown + # String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. + attr_reader :key + # Attribute for field label + attr_reader :label + # Attribute for field numeric + attr_reader :numeric + # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. + attr_reader :optional + # Attribute for field text + attr_reader :text + # The type of the field. + attr_reader :type + end + + class CustomText < Stripe::StripeObject + class AfterSubmit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + + class ShippingAddress < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + + class Submit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + + class TermsOfServiceAcceptance < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + # Custom text that should be displayed after the payment confirmation button. + attr_reader :after_submit + # Custom text that should be displayed alongside shipping address collection. + attr_reader :shipping_address + # Custom text that should be displayed alongside the payment confirmation button. + attr_reader :submit + # Custom text that should be displayed in place of the default terms of service agreement text. + attr_reader :terms_of_service_acceptance + end + + class CustomerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + # The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. + attr_reader :address + # The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. + # Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. + attr_reader :email + # The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. + attr_reader :name + # The customer's phone number after a completed Checkout Session. + attr_reader :phone + # The customer’s tax exempt status after a completed Checkout Session. + attr_reader :tax_exempt + # The customer’s tax IDs after a completed Checkout Session. + attr_reader :tax_ids + end + + class InvoiceCreation < Stripe::StripeObject + class InvoiceData < Stripe::StripeObject + class CustomField < Stripe::StripeObject + # The name of the custom field. + attr_reader :name + # The value of the custom field. + attr_reader :value + end + + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + + class RenderingOptions < Stripe::StripeObject + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + attr_reader :amount_tax_display + end + # The account tax IDs associated with the invoice. + attr_reader :account_tax_ids + # Custom fields displayed on the invoice. + attr_reader :custom_fields + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + # Footer displayed on the invoice. + attr_reader :footer + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + attr_reader :issuer + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + # Options for invoice PDF rendering. + attr_reader :rendering_options + end + # Indicates whether invoice creation is enabled for the Checkout Session. + attr_reader :enabled + # Attribute for field invoice_data + attr_reader :invoice_data + end + + class PaymentMethodConfigurationDetails < Stripe::StripeObject + # ID of the payment method configuration used. + attr_reader :id + # ID of the parent payment method configuration used. + attr_reader :parent + end + + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + attr_reader :custom_mandate_url + # List of Stripe products where this mandate can be selected automatically. Returned when the Session is in `setup` mode. + attr_reader :default_for + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + attr_reader :interval_description + # Payment schedule for the mandate. + attr_reader :payment_schedule + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Currency supported by the bank account. Returned when the Session is in `setup` mode. + attr_reader :currency + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Bank account verification method. + attr_reader :verification_method + end + + class Affirm < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class AfterpayClearpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Alipay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class AmazonPay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class AuBecsDebit < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class BacsDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Bancontact < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Boleto < Stripe::StripeObject + # 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. + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + # Indicates if installments are enabled + attr_reader :enabled + end + # Attribute for field installments + attr_reader :installments + # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession. + attr_reader :request_decremental_authorization + # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession. + attr_reader :request_extended_authorization + # Request ability to [increment the authorization](/payments/incremental-authorization) for this CheckoutSession. + attr_reader :request_incremental_authorization + # Request ability to make [multiple captures](/payments/multicapture) for this CheckoutSession. + attr_reader :request_multicapture + # Request ability to [overcapture](/payments/overcapture) for this CheckoutSession. + attr_reader :request_overcapture + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + attr_reader :request_three_d_secure + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + attr_reader :statement_descriptor_suffix_kana + # Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + attr_reader :statement_descriptor_suffix_kanji + end + + class Cashapp < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + attr_reader :country + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + # + # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + attr_reader :requested_address_types + # The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + attr_reader :funding_type + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Eps < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Fpx < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Giropay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Grabpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Ideal < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class KakaoPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Klarna < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Konbini < Stripe::StripeObject + # The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class KrCard < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Link < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Mobilepay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Multibanco < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class NaverPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class Oxxo < Stripe::StripeObject + # The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class P24 < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Payco < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class Paynow < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Paypal < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Preferred locale of the PayPal checkout page that the customer is redirected to. + attr_reader :preferred_locale + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + attr_reader :reference + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + attr_reader :subsellers + end + + class Payto < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + attr_reader :end_date + # The periodicity at which payments will be collected. + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + attr_reader :purpose + # Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + attr_reader :start_date + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Pix < Stripe::StripeObject + # The number of seconds after which Pix payment will expire. + attr_reader :expires_after_seconds + end + + class RevolutPay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class SamsungPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Sofort < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Swish < Stripe::StripeObject + # The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + attr_reader :reference + end + + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + attr_reader :institution + end + + class ManualEntry < Stripe::StripeObject + # Settings for configuring manual entry of account details. + attr_reader :mode + end + # Attribute for field filters + attr_reader :filters + # Attribute for field manual_entry + attr_reader :manual_entry + # The list of permissions to request. The `payment_method` permission must be included. + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + attr_reader :return_url + end + # Attribute for field financial_connections + attr_reader :financial_connections + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Bank account verification method. + attr_reader :verification_method + end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field affirm + attr_reader :affirm + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + # Attribute for field alipay + attr_reader :alipay + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field bancontact + attr_reader :bancontact + # Attribute for field boleto + attr_reader :boleto + # Attribute for field card + attr_reader :card + # Attribute for field cashapp + attr_reader :cashapp + # Attribute for field customer_balance + attr_reader :customer_balance + # Attribute for field eps + attr_reader :eps + # Attribute for field fpx + attr_reader :fpx + # Attribute for field giropay + attr_reader :giropay + # Attribute for field grabpay + attr_reader :grabpay + # Attribute for field ideal + attr_reader :ideal + # Attribute for field kakao_pay + attr_reader :kakao_pay + # Attribute for field klarna + attr_reader :klarna + # Attribute for field konbini + attr_reader :konbini + # Attribute for field kr_card + attr_reader :kr_card + # Attribute for field link + attr_reader :link + # Attribute for field mobilepay + attr_reader :mobilepay + # Attribute for field multibanco + attr_reader :multibanco + # Attribute for field naver_pay + attr_reader :naver_pay + # Attribute for field oxxo + attr_reader :oxxo + # Attribute for field p24 + attr_reader :p24 + # Attribute for field payco + attr_reader :payco + # Attribute for field paynow + attr_reader :paynow + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field pix + attr_reader :pix + # Attribute for field revolut_pay + attr_reader :revolut_pay + # Attribute for field samsung_pay + attr_reader :samsung_pay + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field sofort + attr_reader :sofort + # Attribute for field swish + attr_reader :swish + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class Permissions < Stripe::StripeObject + class Update < Stripe::StripeObject + # Determines which entity is allowed to update the line items. + # + # Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + # + # When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + attr_reader :line_items + # Determines which entity is allowed to update the shipping details. + # + # Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + # + # When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + attr_reader :shipping_details + end + # Permissions for updating the Checkout Session. + attr_reader :update + end + + class PhoneNumberCollection < Stripe::StripeObject + # Indicates whether phone number collection is enabled for the session + attr_reader :enabled + end + + class SavedPaymentMethodOptions < Stripe::StripeObject + # Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout. + attr_reader :allow_redisplay_filters + # Enable customers to choose if they wish to remove their saved payment methods. Disabled by default. + attr_reader :payment_method_remove + # Enable customers to choose if they wish to save their payment method for future use. Disabled by default. + attr_reader :payment_method_save + end + + class ShippingAddressCollection < Stripe::StripeObject + # An array of two-letter ISO country codes representing which countries Checkout should provide as options for + # shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + attr_reader :allowed_countries + end + + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # Total shipping cost before any discounts or taxes are applied. + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + attr_reader :amount_tax + # Total shipping cost after discounts and taxes are applied. + attr_reader :amount_total + # The ID of the ShippingRate for this order. + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + attr_reader :taxes + end + + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class ShippingOption < Stripe::StripeObject + # A non-negative integer in cents representing how much to charge. + attr_reader :shipping_amount + # The shipping rate. + attr_reader :shipping_rate + end + + class TaxIdCollection < Stripe::StripeObject + # Indicates whether tax ID collection is enabled for the session + attr_reader :enabled + # Indicates whether a tax ID is required on the payment page + attr_reader :required + end + + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + attr_reader :discount + end + + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The aggregated discounts. + attr_reader :discounts + # The aggregated tax amounts by rate. + attr_reader :taxes + end + # This is the sum of all the discounts. + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + attr_reader :amount_tax + # Attribute for field breakdown + attr_reader :breakdown + end + # Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). + attr_reader :adaptive_pricing + + # When set, provides configuration for actions to take if this Checkout Session expires. + attr_reader :after_expiration + + # Enables user redeemable promotion codes. + attr_reader :allow_promotion_codes + + # Total of all items before discounts or taxes are applied. + attr_reader :amount_subtotal + + # Total of all items after discounts and taxes are applied. + attr_reader :amount_total + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # Describes whether Checkout should collect the customer's billing address. Defaults to `auto`. + attr_reader :billing_address_collection + + # If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + attr_reader :cancel_url + + # A unique string to reference the Checkout Session. This can be a + # customer ID, a cart ID, or similar, and can be used to reconcile the + # Session with your internal systems. + attr_reader :client_reference_id + + # The client secret of the Session. Use this with [initCustomCheckout](https://stripe.com/docs/js/custom_checkout/init) on your front end. + attr_reader :client_secret + + # Information about the customer collected within the Checkout Session. + attr_reader :collected_information + + # Results of `consent_collection` for this session. + attr_reader :consent + + # When set, provides configuration for the Checkout Session to gather active consent from customers. + attr_reader :consent_collection + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions + attr_reader :currency_conversion + + # Collect additional information from your customer using custom fields. Up to 3 fields are supported. + attr_reader :custom_fields + + # Attribute for field custom_text + attr_reader :custom_text + + # The ID of the customer for this Session. + # For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout + # will create a new customer object based on information provided + # during the payment flow unless an existing customer was provided when + # the Session was created. + attr_reader :customer + + # Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + attr_reader :customer_creation + + # The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode. + attr_reader :customer_details + + # If provided, this value will be used when the Customer object is created. + # If not provided, customers will be asked to enter their email address. + # Use this parameter to prefill customer data if you already have an email + # on file. To access information about the customer once the payment flow is + # complete, use the `customer` attribute. + attr_reader :customer_email + + # The timestamp at which the Checkout Session will expire. + attr_reader :expires_at + + # Unique identifier for the object. + attr_reader :id + + # ID of the invoice created by the Checkout Session, if it exists. + attr_reader :invoice + + # Details on the state of invoice creation for the Checkout Session. + attr_reader :invoice_creation + + # The line items purchased by the customer. + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. + attr_reader :locale + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The mode of the Checkout Session. + attr_reader :mode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ID of the PaymentIntent for Checkout Sessions in `payment` mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. + attr_reader :payment_intent + + # The ID of the Payment Link that created this Session. + attr_reader :payment_link + + # Configure whether a Checkout Session should collect a payment method. Defaults to `always`. + attr_reader :payment_method_collection + + # Information about the payment method configuration used for this Checkout session if using dynamic payment methods. + attr_reader :payment_method_configuration_details + + # Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + attr_reader :payment_method_options + + # A list of the types of payment methods (e.g. card) this Checkout + # Session is allowed to accept. + attr_reader :payment_method_types + + # The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. + # You can use this value to decide when to fulfill your customer's order. + attr_reader :payment_status + + # This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. + # + # For specific permissions, please refer to their dedicated subsections, such as `permissions.update.shipping_details`. + attr_reader :permissions + + # Attribute for field phone_number_collection + attr_reader :phone_number_collection + + # The ID of the original expired Checkout Session that triggered the recovery flow. + attr_reader :recovered_from + + # This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. + attr_reader :redirect_on_completion + + # Applies to Checkout Sessions with `ui_mode: embedded` or `ui_mode: custom`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + attr_reader :return_url + + # Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + attr_reader :saved_payment_method_options + + # The ID of the SetupIntent for Checkout Sessions in `setup` mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. + attr_reader :setup_intent + + # When set, provides configuration for Checkout to collect a shipping address from a customer. + attr_reader :shipping_address_collection + + # The details of the customer cost of shipping, including the customer chosen ShippingRate. + attr_reader :shipping_cost + + # Shipping information for this Checkout Session. + attr_reader :shipping_details + + # The shipping rate options applied to this Session. + attr_reader :shipping_options + + # The status of the Checkout Session, one of `open`, `complete`, or `expired`. + attr_reader :status + + # Describes the type of transaction being performed by Checkout in order to customize + # relevant text on the page, such as the submit button. `submit_type` can only be + # specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. + attr_reader :submit_type + + # The ID of the subscription for Checkout Sessions in `subscription` mode. + attr_reader :subscription + + # The URL the customer will be directed to after the payment or + # subscription creation is successful. + attr_reader :success_url + + # Attribute for field tax_id_collection + attr_reader :tax_id_collection + + # Tax and discount details for the computed total amount. + attr_reader :total_details + + # The UI mode of the Session. Defaults to `hosted`. + attr_reader :ui_mode + + # The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it’ll use `checkout.stripe.com.` + # This value is only present when the session is active. + attr_reader :url + # Creates a Session object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/climate/order.rb b/lib/stripe/resources/climate/order.rb index f3b2b113a..2c9666363 100644 --- a/lib/stripe/resources/climate/order.rb +++ b/lib/stripe/resources/climate/order.rb @@ -15,6 +15,101 @@ def self.object_name "climate.order" end + class Beneficiary < Stripe::StripeObject + # Publicly displayable name for the end beneficiary of carbon removal. + attr_reader :public_name + end + + class DeliveryDetail < Stripe::StripeObject + class Location < Stripe::StripeObject + # The city where the supplier is located. + attr_reader :city + # Two-letter ISO code representing the country where the supplier is located. + attr_reader :country + # The geographic latitude where the supplier is located. + attr_reader :latitude + # The geographic longitude where the supplier is located. + attr_reader :longitude + # The state/county/province/region where the supplier is located. + attr_reader :region + end + # Time at which the delivery occurred. Measured in seconds since the Unix epoch. + attr_reader :delivered_at + # Specific location of this delivery. + attr_reader :location + # Quantity of carbon removal supplied by this delivery. + attr_reader :metric_tons + # Once retired, a URL to the registry entry for the tons from this delivery. + attr_reader :registry_url + # A supplier of carbon removal. + attr_reader :supplier + end + # Total amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit. + attr_reader :amount_fees + + # Total amount of the carbon removal in the currency's smallest unit. + attr_reader :amount_subtotal + + # Total amount of the order including fees in the currency's smallest unit. + attr_reader :amount_total + + # Attribute for field beneficiary + attr_reader :beneficiary + + # Time at which the order was canceled. Measured in seconds since the Unix epoch. + attr_reader :canceled_at + + # Reason for the cancellation of this order. + attr_reader :cancellation_reason + + # For delivered orders, a URL to a delivery certificate for the order. + attr_reader :certificate + + # Time at which the order was confirmed. Measured in seconds since the Unix epoch. + attr_reader :confirmed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order. + attr_reader :currency + + # Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch. + attr_reader :delayed_at + + # Time at which the order was delivered. Measured in seconds since the Unix epoch. + attr_reader :delivered_at + + # Details about the delivery of carbon removal for this order. + attr_reader :delivery_details + + # The year this order is expected to be delivered. + attr_reader :expected_delivery_year + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Quantity of carbon removal that is included in this order. + attr_reader :metric_tons + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Unique ID for the Climate `Product` this order is purchasing. + attr_reader :product + + # Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch. + attr_reader :product_substituted_at + + # The current status of this order. + attr_reader :status + # Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the # reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier # might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe diff --git a/lib/stripe/resources/climate/product.rb b/lib/stripe/resources/climate/product.rb index 9df7b0d8f..645a93f28 100644 --- a/lib/stripe/resources/climate/product.rb +++ b/lib/stripe/resources/climate/product.rb @@ -13,6 +13,43 @@ def self.object_name "climate.product" end + class CurrentPricesPerMetricTon < Stripe::StripeObject + # Fees for one metric ton of carbon removal in the currency's smallest unit. + attr_reader :amount_fees + # Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest unit. + attr_reader :amount_subtotal + # Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. + attr_reader :amount_total + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Current prices for a metric ton of carbon removal in a currency's smallest unit. + attr_reader :current_prices_per_metric_ton + + # The year in which the carbon removal is expected to be delivered. + attr_reader :delivery_year + + # Unique identifier for the object. For convenience, Climate product IDs are human-readable strings + # that start with `climsku_`. See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory) + # for a list of available carbon removal products. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The quantity of metric tons available for reservation. + attr_reader :metric_tons_available + + # The Climate product's name. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The carbon removal suppliers that fulfill orders for this Climate product. + attr_reader :suppliers + # Lists all available Climate product objects. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/climate/supplier.rb b/lib/stripe/resources/climate/supplier.rb index 8be95faac..5a31d18d4 100644 --- a/lib/stripe/resources/climate/supplier.rb +++ b/lib/stripe/resources/climate/supplier.rb @@ -12,6 +12,39 @@ def self.object_name "climate.supplier" end + class Location < Stripe::StripeObject + # The city where the supplier is located. + attr_reader :city + # Two-letter ISO code representing the country where the supplier is located. + attr_reader :country + # The geographic latitude where the supplier is located. + attr_reader :latitude + # The geographic longitude where the supplier is located. + attr_reader :longitude + # The state/county/province/region where the supplier is located. + attr_reader :region + end + # Unique identifier for the object. + attr_reader :id + + # Link to a webpage to learn more about the supplier. + attr_reader :info_url + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The locations in which this supplier operates. + attr_reader :locations + + # Name of this carbon removal supplier. + attr_reader :name + + # String representing the object’s type. Objects of the same type share the same value. + attr_reader :object + + # The scientific pathway used for carbon removal. + attr_reader :removal_pathway + # Lists all available Climate supplier objects. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/confirmation_token.rb b/lib/stripe/resources/confirmation_token.rb index bfda75f71..d5ff6896a 100644 --- a/lib/stripe/resources/confirmation_token.rb +++ b/lib/stripe/resources/confirmation_token.rb @@ -15,6 +15,853 @@ def self.object_name "confirmation_token" end + class MandateData < Stripe::StripeObject + class CustomerAcceptance < Stripe::StripeObject + class Online < Stripe::StripeObject + # The IP address from which the Mandate was accepted by the customer. + attr_reader :ip_address + # The user agent of the browser from which the Mandate was accepted by the customer. + attr_reader :user_agent + end + # If this is a Mandate accepted online, this hash contains details about the online acceptance. + attr_reader :online + # The type of customer acceptance information included with the Mandate. + attr_reader :type + end + # This hash contains details about the customer acceptance of the Mandate. + attr_reader :customer_acceptance + end + + class PaymentMethodOptions < Stripe::StripeObject + class Card < Stripe::StripeObject + # The `cvc_update` Token collected from the Payment Element. + attr_reader :cvc_token + end + # This hash contains the card payment method options. + attr_reader :card + end + + class PaymentMethodPreview < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Institution number of the bank account. + attr_reader :institution_number + # Last four digits of the bank account number. + attr_reader :last4 + # Transit number of the bank account. + attr_reader :transit_number + end + + class Affirm < Stripe::StripeObject; end + class AfterpayClearpay < Stripe::StripeObject; end + class Alipay < Stripe::StripeObject; end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + + class AuBecsDebit < Stripe::StripeObject + # Six-digit number identifying bank and branch associated with this bank account. + attr_reader :bsb_number + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + end + + class BacsDebit < Stripe::StripeObject + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # Sort code of the bank account. (e.g., `10-20-30`) + attr_reader :sort_code + end + + class Bancontact < Stripe::StripeObject; end + + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Billing address. + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + # Billing phone number (including extension). + attr_reader :phone + end + + class Blik < Stripe::StripeObject; end + + class Boleto < Stripe::StripeObject + # Uniquely identifies the customer tax id (CNPJ or CPF) + attr_reader :tax_id + end + + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :cvc_check + end + + class GeneratedFrom < Stripe::StripeObject + class PaymentMethodDetails < Stripe::StripeObject + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + attr_reader :type + end + + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + attr_reader :application_preferred_name + # Identifier for this transaction. + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + attr_reader :transaction_status_information + end + + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + attr_reader :type + end + # The authorized amount + attr_reader :amount_authorized + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + attr_reader :brand_product + # When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + attr_reader :capture_before + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Authorization response cryptogram. + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + attr_reader :incremental_authorization_supported + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + attr_reader :network_transaction_id + # Details about payments collected offline. + attr_reader :offline + # Defines whether the authorized amount can be over-captured or not + attr_reader :overcapture_supported + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + attr_reader :receipt + # Attribute for field wallet + attr_reader :wallet + end + # Attribute for field card_present + attr_reader :card_present + # The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. + attr_reader :type + end + # The charge that created this object. + attr_reader :charge + # Transaction-specific details of the payment method used in the payment. + attr_reader :payment_method_details + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + attr_reader :setup_attempt + end + + class Networks < Stripe::StripeObject + # All available networks for the card. + attr_reader :available + # The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + attr_reader :preferred + end + + class ThreeDSecureUsage < Stripe::StripeObject + # Whether 3D Secure is supported on this card. + attr_reader :supported + end + + class Wallet < Stripe::StripeObject + class AmexExpressCheckout < Stripe::StripeObject; end + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + + class Masterpass < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :shipping_address + end + + class SamsungPay < Stripe::StripeObject; end + + class VisaCheckout < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :shipping_address + end + # Attribute for field amex_express_checkout + attr_reader :amex_express_checkout + # Attribute for field apple_pay + attr_reader :apple_pay + # (For tokenized numbers only.) The last four digits of the device account number. + attr_reader :dynamic_last4 + # Attribute for field google_pay + attr_reader :google_pay + # Attribute for field link + attr_reader :link + # Attribute for field masterpass + attr_reader :masterpass + # Attribute for field samsung_pay + attr_reader :samsung_pay + # The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + attr_reader :type + # Attribute for field visa_checkout + attr_reader :visa_checkout + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # Checks on Card address and CVC if provided. + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + attr_reader :display_brand + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Details of the original PaymentMethod that created this object. + attr_reader :generated_from + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + attr_reader :networks + # Contains details on how this Card may be used for 3D Secure authentication. + attr_reader :three_d_secure_usage + # If this Card is part of a card wallet, this contains the details of the card wallet. + attr_reader :wallet + end + + class CardPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + attr_reader :available + # The preferred network for the card. + attr_reader :preferred + end + + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + attr_reader :type + end + + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + attr_reader :type + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + attr_reader :brand_product + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + attr_reader :networks + # Details about payment methods collected offline. + attr_reader :offline + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + # Attribute for field wallet + attr_reader :wallet + end + + class Cashapp < Stripe::StripeObject + # A unique and immutable identifier assigned by Cash App to every buyer. + attr_reader :buyer_id + # A public identifier for buyers using Cash App. + attr_reader :cashtag + end + + class CustomerBalance < Stripe::StripeObject; end + + class Eps < Stripe::StripeObject + # The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + attr_reader :bank + end + + class Fpx < Stripe::StripeObject + # Account holder type, if provided. Can be one of `individual` or `company`. + attr_reader :account_holder_type + # The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + attr_reader :bank + end + + class Giropay < Stripe::StripeObject; end + class Gopay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject; end + + class IdBankTransfer < Stripe::StripeObject + # Attribute for field bank + attr_reader :bank + # Attribute for field bank_code + attr_reader :bank_code + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field display_name + attr_reader :display_name + end + + class Ideal < Stripe::StripeObject + # The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + attr_reader :bank + # The Bank Identifier Code of the customer's bank, if the bank was provided. + attr_reader :bic + end + + class InteracPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + attr_reader :available + # The preferred network for the card. + attr_reader :preferred + end + # Card brand. Can be `interac`, `mastercard` or `visa`. + attr_reader :brand + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + attr_reader :networks + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + end + + class KakaoPay < Stripe::StripeObject; end + + class Klarna < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + attr_reader :day + # The month of birth, between 1 and 12. + attr_reader :month + # The four-digit year of birth. + attr_reader :year + end + # The customer's date of birth, if provided. + attr_reader :dob + end + + class Konbini < Stripe::StripeObject; end + + class KrCard < Stripe::StripeObject + # The local credit or debit card brand. + attr_reader :brand + # The last four digits of the card. This may not be present for American Express cards. + attr_reader :last4 + end + + class Link < Stripe::StripeObject + # Account owner's email address. + attr_reader :email + # [Deprecated] This is a legacy parameter that no longer has any function. + attr_reader :persistent_token + end + + class MbWay < Stripe::StripeObject; end + class Mobilepay < Stripe::StripeObject; end + class Multibanco < Stripe::StripeObject; end + + class NaverPay < Stripe::StripeObject + # Whether to fund this transaction with Naver Pay points or a card. + attr_reader :funding + end + + class Oxxo < Stripe::StripeObject; end + + class P24 < Stripe::StripeObject + # The customer's bank, if provided. + attr_reader :bank + end + + class Payco < Stripe::StripeObject; end + class Paynow < Stripe::StripeObject; end + + class Paypal < Stripe::StripeObject + # Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + attr_reader :fingerprint + # Owner's email. Values are provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :payer_email + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + attr_reader :payer_id + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_email + end + + class Payto < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + attr_reader :bsb_number + # Last four digits of the bank account number. + attr_reader :last4 + # The PayID alias for the bank account. + attr_reader :pay_id + end + + class Pix < Stripe::StripeObject; end + class Promptpay < Stripe::StripeObject; end + class Qris < Stripe::StripeObject; end + + class Rechnung < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + attr_reader :day + # The month of birth, between 1 and 12. + attr_reader :month + # The four-digit year of birth. + attr_reader :year + end + # Attribute for field dob + attr_reader :dob + end + + class RevolutPay < Stripe::StripeObject; end + class SamsungPay < Stripe::StripeObject; end + + class SepaDebit < Stripe::StripeObject + class GeneratedFrom < Stripe::StripeObject + # The ID of the Charge that generated this PaymentMethod, if any. + attr_reader :charge + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + attr_reader :setup_attempt + end + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Branch code of bank associated with the bank account. + attr_reader :branch_code + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Information about the object that generated this PaymentMethod. + attr_reader :generated_from + # Last four characters of the IBAN. + attr_reader :last4 + end + + class Shopeepay < Stripe::StripeObject; end + + class Sofort < Stripe::StripeObject + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + end + + class Swish < Stripe::StripeObject; end + class Twint < Stripe::StripeObject; end + + class UsBankAccount < Stripe::StripeObject + class Networks < Stripe::StripeObject + # The preferred network. + attr_reader :preferred + # All supported networks. + attr_reader :supported + end + + class StatusDetails < Stripe::StripeObject + class Blocked < Stripe::StripeObject + # The ACH network code that resulted in this block. + attr_reader :network_code + # The reason why this PaymentMethod's fingerprint has been blocked + attr_reader :reason + end + # Attribute for field blocked + attr_reader :blocked + end + # Account holder type: individual or company. + attr_reader :account_holder_type + # Account number of the bank account. + attr_reader :account_number + # Account type: checkings or savings. Defaults to checking if omitted. + attr_reader :account_type + # The name of the bank. + attr_reader :bank_name + # The ID of the Financial Connections Account used to create the payment method. + attr_reader :financial_connections_account + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # Contains information about US bank account networks that can be used. + attr_reader :networks + # Routing number of the bank account. + attr_reader :routing_number + # Contains information about the future reusability of this PaymentMethod. + attr_reader :status_details + end + + class WechatPay < Stripe::StripeObject; end + class Zip < Stripe::StripeObject; end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field affirm + attr_reader :affirm + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + # Attribute for field alipay + attr_reader :alipay + # This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + attr_reader :allow_redisplay + # Attribute for field alma + attr_reader :alma + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field bancontact + attr_reader :bancontact + # Attribute for field billing_details + attr_reader :billing_details + # Attribute for field blik + attr_reader :blik + # Attribute for field boleto + attr_reader :boleto + # Attribute for field card + attr_reader :card + # Attribute for field card_present + attr_reader :card_present + # Attribute for field cashapp + attr_reader :cashapp + # The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + attr_reader :customer + # Attribute for field customer_balance + attr_reader :customer_balance + # Attribute for field eps + attr_reader :eps + # Attribute for field fpx + attr_reader :fpx + # Attribute for field giropay + attr_reader :giropay + # Attribute for field gopay + attr_reader :gopay + # Attribute for field grabpay + attr_reader :grabpay + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + # Attribute for field ideal + attr_reader :ideal + # Attribute for field interac_present + attr_reader :interac_present + # Attribute for field kakao_pay + attr_reader :kakao_pay + # Attribute for field klarna + attr_reader :klarna + # Attribute for field konbini + attr_reader :konbini + # Attribute for field kr_card + attr_reader :kr_card + # Attribute for field link + attr_reader :link + # Attribute for field mb_way + attr_reader :mb_way + # Attribute for field mobilepay + attr_reader :mobilepay + # Attribute for field multibanco + attr_reader :multibanco + # Attribute for field naver_pay + attr_reader :naver_pay + # Attribute for field oxxo + attr_reader :oxxo + # Attribute for field p24 + attr_reader :p24 + # Attribute for field payco + attr_reader :payco + # Attribute for field paynow + attr_reader :paynow + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field pix + attr_reader :pix + # Attribute for field promptpay + attr_reader :promptpay + # Attribute for field qris + attr_reader :qris + # Attribute for field rechnung + attr_reader :rechnung + # Attribute for field revolut_pay + attr_reader :revolut_pay + # Attribute for field samsung_pay + attr_reader :samsung_pay + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field shopeepay + attr_reader :shopeepay + # Attribute for field sofort + attr_reader :sofort + # Attribute for field swish + attr_reader :swish + # Attribute for field twint + attr_reader :twint + # The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + # Attribute for field wechat_pay + attr_reader :wechat_pay + # Attribute for field zip + attr_reader :zip + end + + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. + attr_reader :expires_at + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Data used for generating a Mandate. + attr_reader :mandate_data + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + attr_reader :payment_intent + + # Payment-method-specific configuration for this ConfirmationToken. + attr_reader :payment_method_options + + # Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + attr_reader :payment_method_preview + + # Return URL used to confirm the Intent. + attr_reader :return_url + + # Indicates that you intend to make future payments with this ConfirmationToken's payment method. + # + # The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + attr_reader :setup_future_usage + + # ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + attr_reader :setup_intent + + # Shipping information collected on this ConfirmationToken. + attr_reader :shipping + + # Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to `true` on ConfirmationToken. + attr_reader :use_stripe_sdk + def test_helpers TestHelpers.new(self) end diff --git a/lib/stripe/resources/connect_collection_transfer.rb b/lib/stripe/resources/connect_collection_transfer.rb new file mode 100644 index 000000000..9d7758899 --- /dev/null +++ b/lib/stripe/resources/connect_collection_transfer.rb @@ -0,0 +1,29 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class ConnectCollectionTransfer < APIResource + OBJECT_NAME = "connect_collection_transfer" + def self.object_name + "connect_collection_transfer" + end + + # Amount transferred, in cents (or local equivalent). + attr_reader :amount + + # 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). + attr_reader :currency + + # ID of the account that funds are being collected for. + attr_reader :destination + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + end +end diff --git a/lib/stripe/resources/country_spec.rb b/lib/stripe/resources/country_spec.rb index 75582f143..9ad1cde9e 100644 --- a/lib/stripe/resources/country_spec.rb +++ b/lib/stripe/resources/country_spec.rb @@ -16,6 +16,49 @@ def self.object_name "country_spec" end + class VerificationFields < Stripe::StripeObject + class Company < Stripe::StripeObject + # Additional fields which are only required for some users. + attr_reader :additional + # Fields which every account must eventually provide. + attr_reader :minimum + end + + class Individual < Stripe::StripeObject + # Additional fields which are only required for some users. + attr_reader :additional + # Fields which every account must eventually provide. + attr_reader :minimum + end + # Attribute for field company + attr_reader :company + # Attribute for field individual + attr_reader :individual + end + # The default currency for this country. This applies to both payment methods and bank accounts. + attr_reader :default_currency + + # Unique identifier for the object. Represented as the ISO country code for this country. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Currencies that can be accepted in the specific country (for transfers). + attr_reader :supported_bank_account_currencies + + # Currencies that can be accepted in the specified country (for payments). + attr_reader :supported_payment_currencies + + # Payment methods available in the specified country. You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). + attr_reader :supported_payment_methods + + # Countries that can accept transfers from the specified country. + attr_reader :supported_transfer_countries + + # Attribute for field verification_fields + attr_reader :verification_fields + # Lists all Country Spec objects available in the API. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/country_specs", params: filters, opts: opts) diff --git a/lib/stripe/resources/coupon.rb b/lib/stripe/resources/coupon.rb index 0d83d68b7..b58644a72 100644 --- a/lib/stripe/resources/coupon.rb +++ b/lib/stripe/resources/coupon.rb @@ -16,6 +16,69 @@ def self.object_name "coupon" end + class AppliesTo < Stripe::StripeObject + # A list of product IDs this coupon applies to + attr_reader :products + end + + class CurrencyOptions < Stripe::StripeObject + # Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + attr_reader :amount_off + end + # Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + attr_reader :amount_off + + # Attribute for field applies_to + attr_reader :applies_to + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. + attr_reader :currency + + # Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + attr_reader :currency_options + + # One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. + attr_reader :duration + + # If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. + attr_reader :duration_in_months + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + attr_reader :max_redemptions + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Name of the coupon displayed to customers on for instance invoices or receipts. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. + attr_reader :percent_off + + # Date after which the coupon can no longer be redeemed. + attr_reader :redeem_by + + # Number of times this coupon has been applied to a customer. + attr_reader :times_redeemed + + # Taking account of the above properties, whether this coupon can still be applied to a customer. + attr_reader :valid + + # Always true for a deleted object + attr_reader :deleted + # You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. # # A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. diff --git a/lib/stripe/resources/credit_note.rb b/lib/stripe/resources/credit_note.rb index 25737f796..fe02be889 100644 --- a/lib/stripe/resources/credit_note.rb +++ b/lib/stripe/resources/credit_note.rb @@ -15,6 +15,170 @@ def self.object_name "credit_note" end + class DiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + attr_reader :amount + # The discount that was applied to get this discount amount. + attr_reader :discount + end + + class PretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + attr_reader :discount + # Type of the pretax credit amount referenced. + attr_reader :type + end + + class Refund < Stripe::StripeObject + # Amount of the refund that applies to this credit note, in cents (or local equivalent). + attr_reader :amount_refunded + # ID of the refund. + attr_reader :refund + end + + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # Total shipping cost before any taxes are applied. + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + attr_reader :amount_tax + # Total shipping cost after taxes are applied. + attr_reader :amount_total + # The ID of the ShippingRate for this invoice. + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + attr_reader :taxes + end + + class TaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. + attr_reader :amount + + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # ID of the customer. + attr_reader :customer + + # Customer balance transaction related to this credit note. + attr_reader :customer_balance_transaction + + # The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. + attr_reader :discount_amount + + # The aggregate amounts calculated per discount for all line items. + attr_reader :discount_amounts + + # The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + attr_reader :effective_at + + # Unique identifier for the object. + attr_reader :id + + # ID of the invoice. + attr_reader :invoice + + # Line items that make up the credit note + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Customer-facing text that appears on the credit note PDF. + attr_reader :memo + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Amount that was credited outside of Stripe. + attr_reader :out_of_band_amount + + # The link to download the PDF of the credit note. + attr_reader :pdf + + # Attribute for field post_payment_amount + attr_reader :post_payment_amount + + # Attribute for field pre_payment_amount + attr_reader :pre_payment_amount + + # The pretax credit amounts (ex: discount, credit grants, etc) for all line items. + attr_reader :pretax_credit_amounts + + # Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` + attr_reader :reason + + # Refund related to this credit note. + attr_reader :refund + + # Refunds related to this credit note. + attr_reader :refunds + + # The details of the cost of shipping, including the ShippingRate applied to the invoice. + attr_reader :shipping_cost + + # Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + attr_reader :status + + # The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. + attr_reader :subtotal + + # The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. + attr_reader :subtotal_excluding_tax + + # The aggregate amounts calculated per tax rate for all line items. + attr_reader :tax_amounts + + # The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. + attr_reader :total + + # The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. + attr_reader :total_excluding_tax + + # Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. + attr_reader :type + + # The time that the credit note was voided. + attr_reader :voided_at + # Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces # its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result # in any combination of the following: diff --git a/lib/stripe/resources/credit_note_line_item.rb b/lib/stripe/resources/credit_note_line_item.rb index 8782c90ff..07110e212 100644 --- a/lib/stripe/resources/credit_note_line_item.rb +++ b/lib/stripe/resources/credit_note_line_item.rb @@ -8,5 +8,86 @@ class CreditNoteLineItem < StripeObject def self.object_name "credit_note_line_item" end + + class DiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + attr_reader :amount + # The discount that was applied to get this discount amount. + attr_reader :discount + end + + class PretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + attr_reader :discount + # Type of the pretax credit amount referenced. + attr_reader :type + end + + class TaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + attr_reader :amount + + # The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. + attr_reader :amount_excluding_tax + + # Description of the item being credited. + attr_reader :description + + # The integer amount in cents (or local equivalent) representing the discount being credited for this line item. + attr_reader :discount_amount + + # The amount of discount calculated per discount for this line item + attr_reader :discount_amounts + + # Unique identifier for the object. + attr_reader :id + + # ID of the invoice line item being credited + attr_reader :invoice_line_item + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The pretax credit amounts (ex: discount, credit grants, etc) for this line item. + attr_reader :pretax_credit_amounts + + # The number of units of product being credited. + attr_reader :quantity + + # The amount of tax calculated per tax rate for this line item + attr_reader :tax_amounts + + # The tax rates which apply to the line item. + attr_reader :tax_rates + + # The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. + attr_reader :type + + # The cost of each unit of product being credited. + attr_reader :unit_amount + + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :unit_amount_decimal + + # The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. + attr_reader :unit_amount_excluding_tax end end diff --git a/lib/stripe/resources/customer.rb b/lib/stripe/resources/customer.rb index 42c5a6b1f..f24a9e361 100644 --- a/lib/stripe/resources/customer.rb +++ b/lib/stripe/resources/customer.rb @@ -22,6 +22,181 @@ def self.object_name nested_resource_class_methods :source, operations: %i[create retrieve update delete list] nested_resource_class_methods :tax_id, operations: %i[create retrieve delete list] + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class InvoiceSettings < Stripe::StripeObject + class CustomField < Stripe::StripeObject + # The name of the custom field. + attr_reader :name + # The value of the custom field. + attr_reader :value + end + + class RenderingOptions < Stripe::StripeObject + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + attr_reader :amount_tax_display + # ID of the invoice rendering template to be used for this customer's invoices. If set, the template will be used on all invoices for this customer unless a template is set directly on the invoice. + attr_reader :template + end + # Default custom fields to be displayed on invoices for this customer. + attr_reader :custom_fields + # ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + attr_reader :default_payment_method + # Default footer to be displayed on invoices for this customer. + attr_reader :footer + # Default options for invoice PDF rendering for this customer. + attr_reader :rendering_options + end + + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class Tax < Stripe::StripeObject + class Location < Stripe::StripeObject + # The customer's country as identified by Stripe Tax. + attr_reader :country + # The data source used to infer the customer's location. + attr_reader :source + # The customer's state, county, province, or region as identified by Stripe Tax. + attr_reader :state + end + # Surfaces if automatic tax computation is possible given the current customer location information. + attr_reader :automatic_tax + # A recent IP address of the customer used for tax reporting and tax location inference. + attr_reader :ip_address + # The customer's location as identified by Stripe Tax. + attr_reader :location + end + # The customer's address. + attr_reader :address + + # The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. + attr_reader :balance + + # The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. + attr_reader :cash_balance + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. + attr_reader :currency + + # ID of the default payment source for the customer. + # + # If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. + attr_reader :default_source + + # Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. + # + # If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. + # + # If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`. + attr_reader :delinquent + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Describes the current discount active on the customer, if there is one. + attr_reader :discount + + # The customer's email address. + attr_reader :email + + # Unique identifier for the object. + attr_reader :id + + # The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. + attr_reader :invoice_credit_balance + + # The prefix for the customer used to generate unique invoice numbers. + attr_reader :invoice_prefix + + # Attribute for field invoice_settings + attr_reader :invoice_settings + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The customer's full name or business name. + attr_reader :name + + # The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. + attr_reader :next_invoice_sequence + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The customer's phone number. + attr_reader :phone + + # The customer's preferred locales (languages), ordered by preference. + attr_reader :preferred_locales + + # Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + attr_reader :shipping + + # The customer's payment sources, if any. + attr_reader :sources + + # The customer's current subscriptions, if any. + attr_reader :subscriptions + + # Attribute for field tax + attr_reader :tax + + # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. + attr_reader :tax_exempt + + # The customer's tax IDs. + attr_reader :tax_ids + + # ID of the test clock that this customer belongs to. + attr_reader :test_clock + + # Always true for a deleted object + attr_reader :deleted + # Creates a new customer object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/customers", params: params, opts: opts) diff --git a/lib/stripe/resources/customer_balance_transaction.rb b/lib/stripe/resources/customer_balance_transaction.rb index b72efd039..bb812dd43 100644 --- a/lib/stripe/resources/customer_balance_transaction.rb +++ b/lib/stripe/resources/customer_balance_transaction.rb @@ -16,6 +16,45 @@ def self.object_name "customer_balance_transaction" end + # The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The ID of the credit note (if any) related to the transaction. + attr_reader :credit_note + + # 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). + attr_reader :currency + + # The ID of the customer the transaction belongs to. + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # The customer's `balance` after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. + attr_reader :ending_balance + + # Unique identifier for the object. + attr_reader :id + + # The ID of the invoice (if any) related to the transaction. + attr_reader :invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. + attr_reader :type + def resource_url if !respond_to?(:customer) || customer.nil? raise NotImplementedError, diff --git a/lib/stripe/resources/customer_cash_balance_transaction.rb b/lib/stripe/resources/customer_cash_balance_transaction.rb index 3d072e914..94c991734 100644 --- a/lib/stripe/resources/customer_cash_balance_transaction.rb +++ b/lib/stripe/resources/customer_cash_balance_transaction.rb @@ -11,5 +11,128 @@ class CustomerCashBalanceTransaction < APIResource def self.object_name "customer_cash_balance_transaction" end + + class AdjustedForOverdraft < Stripe::StripeObject + # The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. + attr_reader :balance_transaction + # The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. + attr_reader :linked_transaction + end + + class AppliedToPayment < Stripe::StripeObject + # The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. + attr_reader :payment_intent + end + + class Funded < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The BIC of the bank of the sender of the funding. + attr_reader :bic + # The last 4 digits of the IBAN of the sender of the funding. + attr_reader :iban_last4 + # The full name of the sender, as supplied by the sending bank. + attr_reader :sender_name + end + + class GbBankTransfer < Stripe::StripeObject + # The last 4 digits of the account number of the sender of the funding. + attr_reader :account_number_last4 + # The full name of the sender, as supplied by the sending bank. + attr_reader :sender_name + # The sort code of the bank of the sender of the funding + attr_reader :sort_code + end + + class JpBankTransfer < Stripe::StripeObject + # The name of the bank of the sender of the funding. + attr_reader :sender_bank + # The name of the bank branch of the sender of the funding. + attr_reader :sender_branch + # The full name of the sender, as supplied by the sending bank. + attr_reader :sender_name + end + + class UsBankTransfer < Stripe::StripeObject + # The banking network used for this funding. + attr_reader :network + # The full name of the sender, as supplied by the sending bank. + attr_reader :sender_name + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # Attribute for field gb_bank_transfer + attr_reader :gb_bank_transfer + # Attribute for field jp_bank_transfer + attr_reader :jp_bank_transfer + # The user-supplied reference field on the bank transfer. + attr_reader :reference + # The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + # Attribute for field us_bank_transfer + attr_reader :us_bank_transfer + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + end + + class RefundedFromPayment < Stripe::StripeObject + # The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. + attr_reader :refund + end + + class TransferredToBalance < Stripe::StripeObject + # The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. + attr_reader :balance_transaction + end + + class UnappliedFromPayment < Stripe::StripeObject + # The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. + attr_reader :payment_intent + end + # Attribute for field adjusted_for_overdraft + attr_reader :adjusted_for_overdraft + + # Attribute for field applied_to_payment + attr_reader :applied_to_payment + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # The customer whose available cash balance changed as a result of this transaction. + attr_reader :customer + + # The total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :ending_balance + + # Attribute for field funded + attr_reader :funded + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. + attr_reader :net_amount + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field refunded_from_payment + attr_reader :refunded_from_payment + + # Attribute for field transferred_to_balance + attr_reader :transferred_to_balance + + # The type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. + attr_reader :type + + # Attribute for field unapplied_from_payment + attr_reader :unapplied_from_payment end end diff --git a/lib/stripe/resources/customer_session.rb b/lib/stripe/resources/customer_session.rb index b6af08c28..513bd9ace 100644 --- a/lib/stripe/resources/customer_session.rb +++ b/lib/stripe/resources/customer_session.rb @@ -16,6 +16,75 @@ def self.object_name "customer_session" end + class Components < Stripe::StripeObject + class BuyButton < Stripe::StripeObject + # Whether the buy button is enabled. + attr_reader :enabled + end + + class PaymentElement < Stripe::StripeObject + class Features < Stripe::StripeObject + # A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + # + # If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + attr_reader :payment_method_allow_redisplay_filters + # Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + attr_reader :payment_method_redisplay + # Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + attr_reader :payment_method_redisplay_limit + # Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + # + # Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + attr_reader :payment_method_remove + # Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + # + # If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + attr_reader :payment_method_save + # When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + # + # When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + attr_reader :payment_method_save_usage + end + # Whether the Payment Element is enabled. + attr_reader :enabled + # This hash defines whether the Payment Element supports certain features. + attr_reader :features + end + + class PricingTable < Stripe::StripeObject + # Whether the pricing table is enabled. + attr_reader :enabled + end + # This hash contains whether the buy button is enabled. + attr_reader :buy_button + # This hash contains whether the Payment Element is enabled and the features it supports. + attr_reader :payment_element + # This hash contains whether the pricing table is enabled. + attr_reader :pricing_table + end + # The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`. + # + # The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. + attr_reader :client_secret + + # Configuration for the components supported by this Customer Session. + attr_reader :components + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The Customer the Customer Session was created for. + attr_reader :customer + + # The timestamp at which this Customer Session will expire. + attr_reader :expires_at + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + # Creates a Customer Session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/discount.rb b/lib/stripe/resources/discount.rb index e0278cd3b..ed9af3c6e 100644 --- a/lib/stripe/resources/discount.rb +++ b/lib/stripe/resources/discount.rb @@ -11,5 +11,46 @@ class Discount < StripeObject def self.object_name "discount" end + + # The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode. + attr_reader :checkout_session + + # A coupon contains information about a percent-off or amount-off discount you + # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). + attr_reader :coupon + + # The ID of the customer associated with this discount. + attr_reader :customer + + # If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. + attr_reader :end + + # The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array. + attr_reader :id + + # The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. + attr_reader :invoice + + # The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. + attr_reader :invoice_item + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The promotion code applied to create this discount. + attr_reader :promotion_code + + # Date that the coupon was applied. + attr_reader :start + + # The subscription that this coupon is applied to, if it is applied to a particular subscription. + attr_reader :subscription + + # The subscription item that this coupon is applied to, if it is applied to a particular subscription item. + attr_reader :subscription_item + + # Always true for a deleted object + attr_reader :deleted end end diff --git a/lib/stripe/resources/dispute.rb b/lib/stripe/resources/dispute.rb index ee34198c2..07de5aeb1 100644 --- a/lib/stripe/resources/dispute.rb +++ b/lib/stripe/resources/dispute.rb @@ -16,6 +16,254 @@ def self.object_name "dispute" end + class Evidence < Stripe::StripeObject + class EnhancedEvidence < Stripe::StripeObject + class VisaCompellingEvidence3 < Stripe::StripeObject + class DisputedTransaction < Stripe::StripeObject + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # User Account ID used to log into business platform. Must be recognizable by the user. + attr_reader :customer_account_id + # Unique identifier of the cardholder’s device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + attr_reader :customer_device_fingerprint + # Unique identifier of the cardholder’s device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + attr_reader :customer_device_id + # The email address of the customer. + attr_reader :customer_email_address + # The IP address that the customer used when making the purchase. + attr_reader :customer_purchase_ip + # Categorization of disputed payment. + attr_reader :merchandise_or_services + # A description of the product or service that was sold. + attr_reader :product_description + # The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + attr_reader :shipping_address + end + + class PriorUndisputedTransaction < Stripe::StripeObject + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Stripe charge ID for the Visa Compelling Evidence 3.0 eligible prior charge. + attr_reader :charge + # User Account ID used to log into business platform. Must be recognizable by the user. + attr_reader :customer_account_id + # Unique identifier of the cardholder’s device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + attr_reader :customer_device_fingerprint + # Unique identifier of the cardholder’s device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + attr_reader :customer_device_id + # The email address of the customer. + attr_reader :customer_email_address + # The IP address that the customer used when making the purchase. + attr_reader :customer_purchase_ip + # A description of the product or service that was sold. + attr_reader :product_description + # The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + attr_reader :shipping_address + end + # Disputed transaction details for Visa Compelling Evidence 3.0 evidence submission. + attr_reader :disputed_transaction + # List of exactly two prior undisputed transaction objects for Visa Compelling Evidence 3.0 evidence submission. + attr_reader :prior_undisputed_transactions + end + # Attribute for field visa_compelling_evidence_3 + attr_reader :visa_compelling_evidence_3 + end + # Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. + attr_reader :access_activity_log + # The billing address provided by the customer. + attr_reader :billing_address + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + attr_reader :cancellation_policy + # An explanation of how and when the customer was shown your refund policy prior to purchase. + attr_reader :cancellation_policy_disclosure + # A justification for why the customer's subscription was not canceled. + attr_reader :cancellation_rebuttal + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + attr_reader :customer_communication + # The email address of the customer. + attr_reader :customer_email_address + # The name of the customer. + attr_reader :customer_name + # The IP address that the customer used when making the purchase. + attr_reader :customer_purchase_ip + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + attr_reader :customer_signature + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + attr_reader :duplicate_charge_documentation + # An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. + attr_reader :duplicate_charge_explanation + # The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + attr_reader :duplicate_charge_id + # Attribute for field enhanced_evidence + attr_reader :enhanced_evidence + # A description of the product or service that was sold. + attr_reader :product_description + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + attr_reader :receipt + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + attr_reader :refund_policy + # Documentation demonstrating that the customer was shown your refund policy prior to purchase. + attr_reader :refund_policy_disclosure + # A justification for why the customer is not entitled to a refund. + attr_reader :refund_refusal_explanation + # The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + attr_reader :service_date + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. + attr_reader :service_documentation + # The address to which a physical product was shipped. You should try to include as complete address information as possible. + attr_reader :shipping_address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. + attr_reader :shipping_carrier + # The date on which a physical product began its route to the shipping address, in a clear human-readable format. + attr_reader :shipping_date + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. + attr_reader :shipping_documentation + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :shipping_tracking_number + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + attr_reader :uncategorized_file + # Any additional evidence or statements. + attr_reader :uncategorized_text + end + + class EvidenceDetails < Stripe::StripeObject + class EnhancedEligibility < Stripe::StripeObject + class VisaCompellingEvidence3 < Stripe::StripeObject + # List of actions required to qualify dispute for Visa Compelling Evidence 3.0 evidence submission. + attr_reader :required_actions + # Visa Compelling Evidence 3.0 eligibility status. + attr_reader :status + end + # Attribute for field visa_compelling_evidence_3 + attr_reader :visa_compelling_evidence_3 + end + # Date by which evidence must be submitted in order to successfully challenge dispute. Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. + attr_reader :due_by + # Attribute for field enhanced_eligibility + attr_reader :enhanced_eligibility + # Whether evidence has been staged for this dispute. + attr_reader :has_evidence + # Whether the last evidence submission was submitted past the due date. Defaults to `false` if no evidence submissions have occurred. If `true`, then delivery of the latest evidence is *not* guaranteed. + attr_reader :past_due + # The number of times evidence has been submitted. Typically, you may only submit evidence once. + attr_reader :submission_count + end + + class PaymentMethodDetails < Stripe::StripeObject + class AmazonPay < Stripe::StripeObject + # The AmazonPay dispute type, chargeback or claim + attr_reader :dispute_type + end + + class Card < Stripe::StripeObject + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # The type of dispute opened. Different case types may have varying fees and financial impact. + attr_reader :case_type + # The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. + attr_reader :network_reason_code + end + + class Klarna < Stripe::StripeObject + # The reason for the dispute as defined by Klarna + attr_reader :reason_code + end + + class Paypal < Stripe::StripeObject + # The ID of the dispute in PayPal. + attr_reader :case_id + # The reason for the dispute as defined by PayPal + attr_reader :reason_code + end + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field card + attr_reader :card + # Attribute for field klarna + attr_reader :klarna + # Attribute for field paypal + attr_reader :paypal + # Payment method type. + attr_reader :type + end + # Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). + attr_reader :amount + + # List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + attr_reader :balance_transactions + + # ID of the charge that's disputed. + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # List of eligibility types that are included in `enhanced_evidence`. + attr_reader :enhanced_eligibility_types + + # Attribute for field evidence + attr_reader :evidence + + # Attribute for field evidence_details + attr_reader :evidence_details + + # Unique identifier for the object. + attr_reader :id + + # If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. + attr_reader :is_charge_refundable + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Network-dependent reason code for the dispute. + attr_reader :network_reason_code + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the PaymentIntent that's disputed. + attr_reader :payment_intent + + # Attribute for field payment_method_details + attr_reader :payment_method_details + + # Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). + attr_reader :reason + + # Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. + attr_reader :status + # Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. # # The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. diff --git a/lib/stripe/resources/entitlements/active_entitlement.rb b/lib/stripe/resources/entitlements/active_entitlement.rb index 6454e399e..abb05c3b8 100644 --- a/lib/stripe/resources/entitlements/active_entitlement.rb +++ b/lib/stripe/resources/entitlements/active_entitlement.rb @@ -12,6 +12,21 @@ def self.object_name "entitlements.active_entitlement" end + # The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. + attr_reader :feature + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # A unique key you provide as your own system identifier. This may be up to 80 characters. + attr_reader :lookup_key + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + # Retrieve a list of active entitlements for a customer def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/entitlements/active_entitlement_summary.rb b/lib/stripe/resources/entitlements/active_entitlement_summary.rb new file mode 100644 index 000000000..2680c7c3f --- /dev/null +++ b/lib/stripe/resources/entitlements/active_entitlement_summary.rb @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Entitlements + # A summary of a customer's active entitlements. + class ActiveEntitlementSummary < APIResource + OBJECT_NAME = "entitlements.active_entitlement_summary" + def self.object_name + "entitlements.active_entitlement_summary" + end + + # The customer that is entitled to this feature. + attr_reader :customer + + # The list of entitlements this customer has. + attr_reader :entitlements + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + end + end +end diff --git a/lib/stripe/resources/entitlements/feature.rb b/lib/stripe/resources/entitlements/feature.rb index 722d33a42..023acb2a9 100644 --- a/lib/stripe/resources/entitlements/feature.rb +++ b/lib/stripe/resources/entitlements/feature.rb @@ -15,6 +15,27 @@ def self.object_name "entitlements.feature" end + # Inactive features cannot be attached to new products and will not be returned from the features list endpoint. + attr_reader :active + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # A unique key you provide as your own system identifier. This may be up to 80 characters. + attr_reader :lookup_key + + # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The feature's name, for your own purpose, not meant to be displayable to the customer. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + # Creates a feature def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/ephemeral_key.rb b/lib/stripe/resources/ephemeral_key.rb index c2115b2fa..baff0304d 100644 --- a/lib/stripe/resources/ephemeral_key.rb +++ b/lib/stripe/resources/ephemeral_key.rb @@ -11,6 +11,24 @@ def self.object_name "ephemeral_key" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Time at which the key will expire. Measured in seconds since the Unix epoch. + attr_reader :expires + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The key's secret. You can use this value to make authorized requests to the Stripe API. + attr_reader :secret + # Invalidates a short-lived API key for a given resource. def self.delete(id, params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/event.rb b/lib/stripe/resources/event.rb index d2628ef5a..b96f88161 100644 --- a/lib/stripe/resources/event.rb +++ b/lib/stripe/resources/event.rb @@ -40,6 +40,81 @@ def self.object_name "event" end + class Data < Stripe::StripeObject + # Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. + attr_reader :object + # Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). If an array attribute has any updated elements, this object contains the entire array. In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. + attr_reader :previous_attributes + end + + class Reason < Stripe::StripeObject + class AutomationAction < Stripe::StripeObject + class StripeSendWebhookCustomEvent < Stripe::StripeObject + # Set of key-value pairs attached to the action when creating an Automation. + attr_reader :custom_data + end + # Attribute for field stripe_send_webhook_custom_event + attr_reader :stripe_send_webhook_custom_event + # The trigger name of the automation that triggered this action. + # Please visit [Revenue and retention automations](https://docs.stripe.com/billing/automations#choose-a-trigger) for all possible trigger names. + attr_reader :trigger + # The type of the `automation_action`. + attr_reader :type + end + + class Request < Stripe::StripeObject + # ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + attr_reader :id + # The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*. + attr_reader :idempotency_key + end + # Attribute for field automation_action + attr_reader :automation_action + # Attribute for field request + attr_reader :request + # The type of the reason for the event. + attr_reader :type + end + + class Request < Stripe::StripeObject + # ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + attr_reader :id + # The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*. + attr_reader :idempotency_key + end + # The connected account that originates the event. + attr_reader :account + + # The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014. + attr_reader :api_version + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Attribute for field data + attr_reader :data + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. + attr_reader :pending_webhooks + + # Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://docs.stripe.com/billing/automations) action. + attr_reader :reason + + # Information on the API request that triggers the event. + attr_reader :request + + # Description of the event (for example, `invoice.created` or `charge.refunded`). + attr_reader :type + # List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/events", params: filters, opts: opts) diff --git a/lib/stripe/resources/exchange_rate.rb b/lib/stripe/resources/exchange_rate.rb index b2bc7c3c5..89875999e 100644 --- a/lib/stripe/resources/exchange_rate.rb +++ b/lib/stripe/resources/exchange_rate.rb @@ -36,6 +36,15 @@ def self.object_name "exchange_rate" end + # Unique identifier for the object. Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + attr_reader :rates + # Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/exchange_rates", params: filters, opts: opts) diff --git a/lib/stripe/resources/file.rb b/lib/stripe/resources/file.rb index ced211941..a713d0d58 100644 --- a/lib/stripe/resources/file.rb +++ b/lib/stripe/resources/file.rb @@ -18,6 +18,39 @@ def self.object_name "file" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The file expires and isn't available at this time in epoch seconds. + attr_reader :expires_at + + # The suitable name for saving the file to a filesystem. + attr_reader :filename + + # Unique identifier for the object. + attr_reader :id + + # A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. + attr_reader :links + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. + attr_reader :purpose + + # The size of the file object in bytes. + attr_reader :size + + # A suitable title for the document. + attr_reader :title + + # The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). + attr_reader :type + + # Use your live secret API key to download the file from this URL. + attr_reader :url + # To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. # # All of Stripe's officially supported Client libraries support sending multipart/form-data. diff --git a/lib/stripe/resources/file_link.rb b/lib/stripe/resources/file_link.rb index 1a31bf2eb..eb187b8c1 100644 --- a/lib/stripe/resources/file_link.rb +++ b/lib/stripe/resources/file_link.rb @@ -15,6 +15,33 @@ def self.object_name "file_link" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Returns if the link is already expired. + attr_reader :expired + + # Time that the link expires. + attr_reader :expires_at + + # The file object this link points to. + attr_reader :file + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The publicly accessible URL to download the file. + attr_reader :url + # Creates a new file link object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/file_links", params: params, opts: opts) diff --git a/lib/stripe/resources/financial_connections/account.rb b/lib/stripe/resources/financial_connections/account.rb index 28fe52c06..e54110cae 100644 --- a/lib/stripe/resources/financial_connections/account.rb +++ b/lib/stripe/resources/financial_connections/account.rb @@ -15,6 +15,159 @@ def self.object_name nested_resource_class_methods :inferred_balance, operations: %i[list] + class AccountHolder < Stripe::StripeObject + # The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. + attr_reader :account + # ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. + attr_reader :customer + # Type of account holder that this account belongs to. + attr_reader :type + end + + class Balance < Stripe::StripeObject + class Cash < Stripe::StripeObject + # The funds available to the account holder. Typically this is the current balance after subtracting any outbound pending transactions and adding any inbound pending transactions. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + attr_reader :available + end + + class Credit < Stripe::StripeObject + # The credit that has been used by the account holder. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + attr_reader :used + end + # The time that the external institution calculated this balance. Measured in seconds since the Unix epoch. + attr_reader :as_of + # Attribute for field cash + attr_reader :cash + # Attribute for field credit + attr_reader :credit + # The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + attr_reader :current + # The `type` of the balance. An additional hash is included on the balance with a name matching this value. + attr_reader :type + end + + class BalanceRefresh < Stripe::StripeObject + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + attr_reader :last_attempted_at + # Time at which the next balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + attr_reader :status + end + + class InferredBalancesRefresh < Stripe::StripeObject + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + attr_reader :last_attempted_at + # Time at which the next inferred balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + attr_reader :status + end + + class OwnershipRefresh < Stripe::StripeObject + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + attr_reader :last_attempted_at + # Time at which the next ownership refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + attr_reader :status + end + + class TransactionRefresh < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + attr_reader :last_attempted_at + # Time at which the next transaction refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + attr_reader :status + end + # The account holder that this account belongs to. + attr_reader :account_holder + + # The most recent information about the account's balance. + attr_reader :balance + + # The state of the most recent attempt to refresh the account balance. + attr_reader :balance_refresh + + # The type of the account. Account category is further divided in `subcategory`. + attr_reader :category + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # A human-readable name that has been assigned to this account, either by the account holder or by the institution. + attr_reader :display_name + + # Unique identifier for the object. + attr_reader :id + + # The state of the most recent attempt to refresh the account's inferred balance history. + attr_reader :inferred_balances_refresh + + # The name of the institution that holds this account. + attr_reader :institution_name + + # The last 4 digits of the account number. If present, this will be 4 numeric characters. + attr_reader :last4 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The most recent information about the account's owners. + attr_reader :ownership + + # The state of the most recent attempt to refresh the account owners. + attr_reader :ownership_refresh + + # The list of permissions granted by this account. + attr_reader :permissions + + # The status of the link to the account. + attr_reader :status + + # If `category` is `cash`, one of: + # + # - `checking` + # - `savings` + # - `other` + # + # If `category` is `credit`, one of: + # + # - `mortgage` + # - `line_of_credit` + # - `credit_card` + # - `other` + # + # If `category` is `investment` or `other`, this will be `other`. + attr_reader :subcategory + + # The list of data refresh subscriptions requested on this account. + attr_reader :subscriptions + + # The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. + attr_reader :supported_payment_method_types + + # The state of the most recent attempt to refresh the account transactions. + attr_reader :transaction_refresh + # Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). def disconnect(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/financial_connections/account_inferred_balance.rb b/lib/stripe/resources/financial_connections/account_inferred_balance.rb index 5d9f6df5d..82b328f23 100644 --- a/lib/stripe/resources/financial_connections/account_inferred_balance.rb +++ b/lib/stripe/resources/financial_connections/account_inferred_balance.rb @@ -9,6 +9,22 @@ class AccountInferredBalance < APIResource def self.object_name "financial_connections.account_inferred_balance" end + + # The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC. + attr_reader :as_of + + # The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + attr_reader :current + + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object end end end diff --git a/lib/stripe/resources/financial_connections/account_owner.rb b/lib/stripe/resources/financial_connections/account_owner.rb index e9251e064..43d6754a2 100644 --- a/lib/stripe/resources/financial_connections/account_owner.rb +++ b/lib/stripe/resources/financial_connections/account_owner.rb @@ -9,6 +9,30 @@ class AccountOwner < StripeObject def self.object_name "financial_connections.account_owner" end + + # The email address of the owner. + attr_reader :email + + # Unique identifier for the object. + attr_reader :id + + # The full name of the owner. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ownership object that this owner belongs to. + attr_reader :ownership + + # The raw phone number of the owner. + attr_reader :phone + + # The raw physical address of the owner. + attr_reader :raw_address + + # The timestamp of the refresh that updated this owner. + attr_reader :refreshed_at end end end diff --git a/lib/stripe/resources/financial_connections/account_ownership.rb b/lib/stripe/resources/financial_connections/account_ownership.rb index 8e6daa21d..a8996967b 100644 --- a/lib/stripe/resources/financial_connections/account_ownership.rb +++ b/lib/stripe/resources/financial_connections/account_ownership.rb @@ -9,6 +9,18 @@ class AccountOwnership < StripeObject def self.object_name "financial_connections.account_ownership" end + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # A paginated list of owners for this account. + attr_reader :owners end end end diff --git a/lib/stripe/resources/financial_connections/institution.rb b/lib/stripe/resources/financial_connections/institution.rb index f1e6db2c1..c1567d1f4 100644 --- a/lib/stripe/resources/financial_connections/institution.rb +++ b/lib/stripe/resources/financial_connections/institution.rb @@ -12,6 +12,59 @@ def self.object_name "financial_connections.institution" end + class Features < Stripe::StripeObject + class Balances < Stripe::StripeObject + # Whether the given feature is supported by this institution. + attr_reader :supported + end + + class Ownership < Stripe::StripeObject + # Whether the given feature is supported by this institution. + attr_reader :supported + end + + class PaymentMethod < Stripe::StripeObject + # Whether the given feature is supported by this institution. + attr_reader :supported + end + + class Transactions < Stripe::StripeObject + # Whether the given feature is supported by this institution. + attr_reader :supported + end + # Attribute for field balances + attr_reader :balances + # Attribute for field ownership + attr_reader :ownership + # Attribute for field payment_method + attr_reader :payment_method + # Attribute for field transactions + attr_reader :transactions + end + # Attribute for field features + attr_reader :features + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The name of this institution. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # A list of routing numbers which are known to correspond to this institution. Due to the many to many relationship between institutions and routing numbers, this list may not be comprehensive and routing numbers may also be shared between institutions. + attr_reader :routing_numbers + + # The status of this institution in the Financial Connections authentication flow. + attr_reader :status + + # A URL corresponding to this institution. This URL is also displayed in the authentication flow to help end users confirm that they are authenticating with the right institution. + attr_reader :url + # Returns a list of Financial Connections Institution objects. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/financial_connections/session.rb b/lib/stripe/resources/financial_connections/session.rb index 420d79913..baba362b6 100644 --- a/lib/stripe/resources/financial_connections/session.rb +++ b/lib/stripe/resources/financial_connections/session.rb @@ -12,6 +12,81 @@ def self.object_name "financial_connections.session" end + class AccountHolder < Stripe::StripeObject + # The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. + attr_reader :account + # ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. + attr_reader :customer + # Type of account holder that this account belongs to. + attr_reader :type + end + + class Filters < Stripe::StripeObject + # Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + attr_reader :account_subcategories + # List of countries from which to filter accounts. + attr_reader :countries + # Stripe ID of the institution with which the customer should be directed to log in. + attr_reader :institution + end + + class Limits < Stripe::StripeObject + # The number of accounts that can be linked in this Session. + attr_reader :accounts + end + + class ManualEntry < Stripe::StripeObject; end + + class StatusDetails < Stripe::StripeObject + class Cancelled < Stripe::StripeObject + # The reason for the Session being cancelled. + attr_reader :reason + end + # Attribute for field cancelled + attr_reader :cancelled + end + # The account holder for whom accounts are collected in this session. + attr_reader :account_holder + + # The accounts that were collected as part of this Session. + attr_reader :accounts + + # A value that will be passed to the client to launch the authentication flow. + attr_reader :client_secret + + # Attribute for field filters + attr_reader :filters + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field limits + attr_reader :limits + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Attribute for field manual_entry + attr_reader :manual_entry + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Permissions requested for accounts collected during this session. + attr_reader :permissions + + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + attr_reader :return_url + + # The current state of the session. + attr_reader :status + + # Attribute for field status_details + attr_reader :status_details + # To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/financial_connections/transaction.rb b/lib/stripe/resources/financial_connections/transaction.rb index a198085ab..2f61489fb 100644 --- a/lib/stripe/resources/financial_connections/transaction.rb +++ b/lib/stripe/resources/financial_connections/transaction.rb @@ -12,6 +12,48 @@ def self.object_name "financial_connections.transaction" end + class StatusTransitions < Stripe::StripeObject + # Time at which this transaction posted. Measured in seconds since the Unix epoch. + attr_reader :posted_at + # Time at which this transaction was voided. Measured in seconds since the Unix epoch. + attr_reader :void_at + end + # The ID of the Financial Connections Account this transaction belongs to. + attr_reader :account + + # The amount of this transaction, in cents (or local equivalent). + attr_reader :amount + + # 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). + attr_reader :currency + + # The description of this transaction. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The status of the transaction. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # Time at which the transaction was transacted. Measured in seconds since the Unix epoch. + attr_reader :transacted_at + + # The token of the transaction refresh that last updated or created this transaction. + attr_reader :transaction_refresh + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + attr_reader :updated + # Returns a list of Financial Connections Transaction objects. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/forwarding/request.rb b/lib/stripe/resources/forwarding/request.rb index 4a59ed861..14a908ace 100644 --- a/lib/stripe/resources/forwarding/request.rb +++ b/lib/stripe/resources/forwarding/request.rb @@ -28,6 +28,75 @@ def self.object_name "forwarding.request" end + class RequestContext < Stripe::StripeObject + # The time it took in milliseconds for the destination endpoint to respond. + attr_reader :destination_duration + # The IP address of the destination. + attr_reader :destination_ip_address + end + + class RequestDetails < Stripe::StripeObject + class Header < Stripe::StripeObject + # The header name. + attr_reader :name + # The header value. + attr_reader :value + end + # The body payload to send to the destination endpoint. + attr_reader :body + # The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. + attr_reader :headers + # The HTTP method used to call the destination endpoint. + attr_reader :http_method + end + + class ResponseDetails < Stripe::StripeObject + class Header < Stripe::StripeObject + # The header name. + attr_reader :name + # The header value. + attr_reader :value + end + # The response body from the destination endpoint to Stripe. + attr_reader :body + # HTTP headers that the destination endpoint returned. + attr_reader :headers + # The HTTP status code that the destination endpoint returned. + attr_reader :status + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. + attr_reader :payment_method + + # The field kinds to be replaced in the forwarded request. + attr_reader :replacements + + # Context about the request from Stripe's servers to the destination endpoint. + attr_reader :request_context + + # The request that was sent to the destination endpoint. We redact any sensitive fields. + attr_reader :request_details + + # The response that the destination endpoint returned to us. We redact any sensitive fields. + attr_reader :response_details + + # The destination URL for the forwarded request. Must be supported by the config. + attr_reader :url + # Creates a ForwardingRequest object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/funding_instructions.rb b/lib/stripe/resources/funding_instructions.rb index 887917c59..60315cd0e 100644 --- a/lib/stripe/resources/funding_instructions.rb +++ b/lib/stripe/resources/funding_instructions.rb @@ -13,6 +13,318 @@ def self.object_name "funding_instructions" end + class BankTransfer < Stripe::StripeObject + class FinancialAddress < Stripe::StripeObject + class Aba < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # The ABA account number + attr_reader :account_number + # The account type + attr_reader :account_type + # Attribute for field bank_address + attr_reader :bank_address + # The bank name + attr_reader :bank_name + # The ABA routing number + attr_reader :routing_number + end + + class Iban < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + attr_reader :account_holder_name + # Attribute for field bank_address + attr_reader :bank_address + # The BIC/SWIFT code of the account. + attr_reader :bic + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # The IBAN of the account. + attr_reader :iban + end + + class SortCode < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + attr_reader :account_holder_name + # The account number + attr_reader :account_number + # Attribute for field bank_address + attr_reader :bank_address + # The six-digit sort code + attr_reader :sort_code + end + + class Spei < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # Attribute for field bank_address + attr_reader :bank_address + # The three-digit bank code + attr_reader :bank_code + # The short banking institution name + attr_reader :bank_name + # The CLABE number + attr_reader :clabe + end + + class Swift < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # The account number + attr_reader :account_number + # The account type + attr_reader :account_type + # Attribute for field bank_address + attr_reader :bank_address + # The bank name + attr_reader :bank_name + # The SWIFT code + attr_reader :swift_code + end + + class Zengin < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # The account number + attr_reader :account_number + # The bank account type. In Japan, this can only be `futsu` or `toza`. + attr_reader :account_type + # Attribute for field bank_address + attr_reader :bank_address + # The bank code of the account + attr_reader :bank_code + # The bank name of the account + attr_reader :bank_name + # The branch code of the account + attr_reader :branch_code + # The branch name of the account + attr_reader :branch_name + end + # ABA Records contain U.S. bank account details per the ABA format. + attr_reader :aba + # Iban Records contain E.U. bank account details per the SEPA format. + attr_reader :iban + # Sort Code Records contain U.K. bank account details per the sort code format. + attr_reader :sort_code + # SPEI Records contain Mexico bank account details per the SPEI format. + attr_reader :spei + # The payment networks supported by this FinancialAddress + attr_reader :supported_networks + # SWIFT Records contain U.S. bank account details per the SWIFT format. + attr_reader :swift + # The type of financial address + attr_reader :type + # Zengin Records contain Japan bank account details per the Zengin format. + attr_reader :zengin + end + # The country of the bank account to fund + attr_reader :country + # A list of financial addresses that can be used to fund a particular balance + attr_reader :financial_addresses + # The bank_transfer type + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + + # 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). + attr_reader :currency + + # The `funding_type` of the returned instructions + attr_reader :funding_type + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + def resource_url if !respond_to?(:customer) || customer.nil? raise NotImplementedError, diff --git a/lib/stripe/resources/gift_cards/card.rb b/lib/stripe/resources/gift_cards/card.rb index 6d238a9e1..cab803961 100644 --- a/lib/stripe/resources/gift_cards/card.rb +++ b/lib/stripe/resources/gift_cards/card.rb @@ -15,6 +15,67 @@ def self.object_name "gift_cards.card" end + class CreatedBy < Stripe::StripeObject + class Checkout < Stripe::StripeObject + # The Stripe CheckoutSession that created this object. + attr_reader :checkout_session + # The Stripe CheckoutSession LineItem that created this object. + attr_reader :line_item + end + + class Order < Stripe::StripeObject + # The Stripe Order LineItem that created this object. + attr_reader :line_item + # The Stripe Order that created this object. + attr_reader :order + end + + class Payment < Stripe::StripeObject + # The PaymentIntent that created this object. + attr_reader :payment_intent + end + # Attribute for field checkout + attr_reader :checkout + # Attribute for field order + attr_reader :order + # Attribute for field payment + attr_reader :payment + # The type of event that created this object. + attr_reader :type + end + # Whether this gift card can be used or not. + attr_reader :active + + # The amount of funds available for new transactions. + attr_reader :amount_available + + # The amount of funds marked as held. + attr_reader :amount_held + + # Code used to redeem this gift card. + attr_reader :code + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The related Stripe objects that created this gift card. + attr_reader :created_by + + # 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). + attr_reader :currency + + # Unique identifier for the object. + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Transactions on this gift card. + attr_reader :transactions + # Creates a new gift card object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/gift_cards/transaction.rb b/lib/stripe/resources/gift_cards/transaction.rb index 4f8786a4f..a9420df81 100644 --- a/lib/stripe/resources/gift_cards/transaction.rb +++ b/lib/stripe/resources/gift_cards/transaction.rb @@ -19,6 +19,70 @@ def self.object_name "gift_cards.transaction" end + class CreatedBy < Stripe::StripeObject + class Checkout < Stripe::StripeObject + # The Stripe CheckoutSession that created this object. + attr_reader :checkout_session + # The Stripe CheckoutSession LineItem that created this object. + attr_reader :line_item + end + + class Order < Stripe::StripeObject + # The Stripe Order LineItem that created this object. + attr_reader :line_item + # The Stripe Order that created this object. + attr_reader :order + end + + class Payment < Stripe::StripeObject + # The PaymentIntent that created this object. + attr_reader :payment_intent + end + # Attribute for field checkout + attr_reader :checkout + # Attribute for field order + attr_reader :order + # Attribute for field payment + attr_reader :payment + # The type of event that created this object. + attr_reader :type + end + # The amount of this transaction. A positive value indicates that funds were added to the gift card. A negative value indicates that funds were removed from the gift card. + attr_reader :amount + + # Time at which the transaction was confirmed. Measured in seconds since the Unix epoch. + attr_reader :confirmed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The related Stripe objects that created this gift card transaction. + attr_reader :created_by + + # 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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # The gift card that this transaction occurred on + attr_reader :gift_card + + # Unique identifier for the object. + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Status of this transaction, one of `held`, `confirmed`, or `canceled`. + attr_reader :status + + # A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + attr_reader :transfer_group + # Cancel a gift card transaction def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/identity/verification_report.rb b/lib/stripe/resources/identity/verification_report.rb index 854e08c26..725a5e27b 100644 --- a/lib/stripe/resources/identity/verification_report.rb +++ b/lib/stripe/resources/identity/verification_report.rb @@ -22,6 +22,220 @@ def self.object_name "identity.verification_report" end + class Document < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class Dob < Stripe::StripeObject + # Numerical day between 1 and 31. + attr_reader :day + # Numerical month between 1 and 12. + attr_reader :month + # The four-digit year. + attr_reader :year + end + + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + attr_reader :reason + end + + class ExpirationDate < Stripe::StripeObject + # Numerical day between 1 and 31. + attr_reader :day + # Numerical month between 1 and 12. + attr_reader :month + # The four-digit year. + attr_reader :year + end + + class IssuedDate < Stripe::StripeObject + # Numerical day between 1 and 31. + attr_reader :day + # Numerical month between 1 and 12. + attr_reader :month + # The four-digit year. + attr_reader :year + end + # Address as it appears in the document. + attr_reader :address + # Date of birth as it appears in the document. + attr_reader :dob + # Details on the verification error. Present when status is `unverified`. + attr_reader :error + # Expiration date of the document. + attr_reader :expiration_date + # Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. + attr_reader :files + # First name as it appears in the document. + attr_reader :first_name + # Issued date of the document. + attr_reader :issued_date + # Issuing country of the document. + attr_reader :issuing_country + # Last name as it appears in the document. + attr_reader :last_name + # Document ID number. + attr_reader :number + # Status of this `document` check. + attr_reader :status + # Type of the document. + attr_reader :type + end + + class Email < Stripe::StripeObject + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + attr_reader :reason + end + # Email to be verified. + attr_reader :email + # Details on the verification error. Present when status is `unverified`. + attr_reader :error + # Status of this `email` check. + attr_reader :status + end + + class IdNumber < Stripe::StripeObject + class Dob < Stripe::StripeObject + # Numerical day between 1 and 31. + attr_reader :day + # Numerical month between 1 and 12. + attr_reader :month + # The four-digit year. + attr_reader :year + end + + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + attr_reader :reason + end + # Date of birth. + attr_reader :dob + # Details on the verification error. Present when status is `unverified`. + attr_reader :error + # First name. + attr_reader :first_name + # ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present. + attr_reader :id_number + # Type of ID number. + attr_reader :id_number_type + # Last name. + attr_reader :last_name + # Status of this `id_number` check. + attr_reader :status + end + + class Options < Stripe::StripeObject + class Document < Stripe::StripeObject + # Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + attr_reader :allowed_types + # Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + attr_reader :require_id_number + # Disable image uploads, identity document images have to be captured using the device’s camera. + attr_reader :require_live_capture + # Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. [Learn more](https://stripe.com/docs/identity/selfie). + attr_reader :require_matching_selfie + end + + class IdNumber < Stripe::StripeObject; end + # Attribute for field document + attr_reader :document + # Attribute for field id_number + attr_reader :id_number + end + + class Phone < Stripe::StripeObject + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + attr_reader :reason + end + # Details on the verification error. Present when status is `unverified`. + attr_reader :error + # Phone to be verified. + attr_reader :phone + # Status of this `phone` check. + attr_reader :status + end + + class Selfie < Stripe::StripeObject + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + attr_reader :reason + end + # ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. + attr_reader :document + # Details on the verification error. Present when status is `unverified`. + attr_reader :error + # ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. + attr_reader :selfie + # Status of this `selfie` check. + attr_reader :status + end + # A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + attr_reader :client_reference_id + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Result from a document check + attr_reader :document + + # Result from a email check + attr_reader :email + + # Unique identifier for the object. + attr_reader :id + + # Result from an id_number check + attr_reader :id_number + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field options + attr_reader :options + + # Result from a phone check + attr_reader :phone + + # Result from a selfie check + attr_reader :selfie + + # Type of report. + attr_reader :type + + # The configuration token of a verification flow from the dashboard. + attr_reader :verification_flow + + # ID of the VerificationSession that created this report. + attr_reader :verification_session + # List all verification reports. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/identity/verification_session.rb b/lib/stripe/resources/identity/verification_session.rb index 9ba8789b0..6c161cf44 100644 --- a/lib/stripe/resources/identity/verification_session.rb +++ b/lib/stripe/resources/identity/verification_session.rb @@ -24,6 +24,153 @@ def self.object_name "identity.verification_session" end + class LastError < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification or user-session failure. + attr_reader :code + # A message that explains the reason for verification or user-session failure. + attr_reader :reason + end + + class Options < Stripe::StripeObject + class Document < Stripe::StripeObject + # Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + attr_reader :allowed_types + # Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + attr_reader :require_id_number + # Disable image uploads, identity document images have to be captured using the device’s camera. + attr_reader :require_live_capture + # Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. [Learn more](https://stripe.com/docs/identity/selfie). + attr_reader :require_matching_selfie + end + + class Email < Stripe::StripeObject + # Request one time password verification of `provided_details.email`. + attr_reader :require_verification + end + + class IdNumber < Stripe::StripeObject; end + + class Phone < Stripe::StripeObject + # Request one time password verification of `provided_details.phone`. + attr_reader :require_verification + end + # Attribute for field document + attr_reader :document + # Attribute for field email + attr_reader :email + # Attribute for field id_number + attr_reader :id_number + # Attribute for field phone + attr_reader :phone + end + + class ProvidedDetails < Stripe::StripeObject + # Email of user being verified + attr_reader :email + # Phone number of user being verified + attr_reader :phone + end + + class Redaction < Stripe::StripeObject + # Indicates whether this object and its related objects have been redacted or not. + attr_reader :status + end + + class VerifiedOutputs < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class Dob < Stripe::StripeObject + # Numerical day between 1 and 31. + attr_reader :day + # Numerical month between 1 and 12. + attr_reader :month + # The four-digit year. + attr_reader :year + end + # The user's verified address. + attr_reader :address + # The user’s verified date of birth. + attr_reader :dob + # The user's verified email address + attr_reader :email + # The user's verified first name. + attr_reader :first_name + # The user's verified id number. + attr_reader :id_number + # The user's verified id number type. + attr_reader :id_number_type + # The user's verified last name. + attr_reader :last_name + # The user's verified phone number + attr_reader :phone + end + # A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + attr_reader :client_reference_id + + # The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. + attr_reader :client_secret + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # If present, this property tells you the last error encountered when processing the verification. + attr_reader :last_error + + # ID of the most recent VerificationReport. [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results) + attr_reader :last_verification_report + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # A set of options for the session’s verification checks. + attr_reader :options + + # Details provided about the user being verified. These details may be shown to the user. + attr_reader :provided_details + + # Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. + attr_reader :redaction + + # Token referencing a Customer resource. + attr_reader :related_customer + + # Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + attr_reader :status + + # The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + attr_reader :type + + # The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. + attr_reader :url + + # The configuration token of a verification flow from the dashboard. + attr_reader :verification_flow + + # The user’s verified data. + attr_reader :verified_outputs + # A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). # # Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). diff --git a/lib/stripe/resources/invoice.rb b/lib/stripe/resources/invoice.rb index 1067e7612..3734f3353 100644 --- a/lib/stripe/resources/invoice.rb +++ b/lib/stripe/resources/invoice.rb @@ -50,6 +50,701 @@ def self.object_name nested_resource_class_methods :line, operations: %i[list] nested_resource_class_methods :payment, operations: %i[retrieve list] + class AmountsDue < Stripe::StripeObject + # Incremental amount due for this payment in cents (or local equivalent). + attr_reader :amount + # The amount in cents (or local equivalent) that was paid for this payment. + attr_reader :amount_paid + # The difference between the payment’s amount and amount_paid, in cents (or local equivalent). + attr_reader :amount_remaining + # Number of days from when invoice is finalized until the payment is due. + attr_reader :days_until_due + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + # Date on which a payment plan’s payment is due. + attr_reader :due_date + # Timestamp when the payment was paid. + attr_reader :paid_at + # The status of the payment, one of `open`, `paid`, or `past_due` + attr_reader :status + end + + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + # The status of the most recent automated tax calculation for this invoice. + attr_reader :status + end + + class CustomField < Stripe::StripeObject + # The name of the custom field. + attr_reader :name + # The value of the custom field. + attr_reader :value + end + + class CustomerAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class CustomerShipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class CustomerTaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + + class FromInvoice < Stripe::StripeObject + # The relation between this invoice and the cloned invoice + attr_reader :action + # The invoice that was cloned. + attr_reader :invoice + end + + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + + class LastFinalizationError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + attr_reader :setup_intent + # Attribute for field source + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + attr_reader :type + end + + class PaymentSettings < Stripe::StripeObject + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Bank account verification method. + attr_reader :verification_method + end + + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + attr_reader :preferred_language + end + + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + # Whether Installments are enabled for this Invoice. + attr_reader :enabled + end + # Attribute for field installments + attr_reader :installments + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + attr_reader :request_three_d_secure + end + + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + attr_reader :country + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + attr_reader :funding_type + end + + class IdBankTransfer < Stripe::StripeObject; end + class Konbini < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + attr_reader :institution + end + # Attribute for field filters + attr_reader :filters + # The list of permissions to request. The `payment_method` permission must be included. + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + end + # Attribute for field financial_connections + attr_reader :financial_connections + # Bank account verification method. + attr_reader :verification_method + end + # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + attr_reader :acss_debit + # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + attr_reader :bancontact + # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + attr_reader :card + # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + attr_reader :customer_balance + # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent. + attr_reader :id_bank_transfer + # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + attr_reader :konbini + # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + attr_reader :sepa_debit + # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + attr_reader :us_bank_account + end + # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + attr_reader :default_mandate + # Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + attr_reader :payment_method_options + # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + attr_reader :payment_method_types + end + + class Rendering < Stripe::StripeObject + class Pdf < Stripe::StripeObject + # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. + attr_reader :page_size + end + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + attr_reader :amount_tax_display + # Invoice pdf rendering options + attr_reader :pdf + # ID of the rendering template that the invoice is formatted by. + attr_reader :template + # Version of the rendering template that the invoice is using. + attr_reader :template_version + end + + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # Total shipping cost before any taxes are applied. + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + attr_reader :amount_tax + # Total shipping cost after taxes are applied. + attr_reader :amount_total + # The ID of the ShippingRate for this invoice. + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + attr_reader :taxes + end + + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class StatusTransitions < Stripe::StripeObject + # The time that the invoice draft was finalized. + attr_reader :finalized_at + # The time that the invoice was marked uncollectible. + attr_reader :marked_uncollectible_at + # The time that the invoice was paid. + attr_reader :paid_at + # The time that the invoice was voided. + attr_reader :voided_at + end + + class SubscriptionDetails < Stripe::StripeObject + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + attr_reader :behavior + # The time after which the subscription will resume collecting payments. + attr_reader :resumes_at + end + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + # *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + attr_reader :metadata + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + attr_reader :pause_collection + end + + class ThresholdReason < Stripe::StripeObject + class ItemReason < Stripe::StripeObject + # The IDs of the line items that triggered the threshold invoice. + attr_reader :line_item_ids + # The quantity threshold boundary that applied to the given line item. + attr_reader :usage_gte + end + # The total invoice amount threshold boundary if it triggered the threshold invoice. + attr_reader :amount_gte + # Indicates which line items triggered a threshold invoice. + attr_reader :item_reasons + end + + class TotalDiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + attr_reader :amount + # The discount that was applied to get this discount amount. + attr_reader :discount + end + + class TotalMarginAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the reduction in line item amount. + attr_reader :amount + # The margin that was applied to get this margin amount. + attr_reader :margin + end + + class TotalPretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + attr_reader :discount + # The margin that was applied to get this pretax credit amount. + attr_reader :margin + # Type of the pretax credit amount referenced. + attr_reader :type + end + + class TotalTaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + attr_reader :amount + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + # The country of the business associated with this invoice, most often the business creating the invoice. + attr_reader :account_country + + # The public name of the business associated with this invoice, most often the business creating the invoice. + attr_reader :account_name + + # The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + attr_reader :account_tax_ids + + # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + attr_reader :amount_due + + # Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit balance. + attr_reader :amount_overpaid + + # The amount, in cents (or local equivalent), that was paid. + attr_reader :amount_paid + + # The difference between amount_due and amount_paid, in cents (or local equivalent). + attr_reader :amount_remaining + + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + + # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. + attr_reader :amounts_due + + # ID of the Connect Application that created the invoice. + attr_reader :application + + # The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + attr_reader :application_fee_amount + + # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. + attr_reader :attempt_count + + # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + attr_reader :attempted + + # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + attr_reader :auto_advance + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + attr_reader :automatically_finalizes_at + + # Indicates the reason why the invoice was created. + # + # * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + # * `subscription_create`: A new subscription was created. + # * `subscription_cycle`: A subscription advanced into a new period. + # * `subscription_threshold`: A subscription reached a billing threshold. + # * `subscription_update`: A subscription was updated. + # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + attr_reader :billing_reason + + # ID of the latest charge generated for this invoice, if any. + attr_reader :charge + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + attr_reader :collection_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Custom fields displayed on the invoice. + attr_reader :custom_fields + + # The ID of the customer who will be billed. + attr_reader :customer + + # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_address + + # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_email + + # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_name + + # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_phone + + # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_shipping + + # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_tax_exempt + + # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_tax_ids + + # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin. + attr_reader :default_margins + + # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + attr_reader :default_payment_method + + # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + attr_reader :default_source + + # The tax rates applied to this invoice, if any. + attr_reader :default_tax_rates + + # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + attr_reader :description + + # Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + attr_reader :discount + + # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`. + attr_reader :due_date + + # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + attr_reader :effective_at + + # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + attr_reader :ending_balance + + # Footer displayed on the invoice. + attr_reader :footer + + # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + attr_reader :from_invoice + + # The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. + attr_reader :hosted_invoice_url + + # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. + attr_reader :id + + # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. + attr_reader :invoice_pdf + + # Attribute for field issuer + attr_reader :issuer + + # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + attr_reader :last_finalization_error + + # The ID of the most recent non-draft revision of this invoice + attr_reader :latest_revision + + # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`. + attr_reader :next_payment_attempt + + # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + attr_reader :on_behalf_of + + # Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + attr_reader :paid + + # Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + attr_reader :paid_out_of_band + + # The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + attr_reader :payment_intent + + # Attribute for field payment_settings + attr_reader :payment_settings + + # Payments for this invoice + attr_reader :payments + + # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + attr_reader :period_end + + # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + attr_reader :period_start + + # Total amount of all post-payment credit notes issued for this invoice. + attr_reader :post_payment_credit_notes_amount + + # Total amount of all pre-payment credit notes issued for this invoice. + attr_reader :pre_payment_credit_notes_amount + + # The quote this invoice was generated from. + attr_reader :quote + + # This is the transaction number that appears on email receipts sent for this invoice. + attr_reader :receipt_number + + # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + attr_reader :rendering + + # The details of the cost of shipping, including the ShippingRate applied on the invoice. + attr_reader :shipping_cost + + # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + attr_reader :shipping_details + + # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. + attr_reader :starting_balance + + # Extra information about an invoice for the customer's credit card statement. + attr_reader :statement_descriptor + + # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # The subscription that this invoice was prepared for, if any. + attr_reader :subscription + + # Details about the subscription that created this invoice. + attr_reader :subscription_details + + # Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + attr_reader :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 + attr_reader :subtotal + + # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + attr_reader :subtotal_excluding_tax + + # The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + attr_reader :tax + + # ID of the test clock this invoice belongs to. + attr_reader :test_clock + + # Attribute for field threshold_reason + attr_reader :threshold_reason + + # Total after discounts and taxes. + attr_reader :total + + # The aggregate amounts calculated per discount across all line items. + attr_reader :total_discount_amounts + + # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + attr_reader :total_excluding_tax + + # The aggregate amounts calculated per margin across all line items. + attr_reader :total_margin_amounts + + # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + attr_reader :total_pretax_credit_amounts + + # The aggregate amounts calculated per tax rate for all line items. + attr_reader :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. + attr_reader :transfer_data + + # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + attr_reader :webhooks_delivered_at + + # Always true for a deleted object + attr_reader :deleted + # Adds multiple line items to an invoice. This is only possible when an invoice is still a draft. def add_lines(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/invoice_item.rb b/lib/stripe/resources/invoice_item.rb index 8b11c532e..b2eddba37 100644 --- a/lib/stripe/resources/invoice_item.rb +++ b/lib/stripe/resources/invoice_item.rb @@ -24,6 +24,87 @@ def self.object_name "invoiceitem" end + class Period < Stripe::StripeObject + # The end of the period, which must be greater than or equal to the start. This value is inclusive. + attr_reader :end + # The start of the period. This value is inclusive. + attr_reader :start + end + # Amount (in the `currency` specified) of the invoice item. This should always be equal to `unit_amount * quantity`. + attr_reader :amount + + # 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). + attr_reader :currency + + # The ID of the customer who will be billed when this invoice item is billed. + attr_reader :customer + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :date + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # If true, discounts will apply to this invoice item. Always false for prorations. + attr_reader :discountable + + # The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # Unique identifier for the object. + attr_reader :id + + # The ID of the invoice this invoice item belongs to. + attr_reader :invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The margins which apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + attr_reader :margins + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field period + attr_reader :period + + # If the invoice item is a proration, the plan of the subscription that the proration was computed for. + attr_reader :plan + + # The price of the invoice item. + attr_reader :price + + # Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + attr_reader :proration + + # Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + attr_reader :quantity + + # The subscription that this invoice item has been created for, if any. + attr_reader :subscription + + # The subscription item that this invoice item has been created for, if any. + attr_reader :subscription_item + + # The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + attr_reader :tax_rates + + # ID of the test clock this invoice item belongs to. + attr_reader :test_clock + + # Unit amount (in the `currency` specified) of the invoice item. + attr_reader :unit_amount + + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :unit_amount_decimal + + # Always true for a deleted object + attr_reader :deleted + # Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/invoiceitems", params: params, opts: opts) diff --git a/lib/stripe/resources/invoice_line_item.rb b/lib/stripe/resources/invoice_line_item.rb index fb3c25ad1..9f93f6148 100644 --- a/lib/stripe/resources/invoice_line_item.rb +++ b/lib/stripe/resources/invoice_line_item.rb @@ -13,6 +13,147 @@ def self.object_name "line_item" end + class DiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + attr_reader :amount + # The discount that was applied to get this discount amount. + attr_reader :discount + end + + class MarginAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the reduction in line item amount. + attr_reader :amount + # The margin that was applied to get this margin amount. + attr_reader :margin + end + + class Period < Stripe::StripeObject + # The end of the period, which must be greater than or equal to the start. This value is inclusive. + attr_reader :end + # The start of the period. This value is inclusive. + attr_reader :start + end + + class PretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + attr_reader :discount + # The margin that was applied to get this pretax credit amount. + attr_reader :margin + # Type of the pretax credit amount referenced. + attr_reader :type + end + + class ProrationDetails < Stripe::StripeObject + class CreditedItems < Stripe::StripeObject + # Invoice containing the credited invoice line items + attr_reader :invoice + # Credited invoice line items + attr_reader :invoice_line_items + end + # For a credit proration `line_item`, the original debit line_items to which the credit proration applies. + attr_reader :credited_items + end + + class TaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The amount, in cents (or local equivalent). + attr_reader :amount + + # The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # The amount of discount calculated per discount for this line item. + attr_reader :discount_amounts + + # If true, discounts will apply to this line item. Always false for prorations. + attr_reader :discountable + + # The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # Unique identifier for the object. + attr_reader :id + + # The ID of the invoice that contains this line item. + attr_reader :invoice + + # The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. + attr_reader :invoice_item + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The amount of margin calculated per margin for this line item. + attr_reader :margin_amounts + + # The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin. + attr_reader :margins + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field period + attr_reader :period + + # The plan of the subscription, if the line item is a subscription or a proration. + attr_reader :plan + + # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. + attr_reader :pretax_credit_amounts + + # The price of the line item. + attr_reader :price + + # Whether this is a proration. + attr_reader :proration + + # Additional details for proration line items + attr_reader :proration_details + + # The quantity of the subscription, if the line item is a subscription or a proration. + attr_reader :quantity + + # The subscription that the invoice item pertains to, if any. + attr_reader :subscription + + # The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. + attr_reader :subscription_item + + # The amount of tax calculated per tax rate for this line item + attr_reader :tax_amounts + + # The tax rates which apply to the line item. + attr_reader :tax_rates + + # A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. + attr_reader :type + + # The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. + attr_reader :unit_amount_excluding_tax + # Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, # so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice # item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. diff --git a/lib/stripe/resources/invoice_payment.rb b/lib/stripe/resources/invoice_payment.rb index dd190ea05..01ae58e0e 100644 --- a/lib/stripe/resources/invoice_payment.rb +++ b/lib/stripe/resources/invoice_payment.rb @@ -8,5 +8,61 @@ class InvoicePayment < APIResource def self.object_name "invoice_payment" end + + class Payment < Stripe::StripeObject + # ID of the successful charge for this payment when `type` is `charge`. + attr_reader :charge + # ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019. + attr_reader :payment_intent + # ID of the PaymentRecord associated with this payment when `type` is `payment_record`. + attr_reader :payment_record + # Type of payment object associated with this invoice payment. + attr_reader :type + end + + class StatusTransitions < Stripe::StripeObject + # The time that the payment was canceled. + attr_reader :canceled_at + # The time that the payment succeeded. + attr_reader :paid_at + end + # Excess payment that was received for this invoice and credited to the customer’s `invoice_credit_balance`. This field is null until the payment is `paid`. Overpayment can happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds. To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more. + attr_reader :amount_overpaid + + # Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent’s `amount_received` is not sufficient to pay all of the invoices that it is attached to. + attr_reader :amount_paid + + # Amount intended to be paid toward this invoice, in cents (or local equivalent) + attr_reader :amount_requested + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Unique identifier for the object. + attr_reader :id + + # The invoice that was paid. + attr_reader :invoice + + # Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s `amount_remaining`. The PaymentIntent associated with the default payment can’t be edited or canceled directly. + attr_reader :is_default + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field payment + attr_reader :payment + + # The status of the payment, one of `open`, `paid`, or `canceled`. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions end end diff --git a/lib/stripe/resources/invoice_rendering_template.rb b/lib/stripe/resources/invoice_rendering_template.rb index 0e7990af9..5246ebdb7 100644 --- a/lib/stripe/resources/invoice_rendering_template.rb +++ b/lib/stripe/resources/invoice_rendering_template.rb @@ -12,6 +12,30 @@ def self.object_name "invoice_rendering_template" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # A brief description of the template, hidden from customers + attr_reader :nickname + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The status of the template, one of `active` or `archived`. + attr_reader :status + + # Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering + attr_reader :version + # Updates the status of an invoice rendering template to ‘archived' so no new Stripe objects (customers, invoices, etc.) can reference it. The template can also no longer be updated. However, if the template is already set on a Stripe object, it will continue to be applied on invoices generated by it. def archive(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/authorization.rb b/lib/stripe/resources/issuing/authorization.rb index f5cffe924..a3a1583d7 100644 --- a/lib/stripe/resources/issuing/authorization.rb +++ b/lib/stripe/resources/issuing/authorization.rb @@ -18,6 +18,296 @@ def self.object_name "issuing.authorization" end + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + attr_reader :cashback_amount + end + + class Fleet < Stripe::StripeObject + class CardholderPromptData < Stripe::StripeObject + # [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry. The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID. + attr_reader :alphanumeric_id + # Driver ID. + attr_reader :driver_id + # Odometer reading. + attr_reader :odometer + # An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + attr_reader :unspecified_id + # User ID. + attr_reader :user_id + # Vehicle number. + attr_reader :vehicle_number + end + + class ReportedBreakdown < Stripe::StripeObject + class Fuel < Stripe::StripeObject + # Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes. + attr_reader :gross_amount_decimal + end + + class NonFuel < Stripe::StripeObject + # Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + attr_reader :gross_amount_decimal + end + + class Tax < Stripe::StripeObject + # Amount of state or provincial Sales Tax included in the transaction amount. `null` if not reported by merchant or not subject to tax. + attr_reader :local_amount_decimal + # Amount of national Sales Tax or VAT included in the transaction amount. `null` if not reported by merchant or not subject to tax. + attr_reader :national_amount_decimal + end + # Breakdown of fuel portion of the purchase. + attr_reader :fuel + # Breakdown of non-fuel portion of the purchase. + attr_reader :non_fuel + # Information about tax included in this transaction. + attr_reader :tax + end + # Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + attr_reader :cardholder_prompt_data + # The type of purchase. + attr_reader :purchase_type + # More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + attr_reader :reported_breakdown + # The type of fuel service. + attr_reader :service_type + end + + class FraudChallenge < Stripe::StripeObject + # The method by which the fraud challenge was delivered to the cardholder. + attr_reader :channel + # The status of the fraud challenge. + attr_reader :status + # If the challenge is not deliverable, the reason why. + attr_reader :undeliverable_reason + end + + class Fuel < Stripe::StripeObject + # [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + attr_reader :industry_product_code + # The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + attr_reader :quantity_decimal + # The type of fuel that was purchased. + attr_reader :type + # The units for `quantity_decimal`. + attr_reader :unit + # The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + attr_reader :unit_cost_decimal + end + + class MerchantData < Stripe::StripeObject + # A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + attr_reader :category + # The merchant category code for the seller’s business + attr_reader :category_code + # City where the seller is located + attr_reader :city + # Country where the seller is located + attr_reader :country + # Name of the seller + attr_reader :name + # Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + attr_reader :network_id + # Postal code where the seller is located + attr_reader :postal_code + # State where the seller is located + attr_reader :state + # An ID assigned by the seller to the location of the sale. + attr_reader :terminal_id + # URL provided by the merchant on a 3DS request + attr_reader :url + end + + class NetworkData < Stripe::StripeObject + # Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`. + attr_reader :acquiring_institution_id + # The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer `network_data.transaction_id` if present, unless you have special requirements. + attr_reader :system_trace_audit_number + # Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + attr_reader :transaction_id + end + + class PendingRequest < Stripe::StripeObject + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + attr_reader :cashback_amount + end + # The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_details + # 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). + attr_reader :currency + # If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + attr_reader :is_amount_controllable + # The amount the merchant is requesting to be authorized in the `merchant_currency`. The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :merchant_amount + # The local currency the merchant is requesting to authorize. + attr_reader :merchant_currency + # The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + attr_reader :network_risk_score + end + + class RequestHistory < Stripe::StripeObject + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + attr_reader :cashback_amount + end + # The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Stripe held this amount from your account to fund the authorization if the request was approved. + attr_reader :amount + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_details + # Whether this request was approved. + attr_reader :approved + # A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. + attr_reader :authorization_code + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + # The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :merchant_amount + # The currency that was collected by the merchant and presented to the cardholder for the authorization. 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). + attr_reader :merchant_currency + # The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + attr_reader :network_risk_score + # When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. + attr_reader :reason + # If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. + attr_reader :reason_message + # Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time. + attr_reader :requested_at + end + + class Treasury < Stripe::StripeObject + # The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization + attr_reader :received_credits + # The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization + attr_reader :received_debits + # The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization + attr_reader :transaction + end + + class VerificationData < Stripe::StripeObject + class AuthenticationExemption < Stripe::StripeObject + # The entity that requested the exemption, either the acquiring merchant or the Issuing user. + attr_reader :claimed_by + # The specific exemption claimed for this authorization. + attr_reader :type + end + + class ThreeDSecure < Stripe::StripeObject + # The outcome of the 3D Secure authentication request. + attr_reader :result + end + # Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. + attr_reader :address_line1_check + # Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. + attr_reader :address_postal_code_check + # The exemption applied to this authorization. + attr_reader :authentication_exemption + # Whether the cardholder provided a CVC and if it matched Stripe’s record. + attr_reader :cvc_check + # Whether the cardholder provided an expiry date and if it matched Stripe’s record. + attr_reader :expiry_check + # The postal code submitted as part of the authorization used for postal code verification. + attr_reader :postal_code + # 3D Secure details. + attr_reader :three_d_secure + end + # The total amount that was authorized or rejected. This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. + attr_reader :amount + + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_details + + # Whether the authorization has been approved. + attr_reader :approved + + # How the card details were provided. + attr_reader :authorization_method + + # List of balance transactions associated with this authorization. + attr_reader :balance_transactions + + # You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders. + attr_reader :card + + # The cardholder to whom this authorization belongs. + attr_reader :cardholder + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. 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). + attr_reader :currency + + # Fleet-specific information for authorizations using Fleet cards. + attr_reader :fleet + + # Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons. + attr_reader :fraud_challenges + + # Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + attr_reader :fuel + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. + attr_reader :merchant_amount + + # The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `currency` field on this authorization. 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). + attr_reader :merchant_currency + + # Attribute for field merchant_data + attr_reader :merchant_data + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Details about the authorization, such as identifiers, set by the card network. + attr_reader :network_data + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook. + attr_reader :pending_request + + # History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. + attr_reader :request_history + + # The current status of the authorization in its lifecycle. + attr_reader :status + + # [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. If a network token was not used for this authorization, this field will be null. + attr_reader :token + + # List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. + attr_reader :transactions + + # [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). + attr_reader :treasury + + # Attribute for field verification_data + attr_reader :verification_data + + # Whether the authorization bypassed fraud risk checks because the cardholder has previously completed a fraud challenge on a similar high-risk authorization from the same merchant. + attr_reader :verified_by_fraud_challenge + + # The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. + attr_reader :wallet + # [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. # This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). def approve(params = {}, opts = {}) diff --git a/lib/stripe/resources/issuing/card.rb b/lib/stripe/resources/issuing/card.rb index fdf8188be..9f689fc52 100644 --- a/lib/stripe/resources/issuing/card.rb +++ b/lib/stripe/resources/issuing/card.rb @@ -14,6 +14,195 @@ def self.object_name "issuing.card" end + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class AddressValidation < Stripe::StripeObject + class NormalizedAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # The address validation capabilities to use. + attr_reader :mode + # The normalized shipping address. + attr_reader :normalized_address + # The validation result for the shipping address. + attr_reader :result + end + + class Customs < Stripe::StripeObject + # A registration number used for customs in Europe. See [https://www.gov.uk/eori](https://www.gov.uk/eori) for the UK and [https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. + attr_reader :eori_number + end + # Attribute for field address + attr_reader :address + # Address validation details for the shipment. + attr_reader :address_validation + # The delivery company that shipped a card. + attr_reader :carrier + # Additional information that may be required for clearing customs. + attr_reader :customs + # A unix timestamp representing a best estimate of when the card will be delivered. + attr_reader :eta + # Recipient name. + attr_reader :name + # The phone number of the receiver of the shipment. Our courier partners will use this number to contact you in the event of card delivery issues. For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. + attr_reader :phone_number + # Whether a signature is required for card delivery. This feature is only supported for US users. Standard shipping service does not support signature on delivery. The default value for standard shipping service is false and for express and priority services is true. + attr_reader :require_signature + # Shipment service, such as `standard` or `express`. + attr_reader :service + # The delivery status of the card. + attr_reader :status + # A tracking number for a card shipment. + attr_reader :tracking_number + # A link to the shipping carrier's site where you can view detailed information about a card shipment. + attr_reader :tracking_url + # Packaging options. + attr_reader :type + end + + class SpendingControls < Stripe::StripeObject + class SpendingLimit < Stripe::StripeObject + # Maximum amount allowed to spend per interval. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + attr_reader :categories + # Interval (or event) to which the amount applies. + attr_reader :interval + end + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + attr_reader :allowed_categories + # Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + attr_reader :allowed_merchant_countries + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + attr_reader :blocked_categories + # Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + attr_reader :blocked_merchant_countries + # Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + attr_reader :spending_limits + # Currency of the amounts within `spending_limits`. Always the same as the currency of the card. + attr_reader :spending_limits_currency + end + + class Wallets < Stripe::StripeObject + class ApplePay < Stripe::StripeObject + # Apple Pay Eligibility + attr_reader :eligible + # Reason the card is ineligible for Apple Pay + attr_reader :ineligible_reason + end + + class GooglePay < Stripe::StripeObject + # Google Pay Eligibility + attr_reader :eligible + # Reason the card is ineligible for Google Pay + attr_reader :ineligible_reason + end + # Attribute for field apple_pay + attr_reader :apple_pay + # Attribute for field google_pay + attr_reader :google_pay + # Unique identifier for a card used with digital wallets + attr_reader :primary_account_identifier + end + # The brand of the card. + attr_reader :brand + + # The reason why the card was canceled. + attr_reader :cancellation_reason + + # An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. + # + # Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards/virtual/issue-cards#create-cardholder) + attr_reader :cardholder + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # 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. + attr_reader :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. + attr_reader :cvc + + # The expiration month of the card. + attr_reader :exp_month + + # The expiration year of the card. + attr_reader :exp_year + + # The financial account this card is attached to. + attr_reader :financial_account + + # Unique identifier for the object. + attr_reader :id + + # The last 4 digits of the card number. + attr_reader :last4 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The full unredacted card number. 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. + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The personalization design object belonging to this card. + attr_reader :personalization_design + + # The latest card that replaces this card, if any. + attr_reader :replaced_by + + # The card this card replaces, if any. + attr_reader :replacement_for + + # The reason why the previous card needed to be replaced. + attr_reader :replacement_reason + + # Where and how the card will be shipped. + attr_reader :shipping + + # Attribute for field spending_controls + attr_reader :spending_controls + + # Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. + attr_reader :status + + # The type of the card. + attr_reader :type + + # Information relating to digital wallets (like Apple Pay and Google Pay). + attr_reader :wallets + # Creates an Issuing Card object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/issuing/cards", params: params, opts: opts) diff --git a/lib/stripe/resources/issuing/cardholder.rb b/lib/stripe/resources/issuing/cardholder.rb index 24ae14410..b593bb223 100644 --- a/lib/stripe/resources/issuing/cardholder.rb +++ b/lib/stripe/resources/issuing/cardholder.rb @@ -16,6 +16,153 @@ def self.object_name "issuing.cardholder" end + class Billing < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + end + + class Company < Stripe::StripeObject + # Whether the company's business ID number was provided. + attr_reader :tax_id_provided + end + + class Individual < Stripe::StripeObject + class CardIssuing < Stripe::StripeObject + class UserTermsAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + attr_reader :date + # The IP address from which the cardholder accepted the Authorized User Terms. + attr_reader :ip + # The user agent of the browser from which the cardholder accepted the Authorized User Terms. + attr_reader :user_agent + end + # Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. + attr_reader :user_terms_acceptance + end + + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + attr_reader :day + # The month of birth, between 1 and 12. + attr_reader :month + # The four-digit year of birth. + attr_reader :year + end + + class Verification < Stripe::StripeObject + class Document < Stripe::StripeObject + # The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + attr_reader :back + # The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + attr_reader :front + end + # An identifying document, either a passport or local ID card. + attr_reader :document + end + # Information related to the card_issuing program for this cardholder. + attr_reader :card_issuing + # The date of birth of this cardholder. + attr_reader :dob + # The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + attr_reader :first_name + # The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + attr_reader :last_name + # Government-issued ID document for this cardholder. + attr_reader :verification + end + + class Requirements < Stripe::StripeObject + # If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. + attr_reader :disabled_reason + # Array of fields that need to be collected in order to verify and re-enable the cardholder. + attr_reader :past_due + end + + class SpendingControls < Stripe::StripeObject + class SpendingLimit < Stripe::StripeObject + # Maximum amount allowed to spend per interval. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + attr_reader :categories + # Interval (or event) to which the amount applies. + attr_reader :interval + end + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + attr_reader :allowed_categories + # Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + attr_reader :allowed_merchant_countries + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + attr_reader :blocked_categories + # Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + attr_reader :blocked_merchant_countries + # Limit spending with amount-based rules that apply across this cardholder's cards. + attr_reader :spending_limits + # Currency of the amounts within `spending_limits`. + attr_reader :spending_limits_currency + end + # Attribute for field billing + attr_reader :billing + + # Additional information about a `company` cardholder. + attr_reader :company + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The cardholder's email address. + attr_reader :email + + # Unique identifier for the object. + attr_reader :id + + # Additional information about an `individual` cardholder. + attr_reader :individual + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The cardholder's name. This will be printed on cards issued to them. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + attr_reader :phone_number + + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. + # This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + attr_reader :preferred_locales + + # Attribute for field requirements + attr_reader :requirements + + # Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + attr_reader :spending_controls + + # Specifies whether to permit authorizations on this cardholder's cards. + attr_reader :status + + # One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. + attr_reader :type + # Creates a new Issuing Cardholder object that can be issued cards. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/credit_underwriting_record.rb b/lib/stripe/resources/issuing/credit_underwriting_record.rb index 85a6f7db1..100f27257 100644 --- a/lib/stripe/resources/issuing/credit_underwriting_record.rb +++ b/lib/stripe/resources/issuing/credit_underwriting_record.rb @@ -14,6 +14,111 @@ def self.object_name "issuing.credit_underwriting_record" end + class Application < Stripe::StripeObject + # The channel through which the applicant has submitted their application. + attr_reader :application_method + # Scope of demand made by the applicant. + attr_reader :purpose + # Date when the applicant submitted their application. + attr_reader :submitted_at + end + + class CreditUser < Stripe::StripeObject + # Email of the applicant or accountholder. + attr_reader :email + # Full name of the company or person. + attr_reader :name + end + + class Decision < Stripe::StripeObject + class ApplicationRejected < Stripe::StripeObject + # Details about the `reasons.other` when present. + attr_reader :reason_other_explanation + # List of reasons why the application was rejected up to 4 reasons, in order of importance. + attr_reader :reasons + end + + class CreditLimitApproved < Stripe::StripeObject + # Credit amount approved. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy). + attr_reader :amount + # 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). + attr_reader :currency + end + + class CreditLimitDecreased < Stripe::StripeObject + # Credit amount approved after decrease. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy). + attr_reader :amount + # 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). + attr_reader :currency + # Details about the `reasons.other` when present. + attr_reader :reason_other_explanation + # List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + attr_reader :reasons + end + + class CreditLineClosed < Stripe::StripeObject + # Details about the `reasons.other` when present. + attr_reader :reason_other_explanation + # List of reasons why the existing account was closed, up to 4 reasons, in order of importance. + attr_reader :reasons + end + # Details about a decision application_rejected. + attr_reader :application_rejected + # Details about a decision credit_limit_approved. + attr_reader :credit_limit_approved + # Details about a decision credit_limit_decreased. + attr_reader :credit_limit_decreased + # Details about a decision credit_line_closed. + attr_reader :credit_line_closed + # Outcome of the decision. + attr_reader :type + end + + class UnderwritingException < Stripe::StripeObject + # Written explanation for the exception. + attr_reader :explanation + # The decision before the exception was applied. + attr_reader :original_decision_type + end + # For decisions triggered by an application, details about the submission. + attr_reader :application + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The event that triggered the underwriting. + attr_reader :created_from + + # Attribute for field credit_user + attr_reader :credit_user + + # Date when a decision was made. + attr_reader :decided_at + + # Details about the decision. + attr_reader :decision + + # For underwriting initiated by an application, a decision must be taken 30 days after the submission. + attr_reader :decision_deadline + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + attr_reader :regulatory_reporting_file + + # If an exception to the usual underwriting criteria was made for this application, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + attr_reader :underwriting_exception + # Update a CreditUnderwritingRecord object to correct mistakes. def correct(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/dispute.rb b/lib/stripe/resources/issuing/dispute.rb index 98527d73f..e130c8adb 100644 --- a/lib/stripe/resources/issuing/dispute.rb +++ b/lib/stripe/resources/issuing/dispute.rb @@ -16,6 +16,175 @@ def self.object_name "issuing.dispute" end + class Evidence < Stripe::StripeObject + class Canceled < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Date when order was canceled. + attr_reader :canceled_at + # Whether the cardholder was provided with a cancellation policy. + attr_reader :cancellation_policy_provided + # Reason for canceling the order. + attr_reader :cancellation_reason + # Date when the cardholder expected to receive the product. + attr_reader :expected_at + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + # Description of the merchandise or service that was purchased. + attr_reader :product_description + # Whether the product was a merchandise or service. + attr_reader :product_type + # Result of cardholder's attempt to return the product. + attr_reader :return_status + # Date when the product was returned or attempted to be returned. + attr_reader :returned_at + end + + class Duplicate < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + attr_reader :card_statement + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + attr_reader :cash_receipt + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + attr_reader :check_image + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + # Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. + attr_reader :original_transaction + end + + class Fraudulent < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + end + + class MerchandiseNotAsDescribed < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + # Date when the product was received. + attr_reader :received_at + # Description of the cardholder's attempt to return the product. + attr_reader :return_description + # Result of cardholder's attempt to return the product. + attr_reader :return_status + # Date when the product was returned or attempted to be returned. + attr_reader :returned_at + end + + class NoValidAuthorization < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + end + + class NotReceived < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Date when the cardholder expected to receive the product. + attr_reader :expected_at + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + # Description of the merchandise or service that was purchased. + attr_reader :product_description + # Whether the product was a merchandise or service. + attr_reader :product_type + end + + class Other < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + # Description of the merchandise or service that was purchased. + attr_reader :product_description + # Whether the product was a merchandise or service. + attr_reader :product_type + end + + class ServiceNotAsDescribed < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + attr_reader :additional_documentation + # Date when order was canceled. + attr_reader :canceled_at + # Reason for canceling the order. + attr_reader :cancellation_reason + # Explanation of why the cardholder is disputing this transaction. + attr_reader :explanation + # Date when the product was received. + attr_reader :received_at + end + # Attribute for field canceled + attr_reader :canceled + # Attribute for field duplicate + attr_reader :duplicate + # Attribute for field fraudulent + attr_reader :fraudulent + # Attribute for field merchandise_not_as_described + attr_reader :merchandise_not_as_described + # Attribute for field no_valid_authorization + attr_reader :no_valid_authorization + # Attribute for field not_received + attr_reader :not_received + # Attribute for field other + attr_reader :other + # The reason for filing the dispute. Its value will match the field containing the evidence. + attr_reader :reason + # Attribute for field service_not_as_described + attr_reader :service_not_as_described + end + + class Treasury < Stripe::StripeObject + # The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute + attr_reader :debit_reversal + # The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. + attr_reader :received_debit + end + # Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). + attr_reader :amount + + # List of balance transactions associated with the dispute. + attr_reader :balance_transactions + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The currency the `transaction` was made in. + attr_reader :currency + + # Attribute for field evidence + attr_reader :evidence + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values. + attr_reader :loss_reason + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Current status of the dispute. + attr_reader :status + + # The transaction being disputed. + attr_reader :transaction + + # [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + attr_reader :treasury + # Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/dispute_settlement_detail.rb b/lib/stripe/resources/issuing/dispute_settlement_detail.rb index e2c94dca9..8fa27fbca 100644 --- a/lib/stripe/resources/issuing/dispute_settlement_detail.rb +++ b/lib/stripe/resources/issuing/dispute_settlement_detail.rb @@ -12,6 +12,39 @@ def self.object_name "issuing.dispute_settlement_detail" end + # Disputed amount in the card’s currency and in the smallest currency unit. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). + attr_reader :amount + + # The card used to make the original transaction. + attr_reader :card + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The currency the original transaction was made in. 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). + attr_reader :currency + + # The ID of the linked dispute. + attr_reader :dispute + + # The type of event corresponding to this dispute settlement detail, representing the stage in the dispute network lifecycle. + attr_reader :event_type + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The card network for this dispute settlement detail. One of ["visa", "mastercard", "maestro"] + attr_reader :network + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ID of the linked card network settlement. + attr_reader :settlement + # Returns a list of Issuing DisputeSettlementDetail objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/fraud_liability_debit.rb b/lib/stripe/resources/issuing/fraud_liability_debit.rb index d81d7c61e..1092373fe 100644 --- a/lib/stripe/resources/issuing/fraud_liability_debit.rb +++ b/lib/stripe/resources/issuing/fraud_liability_debit.rb @@ -12,6 +12,30 @@ def self.object_name "issuing.fraud_liability_debit" end + # Debited amount. This is equal to the disputed amount and is given in the card’s currency and in the smallest currency unit. + attr_reader :amount + + # ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this debit. + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The currency of the debit. 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). + attr_reader :currency + + # The ID of the linked dispute. + attr_reader :dispute + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + # Returns a list of Issuing FraudLiabilityDebit objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/personalization_design.rb b/lib/stripe/resources/issuing/personalization_design.rb index 37d00f50a..d5512f2c7 100644 --- a/lib/stripe/resources/issuing/personalization_design.rb +++ b/lib/stripe/resources/issuing/personalization_design.rb @@ -14,6 +14,69 @@ def self.object_name "issuing.personalization_design" end + class CarrierText < Stripe::StripeObject + # The footer body text of the carrier letter. + attr_reader :footer_body + # The footer title text of the carrier letter. + attr_reader :footer_title + # The header body text of the carrier letter. + attr_reader :header_body + # The header title text of the carrier letter. + attr_reader :header_title + end + + class Preferences < Stripe::StripeObject + # Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + attr_reader :is_default + # Whether this personalization design is used to create cards when one is not specified and a default for this connected account does not exist. + attr_reader :is_platform_default + end + + class RejectionReasons < Stripe::StripeObject + # The reason(s) the card logo was rejected. + attr_reader :card_logo + # The reason(s) the carrier text was rejected. + attr_reader :carrier_text + end + # The file for the card logo to use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + attr_reader :card_logo + + # Hash containing carrier text, for use with physical bundles that support carrier text. + attr_reader :carrier_text + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + attr_reader :lookup_key + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Friendly display name. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The physical bundle object belonging to this personalization design. + attr_reader :physical_bundle + + # Attribute for field preferences + attr_reader :preferences + + # Attribute for field rejection_reasons + attr_reader :rejection_reasons + + # Whether this personalization design can be used to create cards. + attr_reader :status + # Creates a personalization design object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/physical_bundle.rb b/lib/stripe/resources/issuing/physical_bundle.rb index 890eab761..5c994e9b0 100644 --- a/lib/stripe/resources/issuing/physical_bundle.rb +++ b/lib/stripe/resources/issuing/physical_bundle.rb @@ -12,6 +12,35 @@ def self.object_name "issuing.physical_bundle" end + class Features < Stripe::StripeObject + # The policy for how to use card logo images in a card design with this physical bundle. + attr_reader :card_logo + # The policy for how to use carrier letter text in a card design with this physical bundle. + attr_reader :carrier_text + # The policy for how to use a second line on a card with this physical bundle. + attr_reader :second_line + end + # Attribute for field features + attr_reader :features + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Friendly display name. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Whether this physical bundle can be used to create cards. + attr_reader :status + + # Whether this physical bundle is a standard Stripe offering or custom-made for you. + attr_reader :type + # Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/issuing/settlement.rb b/lib/stripe/resources/issuing/settlement.rb new file mode 100644 index 000000000..400cc26be --- /dev/null +++ b/lib/stripe/resources/issuing/settlement.rb @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + module Issuing + # When a non-stripe BIN is used, any use of an [issued card](https://stripe.com/docs/issuing) must be settled directly with the card network. The net amount owed is represented by an Issuing `Settlement` object. + class Settlement < APIResource + OBJECT_NAME = "issuing.settlement" + def self.object_name + "issuing.settlement" + end + + # The Bank Identification Number reflecting this settlement record. + attr_reader :bin + + # The date that the transactions are cleared and posted to user's accounts. + attr_reader :clearing_date + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Unique identifier for the object. + attr_reader :id + + # The total interchange received as reimbursement for the transactions. + attr_reader :interchange_fees + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The total net amount required to settle with the network. + attr_reader :net_total + + # The card network for this settlement report. One of ["visa", "maestro"] + attr_reader :network + + # The total amount of fees owed to the network. + attr_reader :network_fees + + # The Settlement Identification Number assigned by the network. + attr_reader :network_settlement_identifier + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # One of `international` or `uk_national_net`. + attr_reader :settlement_service + + # The current processing status of this settlement. + attr_reader :status + + # The total number of transactions reflected in this settlement. + attr_reader :transaction_count + + # The total transaction amount reflected in this settlement. + attr_reader :transaction_volume + end + end +end diff --git a/lib/stripe/resources/issuing/token.rb b/lib/stripe/resources/issuing/token.rb index 58bc8916a..5ec8cb2cf 100644 --- a/lib/stripe/resources/issuing/token.rb +++ b/lib/stripe/resources/issuing/token.rb @@ -13,6 +13,119 @@ def self.object_name "issuing.token" end + class NetworkData < Stripe::StripeObject + class Device < Stripe::StripeObject + # An obfuscated ID derived from the device ID. + attr_reader :device_fingerprint + # The IP address of the device at provisioning time. + attr_reader :ip_address + # The geographic latitude/longitude coordinates of the device at provisioning time. The format is [+-]decimal/[+-]decimal. + attr_reader :location + # The name of the device used for tokenization. + attr_reader :name + # The phone number of the device used for tokenization. + attr_reader :phone_number + # The type of device used for tokenization. + attr_reader :type + end + + class Mastercard < Stripe::StripeObject + # A unique reference ID from MasterCard to represent the card account number. + attr_reader :card_reference_id + # The network-unique identifier for the token. + attr_reader :token_reference_id + # The ID of the entity requesting tokenization, specific to MasterCard. + attr_reader :token_requestor_id + # The name of the entity requesting tokenization, if known. This is directly provided from MasterCard. + attr_reader :token_requestor_name + end + + class Visa < Stripe::StripeObject + # A unique reference ID from Visa to represent the card account number. + attr_reader :card_reference_id + # The network-unique identifier for the token. + attr_reader :token_reference_id + # The ID of the entity requesting tokenization, specific to Visa. + attr_reader :token_requestor_id + # Degree of risk associated with the token between `01` and `99`, with higher number indicating higher risk. A `00` value indicates the token was not scored by Visa. + attr_reader :token_risk_score + end + + class WalletProvider < Stripe::StripeObject + class CardholderAddress < Stripe::StripeObject + # The street address of the cardholder tokenizing the card. + attr_reader :line1 + # The postal code of the cardholder tokenizing the card. + attr_reader :postal_code + end + # The wallet provider-given account ID of the digital wallet the token belongs to. + attr_reader :account_id + # An evaluation on the trustworthiness of the wallet account between 1 and 5. A higher score indicates more trustworthy. + attr_reader :account_trust_score + # The method used for tokenizing a card. + attr_reader :card_number_source + # Attribute for field cardholder_address + attr_reader :cardholder_address + # The name of the cardholder tokenizing the card. + attr_reader :cardholder_name + # An evaluation on the trustworthiness of the device. A higher score indicates more trustworthy. + attr_reader :device_trust_score + # The hashed email address of the cardholder's account with the wallet provider. + attr_reader :hashed_account_email_address + # The reasons for suggested tokenization given by the card network. + attr_reader :reason_codes + # The recommendation on responding to the tokenization request. + attr_reader :suggested_decision + # The version of the standard for mapping reason codes followed by the wallet provider. + attr_reader :suggested_decision_version + end + # Attribute for field device + attr_reader :device + # Attribute for field mastercard + attr_reader :mastercard + # The network that the token is associated with. An additional hash is included with a name matching this value, containing tokenization data specific to the card network. + attr_reader :type + # Attribute for field visa + attr_reader :visa + # Attribute for field wallet_provider + attr_reader :wallet_provider + end + # Card associated with this token. + attr_reader :card + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The hashed ID derived from the device ID from the card network associated with the token. + attr_reader :device_fingerprint + + # Unique identifier for the object. + attr_reader :id + + # The last four digits of the token. + attr_reader :last4 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The token service provider / card network associated with the token. + attr_reader :network + + # Attribute for field network_data + attr_reader :network_data + + # Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. + attr_reader :network_updated_at + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The usage state of the token. + attr_reader :status + + # The digital wallet for this token, if one was used. + attr_reader :wallet_provider + # Lists all Issuing Token objects for a given card. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/issuing/tokens", params: filters, opts: opts) diff --git a/lib/stripe/resources/issuing/transaction.rb b/lib/stripe/resources/issuing/transaction.rb index fa11249de..23bda1310 100644 --- a/lib/stripe/resources/issuing/transaction.rb +++ b/lib/stripe/resources/issuing/transaction.rb @@ -17,6 +17,240 @@ def self.object_name "issuing.transaction" end + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + attr_reader :cashback_amount + end + + class MerchantData < Stripe::StripeObject + # A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + attr_reader :category + # The merchant category code for the seller’s business + attr_reader :category_code + # City where the seller is located + attr_reader :city + # Country where the seller is located + attr_reader :country + # Name of the seller + attr_reader :name + # Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + attr_reader :network_id + # Postal code where the seller is located + attr_reader :postal_code + # State where the seller is located + attr_reader :state + # An ID assigned by the seller to the location of the sale. + attr_reader :terminal_id + # URL provided by the merchant on a 3DS request + attr_reader :url + end + + class NetworkData < Stripe::StripeObject + # A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. + attr_reader :authorization_code + # The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. + attr_reader :processing_date + # Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + attr_reader :transaction_id + end + + class PurchaseDetails < Stripe::StripeObject + class Fleet < Stripe::StripeObject + class CardholderPromptData < Stripe::StripeObject + # Driver ID. + attr_reader :driver_id + # Odometer reading. + attr_reader :odometer + # An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + attr_reader :unspecified_id + # User ID. + attr_reader :user_id + # Vehicle number. + attr_reader :vehicle_number + end + + class ReportedBreakdown < Stripe::StripeObject + class Fuel < Stripe::StripeObject + # Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + attr_reader :gross_amount_decimal + end + + class NonFuel < Stripe::StripeObject + # Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + attr_reader :gross_amount_decimal + end + + class Tax < Stripe::StripeObject + # Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + attr_reader :local_amount_decimal + # Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + attr_reader :national_amount_decimal + end + # Breakdown of fuel portion of the purchase. + attr_reader :fuel + # Breakdown of non-fuel portion of the purchase. + attr_reader :non_fuel + # Information about tax included in this transaction. + attr_reader :tax + end + # Answers to prompts presented to cardholder at point of sale. + attr_reader :cardholder_prompt_data + # The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + attr_reader :purchase_type + # More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + attr_reader :reported_breakdown + # The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + attr_reader :service_type + end + + class Flight < Stripe::StripeObject + class Segment < Stripe::StripeObject + # The three-letter IATA airport code of the flight's destination. + attr_reader :arrival_airport_code + # The airline carrier code. + attr_reader :carrier + # The three-letter IATA airport code that the flight departed from. + attr_reader :departure_airport_code + # The flight number. + attr_reader :flight_number + # The flight's service class. + attr_reader :service_class + # Whether a stopover is allowed on this flight. + attr_reader :stopover_allowed + end + # The time that the flight departed. + attr_reader :departure_at + # The name of the passenger. + attr_reader :passenger_name + # Whether the ticket is refundable. + attr_reader :refundable + # The legs of the trip. + attr_reader :segments + # The travel agency that issued the ticket. + attr_reader :travel_agency + end + + class Fuel < Stripe::StripeObject + # [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + attr_reader :industry_product_code + # The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + attr_reader :quantity_decimal + # The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + attr_reader :type + # The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. + attr_reader :unit + # The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + attr_reader :unit_cost_decimal + end + + class Lodging < Stripe::StripeObject + # The time of checking into the lodging. + attr_reader :check_in_at + # The number of nights stayed at the lodging. + attr_reader :nights + end + + class Receipt < Stripe::StripeObject + # The description of the item. The maximum length of this field is 26 characters. + attr_reader :description + # The quantity of the item. + attr_reader :quantity + # The total for this line item in cents. + attr_reader :total + # The unit cost of the item in cents. + attr_reader :unit_cost + end + # Fleet-specific information for transactions using Fleet cards. + attr_reader :fleet + # Information about the flight that was purchased with this transaction. + attr_reader :flight + # Information about fuel that was purchased with this transaction. + attr_reader :fuel + # Information about lodging that was purchased with this transaction. + attr_reader :lodging + # The line items in the purchase. + attr_reader :receipt + # A merchant-specific order number. + attr_reader :reference + end + + class Treasury < Stripe::StripeObject + # The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund + attr_reader :received_credit + # The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture + attr_reader :received_debit + end + # The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_details + + # The `Authorization` object that led to this transaction. + attr_reader :authorization + + # ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. + attr_reader :balance_transaction + + # The card used to make this transaction. + attr_reader :card + + # The cardholder to whom this transaction belongs. + attr_reader :cardholder + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # If you've disputed the transaction, the ID of the dispute. + attr_reader :dispute + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency. + attr_reader :merchant_amount + + # The currency with which the merchant is taking payment. + attr_reader :merchant_currency + + # Attribute for field merchant_data + attr_reader :merchant_data + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Details about the transaction, such as processing dates, set by the card network. + attr_reader :network_data + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Additional purchase information that is optionally provided by the merchant. + attr_reader :purchase_details + + # Attribute for field settlement + attr_reader :settlement + + # [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null. + attr_reader :token + + # [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + attr_reader :treasury + + # The nature of the transaction. + attr_reader :type + + # The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. + attr_reader :wallet + # Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/line_item.rb b/lib/stripe/resources/line_item.rb index 80d71f2ab..65db1431a 100644 --- a/lib/stripe/resources/line_item.rb +++ b/lib/stripe/resources/line_item.rb @@ -8,5 +8,95 @@ class LineItem < APIResource def self.object_name "item" end + + class AdjustableQuantity < Stripe::StripeObject + # Attribute for field enabled + attr_reader :enabled + # Attribute for field maximum + attr_reader :maximum + # Attribute for field minimum + attr_reader :minimum + end + + class Discount < Stripe::StripeObject + # The amount discounted. + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + attr_reader :discount + end + + class Display < Stripe::StripeObject + # Attribute for field description + attr_reader :description + # Attribute for field images + attr_reader :images + # Attribute for field name + attr_reader :name + end + + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # Attribute for field adjustable_quantity + attr_reader :adjustable_quantity + + # Total discount amount applied. If no discounts were applied, defaults to 0. + attr_reader :amount_discount + + # Total before any discounts or taxes are applied. + attr_reader :amount_subtotal + + # Total tax amount applied. If no tax was applied, defaults to 0. + attr_reader :amount_tax + + # Total after discounts and taxes. + attr_reader :amount_total + + # 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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. + attr_reader :description + + # The discounts applied to the line item. + attr_reader :discounts + + # Attribute for field display + attr_reader :display + + # Unique identifier for the object. + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The price used to generate the line item. + attr_reader :price + + # The ID of the product for this line item. + # + # This will always be the same as `price.product`. + attr_reader :product + + # The quantity of products being purchased. + attr_reader :quantity + + # The taxes applied to the line item. + attr_reader :taxes end end diff --git a/lib/stripe/resources/login_link.rb b/lib/stripe/resources/login_link.rb index 813225126..268beef08 100644 --- a/lib/stripe/resources/login_link.rb +++ b/lib/stripe/resources/login_link.rb @@ -9,6 +9,15 @@ def self.object_name "login_link" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The URL for the login link. + attr_reader :url + def self.retrieve(_id, _opts = nil) raise NotImplementedError, "Login links do not have IDs and cannot be retrieved. They can " \ diff --git a/lib/stripe/resources/mandate.rb b/lib/stripe/resources/mandate.rb index 5a3df47f3..54037a6a6 100644 --- a/lib/stripe/resources/mandate.rb +++ b/lib/stripe/resources/mandate.rb @@ -8,5 +8,175 @@ class Mandate < APIResource def self.object_name "mandate" end + + class CustomerAcceptance < Stripe::StripeObject + class Offline < Stripe::StripeObject; end + + class Online < Stripe::StripeObject + # The customer accepts the mandate from this IP address. + attr_reader :ip_address + # The customer accepts the mandate using the user agent of the browser. + attr_reader :user_agent + end + # The time that the customer accepts the mandate. + attr_reader :accepted_at + # Attribute for field offline + attr_reader :offline + # Attribute for field online + attr_reader :online + # The mandate includes the type of customer acceptance information, such as: `online` or `offline`. + attr_reader :type + end + + class MultiUse < Stripe::StripeObject; end + + class PaymentMethodDetails < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + # List of Stripe products where this mandate can be selected automatically. + attr_reader :default_for + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + attr_reader :interval_description + # Payment schedule for the mandate. + attr_reader :payment_schedule + # Transaction type of the mandate. + attr_reader :transaction_type + end + + class AmazonPay < Stripe::StripeObject; end + + class AuBecsDebit < Stripe::StripeObject + # The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. + attr_reader :url + end + + class BacsDebit < Stripe::StripeObject + # The status of the mandate on the Bacs network. Can be one of `pending`, `revoked`, `refused`, or `accepted`. + attr_reader :network_status + # The unique reference identifying the mandate on the Bacs network. + attr_reader :reference + # When the mandate is revoked on the Bacs network this field displays the reason for the revocation. + attr_reader :revocation_reason + # The URL that will contain the mandate that the customer has signed. + attr_reader :url + end + + class Card < Stripe::StripeObject; end + class Cashapp < Stripe::StripeObject; end + class KakaoPay < Stripe::StripeObject; end + class KrCard < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + + class Paypal < Stripe::StripeObject + # The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + attr_reader :billing_agreement_id + # Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + attr_reader :fingerprint + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + attr_reader :payer_id + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_email + end + + class Payto < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + attr_reader :end_date + # The periodicity at which payments will be collected. + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + attr_reader :purpose + # Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + attr_reader :start_date + end + + class RevolutPay < Stripe::StripeObject; end + + class SepaDebit < Stripe::StripeObject + # The unique reference of the mandate. + attr_reader :reference + # The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. + attr_reader :url + end + + class UsBankAccount < Stripe::StripeObject + # Mandate collection method + attr_reader :collection_method + end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field card + attr_reader :card + # Attribute for field cashapp + attr_reader :cashapp + # Attribute for field kakao_pay + attr_reader :kakao_pay + # Attribute for field kr_card + attr_reader :kr_card + # Attribute for field link + attr_reader :link + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field revolut_pay + attr_reader :revolut_pay + # Attribute for field sepa_debit + attr_reader :sepa_debit + # This mandate corresponds with a specific payment method type. The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class SingleUse < Stripe::StripeObject + # The amount of the payment on a single use mandate. + attr_reader :amount + # The currency of the payment on a single use mandate. + attr_reader :currency + end + # Attribute for field customer_acceptance + attr_reader :customer_acceptance + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Attribute for field multi_use + attr_reader :multi_use + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) that the mandate is intended for. + attr_reader :on_behalf_of + + # ID of the payment method associated with this mandate. + attr_reader :payment_method + + # Attribute for field payment_method_details + attr_reader :payment_method_details + + # Attribute for field single_use + attr_reader :single_use + + # The mandate status indicates whether or not you can use it to initiate a payment. + attr_reader :status + + # The type of the mandate. + attr_reader :type end end diff --git a/lib/stripe/resources/margin.rb b/lib/stripe/resources/margin.rb index 36f6cfdff..53f04f187 100644 --- a/lib/stripe/resources/margin.rb +++ b/lib/stripe/resources/margin.rb @@ -14,6 +14,33 @@ def self.object_name "margin" end + # Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. + attr_reader :active + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Name of the margin that's displayed on, for example, invoices. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + attr_reader :percent_off + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + attr_reader :updated + # Create a margin object to be used with invoices, invoice items, and invoice line items for a customer to represent a partner discount. A margin has a percent_off which is the percent that will be taken off the subtotal after all items and other discounts and promotions) of any invoices for a customer. Calculation of prorations do not include any partner margins applied on the original invoice item. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/billing/margins", params: params, opts: opts) diff --git a/lib/stripe/resources/order.rb b/lib/stripe/resources/order.rb index e4d5c23f0..d59a6b32a 100644 --- a/lib/stripe/resources/order.rb +++ b/lib/stripe/resources/order.rb @@ -17,6 +17,563 @@ def self.object_name "order" end + class AutomaticTax < Stripe::StripeObject + # Whether Stripe automatically computes tax on this Order. + attr_reader :enabled + # The status of the most recent automated tax calculation for this Order. + attr_reader :status + end + + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Billing address for the order. + attr_reader :address + # Email address for the order. + attr_reader :email + # Full name for the order. + attr_reader :name + # Billing phone number for the order (including extension). + attr_reader :phone + end + + class Credit < Stripe::StripeObject + class GiftCard < Stripe::StripeObject + # The token of the gift card applied to the order + attr_reader :card + end + # The amount of this credit to apply to the order. + attr_reader :amount + # Details for a gift card. + attr_reader :gift_card + # Line items on this order that are ineligible for this credit + attr_reader :ineligible_line_items + # The type of credit to apply to the order, only `gift_card` currently supported. + attr_reader :type + end + + class Payment < Stripe::StripeObject + class Settings < Stripe::StripeObject + class AutomaticPaymentMethods < Stripe::StripeObject + # Whether this Order has been opted into managing payment method types via the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + attr_reader :enabled + end + + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + attr_reader :custom_mandate_url + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + attr_reader :interval_description + # Payment schedule for the mandate. + attr_reader :payment_schedule + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Bank account verification method. + attr_reader :verification_method + end + + class AfterpayClearpay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + attr_reader :reference + # Indicates that you intend to make future payments with the payment method. + # + # Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + # + # 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). + # + # If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + attr_reader :setup_future_usage + end + + class Alipay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Card < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with the payment method. + # + # Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + # + # 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). + # + # If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + attr_reader :setup_future_usage + end + + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + attr_reader :country + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + # + # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + attr_reader :requested_address_types + # The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + attr_reader :funding_type + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Ideal < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Klarna < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Preferred locale of the Klarna checkout page that the customer is redirected to. + attr_reader :preferred_locale + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Link < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # [Deprecated] This is a legacy parameter that no longer has any function. + attr_reader :persistent_token + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Oxxo < Stripe::StripeObject + # The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class P24 < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Paypal < Stripe::StripeObject + class LineItem < Stripe::StripeObject + class Tax < Stripe::StripeObject + # The tax for a single unit of the line item in minor units. Cannot be a negative number. + attr_reader :amount + # The tax behavior for the line item. + attr_reader :behavior + end + # Type of the line item. + attr_reader :category + # Description of the line item. + attr_reader :description + # Descriptive name of the line item. + attr_reader :name + # Quantity of the line item. Cannot be a negative number. + attr_reader :quantity + # Client facing stock keeping unit, article number or similar. + attr_reader :sku + # The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + attr_reader :sold_by + # Attribute for field tax + attr_reader :tax + # Price for a single unit of the line item in minor units. Cannot be a negative number. + attr_reader :unit_amount + end + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # The line items purchased by the customer. + attr_reader :line_items + # Preferred locale of the PayPal checkout page that the customer is redirected to. + attr_reader :preferred_locale + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + attr_reader :reference + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + attr_reader :reference_id + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + attr_reader :subsellers + end + + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Sofort < Stripe::StripeObject + # Preferred language of the SOFORT authorization page that the customer is redirected to. + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class WechatPay < Stripe::StripeObject + # The app ID registered with WeChat Pay. Only required when client is ios or android. + attr_reader :app_id + # The client type that the end customer will pay from + attr_reader :client + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + # Attribute for field alipay + attr_reader :alipay + # Attribute for field bancontact + attr_reader :bancontact + # Attribute for field card + attr_reader :card + # Attribute for field customer_balance + attr_reader :customer_balance + # Attribute for field ideal + attr_reader :ideal + # Attribute for field klarna + attr_reader :klarna + # Attribute for field link + attr_reader :link + # Attribute for field oxxo + attr_reader :oxxo + # Attribute for field p24 + attr_reader :p24 + # Attribute for field paypal + attr_reader :paypal + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field sofort + attr_reader :sofort + # Attribute for field wechat_pay + attr_reader :wechat_pay + end + + class TransferData < Stripe::StripeObject + # The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + attr_reader :amount + # ID of the Connected account receiving the transfer. + attr_reader :destination + end + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + attr_reader :application_fee_amount + # Indicates whether order has been opted into using [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) to manage payment method types. + attr_reader :automatic_payment_methods + # PaymentMethod-specific configuration to provide to the order's PaymentIntent. + attr_reader :payment_method_options + # The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + attr_reader :payment_method_types + # The URL to redirect the customer to after they authenticate their payment. + attr_reader :return_url + # For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + attr_reader :statement_descriptor + # Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + attr_reader :statement_descriptor_suffix + # Provides configuration for completing a transfer for the order after it is paid. + attr_reader :transfer_data + end + # ID of the payment intent associated with this order. Null when the order is `open`. + attr_reader :payment_intent + # Settings describing how the order should configure generated PaymentIntents. + attr_reader :settings + # The status of the underlying payment associated with this order, if any. Null when the order is `open`. + attr_reader :status + end + + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # Total shipping cost before any discounts or taxes are applied. + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + attr_reader :amount_tax + # Total shipping cost after discounts and taxes are applied. + attr_reader :amount_total + # The ID of the ShippingRate for this order. + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + attr_reader :taxes + end + + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Recipient shipping address. Required if the order includes products that are shippable. + attr_reader :address + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + end + + class TaxDetails < Stripe::StripeObject + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + # Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + attr_reader :tax_exempt + # The purchaser's tax IDs to be used in calculation of tax for this Order. + attr_reader :tax_ids + end + + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + attr_reader :discount + end + + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The aggregated discounts. + attr_reader :discounts + # The aggregated tax amounts by rate. + attr_reader :taxes + end + # Attribute for field amount_credit + attr_reader :amount_credit + # This is the sum of all the discounts. + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + attr_reader :amount_tax + # Attribute for field breakdown + attr_reader :breakdown + end + # Attribute for field amount_remaining + attr_reader :amount_remaining + + # Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + attr_reader :amount_subtotal + + # Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + attr_reader :amount_total + + # ID of the Connect application that created the Order, if any. + attr_reader :application + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # Customer billing details associated with the order. + attr_reader :billing_details + + # The client secret of this Order. Used for client-side retrieval using a publishable key. + # + # The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + # + # Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. + attr_reader :client_secret + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The credits applied to the Order. At most 10 credits can be applied to an Order. + attr_reader :credits + + # 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). + attr_reader :currency + + # The customer which this orders belongs to. + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # The discounts applied to the order. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # Unique identifier for the object. + attr_reader :id + + # A recent IP address of the purchaser used for tax reporting and tax location inference. + attr_reader :ip_address + + # A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field payment + attr_reader :payment + + # The details of the customer cost of shipping, including the customer chosen ShippingRate. + attr_reader :shipping_cost + + # Customer shipping information associated with the order. + attr_reader :shipping_details + + # The overall status of the order. + attr_reader :status + + # Attribute for field tax_details + attr_reader :tax_details + + # Attribute for field total_details + attr_reader :total_details + # Cancels the order as well as the payment intent if one is attached. def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/payment_attempt_record.rb b/lib/stripe/resources/payment_attempt_record.rb index dc97cc8bf..2efa232a4 100644 --- a/lib/stripe/resources/payment_attempt_record.rb +++ b/lib/stripe/resources/payment_attempt_record.rb @@ -14,6 +14,157 @@ def self.object_name "payment_attempt_record" end + class AmountCanceled < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountFailed < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountGuaranteed < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountRequested < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class CustomerDetails < Stripe::StripeObject + # ID of the Stripe Customer associated with this payment. + attr_reader :customer + # The customer's email address. + attr_reader :email + # The customer's name. + attr_reader :name + # The customer's phone number. + attr_reader :phone + end + + class PaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # A representation of a physical address. + attr_reader :address + # The billing email associated with the method of payment. + attr_reader :email + # The billing name associated with the method of payment. + attr_reader :name + # The billing phone number associated with the method of payment. + attr_reader :phone + end + + class Custom < Stripe::StripeObject + # Display name for the custom (user-defined) payment method type used to make this payment. + attr_reader :display_name + # The custom payment method type associated with this payment. + attr_reader :type + end + # The billing details associated with the method of payment. + attr_reader :billing_details + # Information about the custom (user-defined) payment method used to make this payment. + attr_reader :custom + # ID of the Stripe PaymentMethod used to make this payment. + attr_reader :payment_method + # The type of Payment Method used for this payment attempt. + attr_reader :type + end + + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # A representation of a physical address. + attr_reader :address + # The shipping recipient's name. + attr_reader :name + # The shipping recipient's phone number. + attr_reader :phone + end + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_canceled + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_failed + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_guaranteed + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_requested + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Customer information for this payment. + attr_reader :customer_details + + # Indicates whether the customer was present in your checkout flow during this payment. + attr_reader :customer_presence + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Information about the Payment Method debited for this payment. + attr_reader :payment_method_details + + # ID of the Payment Record this Payment Attempt Record belongs to. + attr_reader :payment_record + + # An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + attr_reader :payment_reference + + # Shipping information for this payment. + attr_reader :shipping_details + # List all the Payment Attempt Records attached to the specified Payment Record. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/payment_intent.rb b/lib/stripe/resources/payment_intent.rb index 627026581..57f377314 100644 --- a/lib/stripe/resources/payment_intent.rb +++ b/lib/stripe/resources/payment_intent.rb @@ -24,6 +24,1977 @@ def self.object_name "payment_intent" end + class AmountDetails < Stripe::StripeObject + class Tip < Stripe::StripeObject + # Portion of the amount that corresponds to a tip. + attr_reader :amount + end + # Attribute for field tip + attr_reader :tip + end + + class AsyncWorkflows < Stripe::StripeObject + class Inputs < Stripe::StripeObject + class Tax < Stripe::StripeObject + # The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + attr_reader :calculation + end + # Attribute for field tax + attr_reader :tax + end + # Attribute for field inputs + attr_reader :inputs + end + + class AutomaticPaymentMethods < Stripe::StripeObject + # Controls whether this PaymentIntent will accept redirect-based payment methods. + # + # Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + attr_reader :allow_redirects + # Automatically calculates compatible payment methods + attr_reader :enabled + end + + class LastPaymentError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + attr_reader :setup_intent + # Attribute for field source + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + attr_reader :type + end + + class NextAction < Stripe::StripeObject + class AlipayHandleRedirect < Stripe::StripeObject + # The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. + attr_reader :native_data + # The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. + attr_reader :native_url + # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + attr_reader :return_url + # The URL you must redirect your customer to in order to authenticate the payment. + attr_reader :url + end + + class BoletoDisplayDetails < Stripe::StripeObject + # The timestamp after which the boleto expires. + attr_reader :expires_at + # The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. + attr_reader :hosted_voucher_url + # The boleto number. + attr_reader :number + # The URL to the downloadable boleto voucher PDF. + attr_reader :pdf + end + + class CardAwaitNotification < Stripe::StripeObject + # The time that payment will be attempted. If customer approval is required, they need to provide approval before this time. + attr_reader :charge_attempt_at + # 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. + attr_reader :customer_approval_required + end + + class CashappHandleRedirectOrDisplayQrCode < Stripe::StripeObject + class QrCode < Stripe::StripeObject + # The date (unix timestamp) when the QR code expires. + attr_reader :expires_at + # The image_url_png string used to render QR code + attr_reader :image_url_png + # The image_url_svg string used to render QR code + attr_reader :image_url_svg + end + # The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + attr_reader :hosted_instructions_url + # The url for mobile redirect based auth + attr_reader :mobile_auth_url + # Attribute for field qr_code + attr_reader :qr_code + end + + class DisplayBankTransferInstructions < Stripe::StripeObject + class FinancialAddress < Stripe::StripeObject + class Aba < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # The ABA account number + attr_reader :account_number + # The account type + attr_reader :account_type + # Attribute for field bank_address + attr_reader :bank_address + # The bank name + attr_reader :bank_name + # The ABA routing number + attr_reader :routing_number + end + + class Iban < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + attr_reader :account_holder_name + # Attribute for field bank_address + attr_reader :bank_address + # The BIC/SWIFT code of the account. + attr_reader :bic + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # The IBAN of the account. + attr_reader :iban + end + + class SortCode < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + attr_reader :account_holder_name + # The account number + attr_reader :account_number + # Attribute for field bank_address + attr_reader :bank_address + # The six-digit sort code + attr_reader :sort_code + end + + class Spei < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # Attribute for field bank_address + attr_reader :bank_address + # The three-digit bank code + attr_reader :bank_code + # The short banking institution name + attr_reader :bank_name + # The CLABE number + attr_reader :clabe + end + + class Swift < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # The account number + attr_reader :account_number + # The account type + attr_reader :account_type + # Attribute for field bank_address + attr_reader :bank_address + # The bank name + attr_reader :bank_name + # The SWIFT code + attr_reader :swift_code + end + + class Zengin < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field account_holder_address + attr_reader :account_holder_address + # The account holder name + attr_reader :account_holder_name + # The account number + attr_reader :account_number + # The bank account type. In Japan, this can only be `futsu` or `toza`. + attr_reader :account_type + # Attribute for field bank_address + attr_reader :bank_address + # The bank code of the account + attr_reader :bank_code + # The bank name of the account + attr_reader :bank_name + # The branch code of the account + attr_reader :branch_code + # The branch name of the account + attr_reader :branch_name + end + # ABA Records contain U.S. bank account details per the ABA format. + attr_reader :aba + # Iban Records contain E.U. bank account details per the SEPA format. + attr_reader :iban + # Sort Code Records contain U.K. bank account details per the sort code format. + attr_reader :sort_code + # SPEI Records contain Mexico bank account details per the SPEI format. + attr_reader :spei + # The payment networks supported by this FinancialAddress + attr_reader :supported_networks + # SWIFT Records contain U.S. bank account details per the SWIFT format. + attr_reader :swift + # The type of financial address + attr_reader :type + # Zengin Records contain Japan bank account details per the Zengin format. + attr_reader :zengin + end + # The remaining amount that needs to be transferred to complete the payment. + attr_reader :amount_remaining + # 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). + attr_reader :currency + # A list of financial addresses that can be used to fund the customer balance + attr_reader :financial_addresses + # A link to a hosted page that guides your customer through completing the transfer. + attr_reader :hosted_instructions_url + # A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. + attr_reader :reference + # Type of bank transfer + attr_reader :type + end + + class KonbiniDisplayDetails < Stripe::StripeObject + class Stores < Stripe::StripeObject + class Familymart < Stripe::StripeObject + # The confirmation number. + attr_reader :confirmation_number + # The payment code. + attr_reader :payment_code + end + + class Lawson < Stripe::StripeObject + # The confirmation number. + attr_reader :confirmation_number + # The payment code. + attr_reader :payment_code + end + + class Ministop < Stripe::StripeObject + # The confirmation number. + attr_reader :confirmation_number + # The payment code. + attr_reader :payment_code + end + + class Seicomart < Stripe::StripeObject + # The confirmation number. + attr_reader :confirmation_number + # The payment code. + attr_reader :payment_code + end + # FamilyMart instruction details. + attr_reader :familymart + # Lawson instruction details. + attr_reader :lawson + # Ministop instruction details. + attr_reader :ministop + # Seicomart instruction details. + attr_reader :seicomart + end + # The timestamp at which the pending Konbini payment expires. + attr_reader :expires_at + # The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. + attr_reader :hosted_voucher_url + # Attribute for field stores + attr_reader :stores + end + + class MultibancoDisplayDetails < Stripe::StripeObject + # Entity number associated with this Multibanco payment. + attr_reader :entity + # The timestamp at which the Multibanco voucher expires. + attr_reader :expires_at + # The URL for the hosted Multibanco voucher page, which allows customers to view a Multibanco voucher. + attr_reader :hosted_voucher_url + # Reference number associated with this Multibanco payment. + attr_reader :reference + end + + class OxxoDisplayDetails < Stripe::StripeObject + # The timestamp after which the OXXO voucher expires. + attr_reader :expires_after + # The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. + attr_reader :hosted_voucher_url + # OXXO reference number. + attr_reader :number + end + + class PaynowDisplayQrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + attr_reader :data + # The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. + attr_reader :hosted_instructions_url + # The image_url_png string used to render QR code + attr_reader :image_url_png + # The image_url_svg string used to render QR code + attr_reader :image_url_svg + end + + class PixDisplayQrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + attr_reader :data + # The date (unix timestamp) when the PIX expires. + attr_reader :expires_at + # The URL to the hosted pix instructions page, which allows customers to view the pix QR code. + attr_reader :hosted_instructions_url + # The image_url_png string used to render png QR code + attr_reader :image_url_png + # The image_url_svg string used to render svg QR code + attr_reader :image_url_svg + end + + class PromptpayDisplayQrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + attr_reader :data + # The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. + attr_reader :hosted_instructions_url + # The PNG path used to render the QR code, can be used as the source in an HTML img tag + attr_reader :image_url_png + # The SVG path used to render the QR code, can be used as the source in an HTML img tag + attr_reader :image_url_svg + end + + class RedirectToUrl < Stripe::StripeObject + # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + attr_reader :return_url + # The URL you must redirect your customer to in order to authenticate the payment. + attr_reader :url + end + + class SwishHandleRedirectOrDisplayQrCode < Stripe::StripeObject + class QrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + attr_reader :data + # The image_url_png string used to render QR code + attr_reader :image_url_png + # The image_url_svg string used to render QR code + attr_reader :image_url_svg + end + # The URL to the hosted Swish instructions page, which allows customers to view the QR code. + attr_reader :hosted_instructions_url + # The url for mobile redirect based auth (for internal use only and not typically available in standard API requests). + attr_reader :mobile_auth_url + # Attribute for field qr_code + attr_reader :qr_code + end + + class VerifyWithMicrodeposits < Stripe::StripeObject + # The timestamp when the microdeposits are expected to land. + attr_reader :arrival_date + # The URL for the hosted verification page, which allows customers to verify their bank account. + attr_reader :hosted_verification_url + # The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. + attr_reader :microdeposit_type + end + + class WechatPayDisplayQrCode < Stripe::StripeObject + # The data being used to generate QR code + attr_reader :data + # The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. + attr_reader :hosted_instructions_url + # The base64 image data for a pre-generated QR code + attr_reader :image_data_url + # The image_url_png string used to render QR code + attr_reader :image_url_png + # The image_url_svg string used to render QR code + attr_reader :image_url_svg + end + + class WechatPayRedirectToAndroidApp < Stripe::StripeObject + # app_id is the APP ID registered on WeChat open platform + attr_reader :app_id + # nonce_str is a random string + attr_reader :nonce_str + # package is static value + attr_reader :package + # an unique merchant ID assigned by WeChat Pay + attr_reader :partner_id + # an unique trading ID assigned by WeChat Pay + attr_reader :prepay_id + # A signature + attr_reader :sign + # Specifies the current time in epoch format + attr_reader :timestamp + end + + class WechatPayRedirectToIosApp < Stripe::StripeObject + # An universal link that redirect to WeChat Pay app + attr_reader :native_url + end + # Attribute for field alipay_handle_redirect + attr_reader :alipay_handle_redirect + # Attribute for field boleto_display_details + attr_reader :boleto_display_details + # Attribute for field card_await_notification + attr_reader :card_await_notification + # Attribute for field cashapp_handle_redirect_or_display_qr_code + attr_reader :cashapp_handle_redirect_or_display_qr_code + # Attribute for field display_bank_transfer_instructions + attr_reader :display_bank_transfer_instructions + # Attribute for field konbini_display_details + attr_reader :konbini_display_details + # Attribute for field multibanco_display_details + attr_reader :multibanco_display_details + # Attribute for field oxxo_display_details + attr_reader :oxxo_display_details + # Attribute for field paynow_display_qr_code + attr_reader :paynow_display_qr_code + # Attribute for field pix_display_qr_code + attr_reader :pix_display_qr_code + # Attribute for field promptpay_display_qr_code + attr_reader :promptpay_display_qr_code + # Attribute for field redirect_to_url + attr_reader :redirect_to_url + # Attribute for field swish_handle_redirect_or_display_qr_code + attr_reader :swish_handle_redirect_or_display_qr_code + # Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + attr_reader :type + # When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. + attr_reader :use_stripe_sdk + # Attribute for field verify_with_microdeposits + attr_reader :verify_with_microdeposits + # Attribute for field wechat_pay_display_qr_code + attr_reader :wechat_pay_display_qr_code + # Attribute for field wechat_pay_redirect_to_android_app + attr_reader :wechat_pay_redirect_to_android_app + # Attribute for field wechat_pay_redirect_to_ios_app + attr_reader :wechat_pay_redirect_to_ios_app + end + + class PaymentDetails < Stripe::StripeObject + class CarRental < Stripe::StripeObject + class Affiliate < Stripe::StripeObject + # The name of the affiliate that originated the purchase. + attr_reader :name + end + + class Delivery < Stripe::StripeObject + class Recipient < Stripe::StripeObject + # The email of the recipient the ticket is delivered to. + attr_reader :email + # The name of the recipient the ticket is delivered to. + attr_reader :name + # The phone number of the recipient the ticket is delivered to. + attr_reader :phone + end + # The delivery method for the payment + attr_reader :mode + # Attribute for field recipient + attr_reader :recipient + end + + class Driver < Stripe::StripeObject + # Full name of the driver on the reservation. + attr_reader :name + end + + class PickupAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ReturnAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field affiliate + attr_reader :affiliate + # The booking number associated with the car rental. + attr_reader :booking_number + # Class code of the car. + attr_reader :car_class_code + # Make of the car. + attr_reader :car_make + # Model of the car. + attr_reader :car_model + # The name of the rental car company. + attr_reader :company + # The customer service phone number of the car rental company. + attr_reader :customer_service_phone_number + # Number of days the car is being rented. + attr_reader :days_rented + # Attribute for field delivery + attr_reader :delivery + # The details of the drivers associated with the trip. + attr_reader :drivers + # List of additional charges being billed. + attr_reader :extra_charges + # Indicates if the customer did not keep nor cancel their booking. + attr_reader :no_show + # Attribute for field pickup_address + attr_reader :pickup_address + # Car pick-up time. Measured in seconds since the Unix epoch. + attr_reader :pickup_at + # Rental rate. + attr_reader :rate_amount + # The frequency at which the rate amount is applied. One of `day`, `week` or `month` + attr_reader :rate_interval + # The full name of the person or entity renting the car. + attr_reader :renter_name + # Attribute for field return_address + attr_reader :return_address + # Car return time. Measured in seconds since the Unix epoch. + attr_reader :return_at + # Indicates whether the goods or services are tax-exempt or tax is not collected. + attr_reader :tax_exempt + end + + class EventDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class Affiliate < Stripe::StripeObject + # The name of the affiliate that originated the purchase. + attr_reader :name + end + + class Delivery < Stripe::StripeObject + class Recipient < Stripe::StripeObject + # The email of the recipient the ticket is delivered to. + attr_reader :email + # The name of the recipient the ticket is delivered to. + attr_reader :name + # The phone number of the recipient the ticket is delivered to. + attr_reader :phone + end + # The delivery method for the payment + attr_reader :mode + # Attribute for field recipient + attr_reader :recipient + end + # Indicates if the tickets are digitally checked when entering the venue. + attr_reader :access_controlled_venue + # Attribute for field address + attr_reader :address + # Attribute for field affiliate + attr_reader :affiliate + # The name of the company + attr_reader :company + # Attribute for field delivery + attr_reader :delivery + # Event end time. Measured in seconds since the Unix epoch. + attr_reader :ends_at + # Type of the event entertainment (concert, sports event etc) + attr_reader :genre + # The name of the event. + attr_reader :name + # Event start time. Measured in seconds since the Unix epoch. + attr_reader :starts_at + end + + class Subscription < Stripe::StripeObject + class Affiliate < Stripe::StripeObject + # The name of the affiliate that originated the purchase. + attr_reader :name + end + + class BillingInterval < Stripe::StripeObject + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + attr_reader :count + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + attr_reader :interval + end + # Attribute for field affiliate + attr_reader :affiliate + # Info whether the subscription will be auto renewed upon expiry. + attr_reader :auto_renewal + # Attribute for field billing_interval + attr_reader :billing_interval + # Subscription end time. Measured in seconds since the Unix epoch. + attr_reader :ends_at + # Name of the product on subscription. e.g. Apple Music Subscription. + attr_reader :name + # Subscription start time. Measured in seconds since the Unix epoch. + attr_reader :starts_at + end + # Attribute for field car_rental + attr_reader :car_rental + # Attribute for field event_details + attr_reader :event_details + # Attribute for field subscription + attr_reader :subscription + end + + class PaymentMethodConfigurationDetails < Stripe::StripeObject + # ID of the payment method configuration used. + attr_reader :id + # ID of the parent payment method configuration used. + attr_reader :parent + end + + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + attr_reader :custom_mandate_url + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + attr_reader :interval_description + # Payment schedule for the mandate. + attr_reader :payment_schedule + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Bank account verification method. + attr_reader :verification_method + end + + class Affirm < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Preferred language of the Affirm authorization page that the customer is redirected to. + attr_reader :preferred_locale + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class AfterpayClearpay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + # This field differs from the statement descriptor and item name. + attr_reader :reference + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Alipay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Alma < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class AmazonPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class AuBecsDebit < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class BacsDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Blik < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Boleto < Stripe::StripeObject + # 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. + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + class AvailablePlan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + attr_reader :type + end + + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + attr_reader :type + end + # Installment plans that may be selected for this PaymentIntent. + attr_reader :available_plans + # Whether Installments are enabled for this PaymentIntent. + attr_reader :enabled + # Installment plan selected for this PaymentIntent. + attr_reader :plan + end + + class MandateOptions < Stripe::StripeObject + # Amount to be charged for future payments. + attr_reader :amount + # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + attr_reader :amount_type + # A description of the mandate or subscription that is meant to be displayed to the customer. + attr_reader :description + # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + attr_reader :end_date + # Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + attr_reader :interval + # The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + attr_reader :interval_count + # Unique identifier for the mandate or subscription. + attr_reader :reference + # Start date of the mandate or subscription. Start date should not be lesser than yesterday. + attr_reader :start_date + # Specifies the type of mandates supported. Possible values are `india`. + attr_reader :supported_types + end + + class StatementDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Phone number + attr_reader :phone + end + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Installment details for this payment (Mexico only). + # + # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + attr_reader :installments + # Configuration options for setting up an eMandate for cards issued in India. + attr_reader :mandate_options + # Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. + attr_reader :network + # Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + attr_reader :request_decremental_authorization + # Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + attr_reader :request_extended_authorization + # Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + attr_reader :request_incremental_authorization + # Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + attr_reader :request_multicapture + # Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + attr_reader :request_overcapture + # Request partial authorization on this PaymentIntent. + attr_reader :request_partial_authorization + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + attr_reader :request_three_d_secure + # When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + attr_reader :require_cvc_recollection + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + attr_reader :statement_descriptor_suffix_kana + # Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + attr_reader :statement_descriptor_suffix_kanji + # Attribute for field statement_details + attr_reader :statement_details + end + + class CardPresent < Stripe::StripeObject + class Routing < Stripe::StripeObject + # Requested routing priority + attr_reader :requested_priority + end + # Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + attr_reader :request_extended_authorization + # Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + attr_reader :request_incremental_authorization_support + # Attribute for field routing + attr_reader :routing + end + + class Cashapp < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + attr_reader :country + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + # + # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + attr_reader :requested_address_types + # The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + attr_reader :funding_type + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Eps < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Fpx < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Giropay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Gopay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Grabpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class IdBankTransfer < Stripe::StripeObject + # The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now till 2678400 seconds (31 days) from now. + attr_reader :expires_after + # The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + attr_reader :expires_at + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Ideal < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class InteracPresent < Stripe::StripeObject; end + + class KakaoPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Klarna < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Preferred locale of the Klarna checkout page that the customer is redirected to. + attr_reader :preferred_locale + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Konbini < Stripe::StripeObject + # An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + attr_reader :confirmation_number + # The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + attr_reader :expires_after_days + # The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + attr_reader :expires_at + # A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + attr_reader :product_description + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class KrCard < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Link < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # [Deprecated] This is a legacy parameter that no longer has any function. + attr_reader :persistent_token + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class MbWay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Mobilepay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Multibanco < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class NaverPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class Oxxo < Stripe::StripeObject + # The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class P24 < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Payco < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class Paynow < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Paypal < Stripe::StripeObject + class LineItem < Stripe::StripeObject + class Tax < Stripe::StripeObject + # The tax for a single unit of the line item in minor units. Cannot be a negative number. + attr_reader :amount + # The tax behavior for the line item. + attr_reader :behavior + end + # Type of the line item. + attr_reader :category + # Description of the line item. + attr_reader :description + # Descriptive name of the line item. + attr_reader :name + # Quantity of the line item. Cannot be a negative number. + attr_reader :quantity + # Client facing stock keeping unit, article number or similar. + attr_reader :sku + # The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + attr_reader :sold_by + # Attribute for field tax + attr_reader :tax + # Price for a single unit of the line item in minor units. Cannot be a negative number. + attr_reader :unit_amount + end + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # The line items purchased by the customer. + attr_reader :line_items + # Preferred locale of the PayPal checkout page that the customer is redirected to. + attr_reader :preferred_locale + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + attr_reader :reference + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + attr_reader :reference_id + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + attr_reader :subsellers + end + + class Payto < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + attr_reader :end_date + # The periodicity at which payments will be collected. + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + attr_reader :purpose + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Pix < Stripe::StripeObject + # The number of seconds (between 10 and 1209600) after which Pix payment will expire. + attr_reader :expires_after_seconds + # The timestamp at which the Pix expires. + attr_reader :expires_at + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Promptpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Qris < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Rechnung < Stripe::StripeObject; end + + class RevolutPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class SamsungPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + end + + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Shopeepay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Sofort < Stripe::StripeObject + # Preferred language of the SOFORT authorization page that the customer is redirected to. + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Swish < Stripe::StripeObject + # A reference for this payment to be displayed in the Swish app. + attr_reader :reference + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Twint < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + attr_reader :institution + end + + class ManualEntry < Stripe::StripeObject + # Settings for configuring manual entry of account details. + attr_reader :mode + end + # Attribute for field filters + attr_reader :filters + # Attribute for field manual_entry + attr_reader :manual_entry + # The list of permissions to request. The `payment_method` permission must be included. + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + attr_reader :return_url + end + + class MandateOptions < Stripe::StripeObject + # Mandate collection method + attr_reader :collection_method + end + # Attribute for field financial_connections + attr_reader :financial_connections + # Attribute for field mandate_options + attr_reader :mandate_options + # Preferred transaction settlement speed + attr_reader :preferred_settlement_speed + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + # Bank account verification method. + attr_reader :verification_method + end + + class WechatPay < Stripe::StripeObject + # The app ID registered with WeChat Pay. Only required when client is ios or android. + attr_reader :app_id + # The client type that the end customer will pay from + attr_reader :client + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + + class Zip < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field affirm + attr_reader :affirm + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + # Attribute for field alipay + attr_reader :alipay + # Attribute for field alma + attr_reader :alma + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field bancontact + attr_reader :bancontact + # Attribute for field blik + attr_reader :blik + # Attribute for field boleto + attr_reader :boleto + # Attribute for field card + attr_reader :card + # Attribute for field card_present + attr_reader :card_present + # Attribute for field cashapp + attr_reader :cashapp + # Attribute for field customer_balance + attr_reader :customer_balance + # Attribute for field eps + attr_reader :eps + # Attribute for field fpx + attr_reader :fpx + # Attribute for field giropay + attr_reader :giropay + # Attribute for field gopay + attr_reader :gopay + # Attribute for field grabpay + attr_reader :grabpay + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + # Attribute for field ideal + attr_reader :ideal + # Attribute for field interac_present + attr_reader :interac_present + # Attribute for field kakao_pay + attr_reader :kakao_pay + # Attribute for field klarna + attr_reader :klarna + # Attribute for field konbini + attr_reader :konbini + # Attribute for field kr_card + attr_reader :kr_card + # Attribute for field link + attr_reader :link + # Attribute for field mb_way + attr_reader :mb_way + # Attribute for field mobilepay + attr_reader :mobilepay + # Attribute for field multibanco + attr_reader :multibanco + # Attribute for field naver_pay + attr_reader :naver_pay + # Attribute for field oxxo + attr_reader :oxxo + # Attribute for field p24 + attr_reader :p24 + # Attribute for field payco + attr_reader :payco + # Attribute for field paynow + attr_reader :paynow + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field pix + attr_reader :pix + # Attribute for field promptpay + attr_reader :promptpay + # Attribute for field qris + attr_reader :qris + # Attribute for field rechnung + attr_reader :rechnung + # Attribute for field revolut_pay + attr_reader :revolut_pay + # Attribute for field samsung_pay + attr_reader :samsung_pay + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field shopeepay + attr_reader :shopeepay + # Attribute for field sofort + attr_reader :sofort + # Attribute for field swish + attr_reader :swish + # Attribute for field twint + attr_reader :twint + # Attribute for field us_bank_account + attr_reader :us_bank_account + # Attribute for field wechat_pay + attr_reader :wechat_pay + # Attribute for field zip + attr_reader :zip + end + + class Processing < Stripe::StripeObject + class Card < Stripe::StripeObject + class CustomerNotification < Stripe::StripeObject + # 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. + attr_reader :approval_requested + # If customer approval is required, they need to provide approval before this time. + attr_reader :completes_at + end + # Attribute for field customer_notification + attr_reader :customer_notification + end + # Attribute for field card + attr_reader :card + # Type of the payment method for which payment is in `processing` state, one of `card`. + attr_reader :type + end + + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class TransferData < Stripe::StripeObject + # Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + attr_reader :amount + # The account (if any) that the payment is attributed to for tax + # reporting, and where funds from the payment are transferred to after + # payment success. + attr_reader :destination + end + # Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + attr_reader :amount + + # Amount that can be captured from this PaymentIntent. + attr_reader :amount_capturable + + # Attribute for field amount_details + attr_reader :amount_details + + # Amount that this PaymentIntent collects. + attr_reader :amount_received + + # ID of the Connect application that created the PaymentIntent. + attr_reader :application + + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + attr_reader :application_fee_amount + + # Attribute for field async_workflows + attr_reader :async_workflows + + # Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) + attr_reader :automatic_payment_methods + + # Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + attr_reader :canceled_at + + # Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + attr_reader :cancellation_reason + + # Controls when the funds will be captured from the customer's account. + attr_reader :capture_method + + # The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + # + # The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + # + # Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. + attr_reader :client_secret + + # Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + attr_reader :confirmation_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # ID of the Customer this PaymentIntent belongs to, if one exists. + # + # Payment methods attached to other Customers cannot be used with this PaymentIntent. + # + # If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # ID of the invoice that created this PaymentIntent, if it exists. + attr_reader :invoice + + # The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + attr_reader :last_payment_error + + # ID of the latest [Charge object](https://stripe.com/docs/api/charges) created by this PaymentIntent. This property is `null` until PaymentIntent confirmation is attempted. + attr_reader :latest_charge + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). + attr_reader :metadata + + # If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + attr_reader :next_action + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + attr_reader :on_behalf_of + + # Attribute for field payment_details + attr_reader :payment_details + + # ID of the payment method used in this PaymentIntent. + attr_reader :payment_method + + # Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this PaymentIntent. + attr_reader :payment_method_configuration_details + + # Payment-method-specific configuration for this PaymentIntent. + attr_reader :payment_method_options + + # The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + attr_reader :payment_method_types + + # If present, this property tells you about the processing state of the payment. + attr_reader :processing + + # Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + attr_reader :receipt_email + + # ID of the review associated with this PaymentIntent, if any. + attr_reader :review + + # Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + attr_reader :secret_key_confirmation + + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + attr_reader :setup_future_usage + + # Shipping information for this PaymentIntent. + attr_reader :shipping + + # This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + attr_reader :source + + # Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + # + # Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + attr_reader :statement_descriptor + + # Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + attr_reader :statement_descriptor_suffix + + # Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + attr_reader :status + + # The data that automatically creates a Transfer after the payment finalizes. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + attr_reader :transfer_data + + # A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + attr_reader :transfer_group + # Manually reconcile the remaining amount for a customer_balance PaymentIntent. def apply_customer_balance(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/payment_link.rb b/lib/stripe/resources/payment_link.rb index d01787067..b4f8bc2bf 100644 --- a/lib/stripe/resources/payment_link.rb +++ b/lib/stripe/resources/payment_link.rb @@ -17,6 +17,360 @@ def self.object_name "payment_link" end + class AfterCompletion < Stripe::StripeObject + class HostedConfirmation < Stripe::StripeObject + # The custom message that is displayed to the customer after the purchase is complete. + attr_reader :custom_message + end + + class Redirect < Stripe::StripeObject + # The URL the customer will be redirected to after the purchase is complete. + attr_reader :url + end + # Attribute for field hosted_confirmation + attr_reader :hosted_confirmation + # Attribute for field redirect + attr_reader :redirect + # The specified behavior after the purchase is complete. + attr_reader :type + end + + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # If `true`, tax will be calculated automatically using the customer's location. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + end + + class ConsentCollection < Stripe::StripeObject + class PaymentMethodReuseAgreement < Stripe::StripeObject + # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. + # + # When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + attr_reader :position + end + # Settings related to the payment method reuse text shown in the Checkout UI. + attr_reader :payment_method_reuse_agreement + # If set to `auto`, enables the collection of customer consent for promotional communications. + attr_reader :promotions + # If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service. + attr_reader :terms_of_service + end + + class CustomField < Stripe::StripeObject + class Dropdown < Stripe::StripeObject + class Option < Stripe::StripeObject + # The label for the option, displayed to the customer. Up to 100 characters. + attr_reader :label + # The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. + attr_reader :value + end + # The options available for the customer to select. Up to 200 options allowed. + attr_reader :options + end + + class Label < Stripe::StripeObject + # Custom text for the label, displayed to the customer. Up to 50 characters. + attr_reader :custom + # The type of the label. + attr_reader :type + end + + class Numeric < Stripe::StripeObject + # The maximum character length constraint for the customer's input. + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + attr_reader :minimum_length + end + + class Text < Stripe::StripeObject + # The maximum character length constraint for the customer's input. + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + attr_reader :minimum_length + end + # Attribute for field dropdown + attr_reader :dropdown + # String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. + attr_reader :key + # Attribute for field label + attr_reader :label + # Attribute for field numeric + attr_reader :numeric + # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. + attr_reader :optional + # Attribute for field text + attr_reader :text + # The type of the field. + attr_reader :type + end + + class CustomText < Stripe::StripeObject + class AfterSubmit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + + class ShippingAddress < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + + class Submit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + + class TermsOfServiceAcceptance < Stripe::StripeObject + # Text may be up to 1200 characters in length. + attr_reader :message + end + # Custom text that should be displayed after the payment confirmation button. + attr_reader :after_submit + # Custom text that should be displayed alongside shipping address collection. + attr_reader :shipping_address + # Custom text that should be displayed alongside the payment confirmation button. + attr_reader :submit + # Custom text that should be displayed in place of the default terms of service agreement text. + attr_reader :terms_of_service_acceptance + end + + class InvoiceCreation < Stripe::StripeObject + class InvoiceData < Stripe::StripeObject + class CustomField < Stripe::StripeObject + # The name of the custom field. + attr_reader :name + # The value of the custom field. + attr_reader :value + end + + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + + class RenderingOptions < Stripe::StripeObject + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + attr_reader :amount_tax_display + end + # The account tax IDs associated with the invoice. + attr_reader :account_tax_ids + # A list of up to 4 custom fields to be displayed on the invoice. + attr_reader :custom_fields + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + # Footer to be displayed on the invoice. + attr_reader :footer + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + attr_reader :issuer + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + # Options for invoice PDF rendering. + attr_reader :rendering_options + end + # Enable creating an invoice on successful payment. + attr_reader :enabled + # Configuration for the invoice. Default invoice values will be used if unspecified. + attr_reader :invoice_data + end + + class PaymentIntentData < Stripe::StripeObject + # Indicates when the funds will be captured from the customer's account. + attr_reader :capture_method + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + attr_reader :metadata + # Indicates that you intend to make future payments with the payment method collected during checkout. + attr_reader :setup_future_usage + # For a non-card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. + attr_reader :statement_descriptor + # For a card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. Concatenated with the account's statement descriptor prefix to form the complete statement descriptor. + attr_reader :statement_descriptor_suffix + # A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + attr_reader :transfer_group + end + + class PhoneNumberCollection < Stripe::StripeObject + # If `true`, a phone number will be collected during checkout. + attr_reader :enabled + end + + class Restrictions < Stripe::StripeObject + class CompletedSessions < Stripe::StripeObject + # The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + attr_reader :count + # The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + attr_reader :limit + end + # Attribute for field completed_sessions + attr_reader :completed_sessions + end + + class ShippingAddressCollection < Stripe::StripeObject + # An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + attr_reader :allowed_countries + end + + class ShippingOption < Stripe::StripeObject + # A non-negative integer in cents representing how much to charge. + attr_reader :shipping_amount + # The ID of the Shipping Rate to use for this shipping option. + attr_reader :shipping_rate + end + + class SubscriptionData < Stripe::StripeObject + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Attribute for field issuer + attr_reader :issuer + end + + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + attr_reader :missing_payment_method + end + # Defines how a subscription behaves when a free trial ends. + attr_reader :end_behavior + end + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # Attribute for field invoice_settings + attr_reader :invoice_settings + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + attr_reader :metadata + # Integer representing the number of trial period days before the customer is charged for the first time. + attr_reader :trial_period_days + # Settings related to subscription trials. + attr_reader :trial_settings + end + + class TaxIdCollection < Stripe::StripeObject + # Indicates whether tax ID collection is enabled for the session. + attr_reader :enabled + # Attribute for field required + attr_reader :required + end + + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + attr_reader :amount + # The connected account receiving the transfer. + attr_reader :destination + end + # Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + attr_reader :active + + # Attribute for field after_completion + attr_reader :after_completion + + # Whether user redeemable promotion codes are enabled. + attr_reader :allow_promotion_codes + + # The ID of the Connect application that created the Payment Link. + attr_reader :application + + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + attr_reader :application_fee_amount + + # This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + attr_reader :application_fee_percent + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # Configuration for collecting the customer's billing address. Defaults to `auto`. + attr_reader :billing_address_collection + + # When set, provides configuration to gather active consent from customers. + attr_reader :consent_collection + + # 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). + attr_reader :currency + + # Collect additional information from your customer using custom fields. Up to 3 fields are supported. + attr_reader :custom_fields + + # Attribute for field custom_text + attr_reader :custom_text + + # Configuration for Customer creation during checkout. + attr_reader :customer_creation + + # Unique identifier for the object. + attr_reader :id + + # The custom message to be displayed to a customer when a payment link is no longer active. + attr_reader :inactive_message + + # Configuration for creating invoice for payment mode payment links. + attr_reader :invoice_creation + + # The line items representing what is being sold. + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + attr_reader :on_behalf_of + + # Indicates the parameters to be passed to PaymentIntent creation during checkout. + attr_reader :payment_intent_data + + # Configuration for collecting a payment method during checkout. Defaults to `always`. + attr_reader :payment_method_collection + + # The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + attr_reader :payment_method_types + + # Attribute for field phone_number_collection + attr_reader :phone_number_collection + + # Settings that restrict the usage of a payment link. + attr_reader :restrictions + + # Configuration for collecting the customer's shipping address. + attr_reader :shipping_address_collection + + # The shipping rate options applied to the session. + attr_reader :shipping_options + + # Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. + attr_reader :submit_type + + # When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. + attr_reader :subscription_data + + # Attribute for field tax_id_collection + attr_reader :tax_id_collection + + # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + attr_reader :transfer_data + + # The public URL that can be shared with customers. + attr_reader :url + # Creates a payment link. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/payment_links", params: params, opts: opts) diff --git a/lib/stripe/resources/payment_method.rb b/lib/stripe/resources/payment_method.rb index 3415bf08b..5481f6d24 100644 --- a/lib/stripe/resources/payment_method.rb +++ b/lib/stripe/resources/payment_method.rb @@ -17,6 +17,837 @@ def self.object_name "payment_method" end + class AcssDebit < Stripe::StripeObject + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Institution number of the bank account. + attr_reader :institution_number + # Last four digits of the bank account number. + attr_reader :last4 + # Transit number of the bank account. + attr_reader :transit_number + end + + class Affirm < Stripe::StripeObject; end + class AfterpayClearpay < Stripe::StripeObject; end + class Alipay < Stripe::StripeObject; end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + + class AuBecsDebit < Stripe::StripeObject + # Six-digit number identifying bank and branch associated with this bank account. + attr_reader :bsb_number + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + end + + class BacsDebit < Stripe::StripeObject + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # Sort code of the bank account. (e.g., `10-20-30`) + attr_reader :sort_code + end + + class Bancontact < Stripe::StripeObject; end + + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Billing address. + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + # Billing phone number (including extension). + attr_reader :phone + end + + class Blik < Stripe::StripeObject; end + + class Boleto < Stripe::StripeObject + # Uniquely identifies the customer tax id (CNPJ or CPF) + attr_reader :tax_id + end + + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :cvc_check + end + + class GeneratedFrom < Stripe::StripeObject + class PaymentMethodDetails < Stripe::StripeObject + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + attr_reader :type + end + + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + attr_reader :application_preferred_name + # Identifier for this transaction. + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + attr_reader :transaction_status_information + end + + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + attr_reader :type + end + # The authorized amount + attr_reader :amount_authorized + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + attr_reader :brand_product + # When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + attr_reader :capture_before + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Authorization response cryptogram. + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + attr_reader :incremental_authorization_supported + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + attr_reader :network_transaction_id + # Details about payments collected offline. + attr_reader :offline + # Defines whether the authorized amount can be over-captured or not + attr_reader :overcapture_supported + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + attr_reader :receipt + # Attribute for field wallet + attr_reader :wallet + end + # Attribute for field card_present + attr_reader :card_present + # The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. + attr_reader :type + end + # The charge that created this object. + attr_reader :charge + # Transaction-specific details of the payment method used in the payment. + attr_reader :payment_method_details + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + attr_reader :setup_attempt + end + + class Networks < Stripe::StripeObject + # All available networks for the card. + attr_reader :available + # The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + attr_reader :preferred + end + + class ThreeDSecureUsage < Stripe::StripeObject + # Whether 3D Secure is supported on this card. + attr_reader :supported + end + + class Wallet < Stripe::StripeObject + class AmexExpressCheckout < Stripe::StripeObject; end + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + + class Masterpass < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :shipping_address + end + + class SamsungPay < Stripe::StripeObject; end + + class VisaCheckout < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :shipping_address + end + # Attribute for field amex_express_checkout + attr_reader :amex_express_checkout + # Attribute for field apple_pay + attr_reader :apple_pay + # (For tokenized numbers only.) The last four digits of the device account number. + attr_reader :dynamic_last4 + # Attribute for field google_pay + attr_reader :google_pay + # Attribute for field link + attr_reader :link + # Attribute for field masterpass + attr_reader :masterpass + # Attribute for field samsung_pay + attr_reader :samsung_pay + # The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + attr_reader :type + # Attribute for field visa_checkout + attr_reader :visa_checkout + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # Checks on Card address and CVC if provided. + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + attr_reader :display_brand + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Details of the original PaymentMethod that created this object. + attr_reader :generated_from + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + attr_reader :networks + # Contains details on how this Card may be used for 3D Secure authentication. + attr_reader :three_d_secure_usage + # If this Card is part of a card wallet, this contains the details of the card wallet. + attr_reader :wallet + end + + class CardPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + attr_reader :available + # The preferred network for the card. + attr_reader :preferred + end + + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + attr_reader :type + end + + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + attr_reader :type + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + attr_reader :brand_product + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + attr_reader :networks + # Details about payment methods collected offline. + attr_reader :offline + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + # Attribute for field wallet + attr_reader :wallet + end + + class Cashapp < Stripe::StripeObject + # A unique and immutable identifier assigned by Cash App to every buyer. + attr_reader :buyer_id + # A public identifier for buyers using Cash App. + attr_reader :cashtag + end + + class CustomerBalance < Stripe::StripeObject; end + + class Eps < Stripe::StripeObject + # The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + attr_reader :bank + end + + class Fpx < Stripe::StripeObject + # Account holder type, if provided. Can be one of `individual` or `company`. + attr_reader :account_holder_type + # The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + attr_reader :bank + end + + class Giropay < Stripe::StripeObject; end + class Gopay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject; end + + class IdBankTransfer < Stripe::StripeObject + # Attribute for field bank + attr_reader :bank + # Attribute for field bank_code + attr_reader :bank_code + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field display_name + attr_reader :display_name + end + + class Ideal < Stripe::StripeObject + # The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + attr_reader :bank + # The Bank Identifier Code of the customer's bank, if the bank was provided. + attr_reader :bic + end + + class InteracPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + attr_reader :available + # The preferred network for the card. + attr_reader :preferred + end + # Card brand. Can be `interac`, `mastercard` or `visa`. + attr_reader :brand + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + attr_reader :networks + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + attr_reader :preferred_locales + # How card details were read in this transaction. + attr_reader :read_method + end + + class KakaoPay < Stripe::StripeObject; end + + class Klarna < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + attr_reader :day + # The month of birth, between 1 and 12. + attr_reader :month + # The four-digit year of birth. + attr_reader :year + end + # The customer's date of birth, if provided. + attr_reader :dob + end + + class Konbini < Stripe::StripeObject; end + + class KrCard < Stripe::StripeObject + # The local credit or debit card brand. + attr_reader :brand + # The last four digits of the card. This may not be present for American Express cards. + attr_reader :last4 + end + + class Link < Stripe::StripeObject + # Account owner's email address. + attr_reader :email + # [Deprecated] This is a legacy parameter that no longer has any function. + attr_reader :persistent_token + end + + class MbWay < Stripe::StripeObject; end + class Mobilepay < Stripe::StripeObject; end + class Multibanco < Stripe::StripeObject; end + + class NaverPay < Stripe::StripeObject + # Whether to fund this transaction with Naver Pay points or a card. + attr_reader :funding + end + + class Oxxo < Stripe::StripeObject; end + + class P24 < Stripe::StripeObject + # The customer's bank, if provided. + attr_reader :bank + end + + class Payco < Stripe::StripeObject; end + class Paynow < Stripe::StripeObject; end + + class Paypal < Stripe::StripeObject + # Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + attr_reader :fingerprint + # Owner's email. Values are provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :payer_email + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + attr_reader :payer_id + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_email + end + + class Payto < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + attr_reader :bsb_number + # Last four digits of the bank account number. + attr_reader :last4 + # The PayID alias for the bank account. + attr_reader :pay_id + end + + class Pix < Stripe::StripeObject; end + class Promptpay < Stripe::StripeObject; end + class Qris < Stripe::StripeObject; end + + class RadarOptions < Stripe::StripeObject + # A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + attr_reader :session + end + + class Rechnung < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + attr_reader :day + # The month of birth, between 1 and 12. + attr_reader :month + # The four-digit year of birth. + attr_reader :year + end + # Attribute for field dob + attr_reader :dob + end + + class RevolutPay < Stripe::StripeObject; end + class SamsungPay < Stripe::StripeObject; end + + class SepaDebit < Stripe::StripeObject + class GeneratedFrom < Stripe::StripeObject + # The ID of the Charge that generated this PaymentMethod, if any. + attr_reader :charge + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + attr_reader :setup_attempt + end + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Branch code of bank associated with the bank account. + attr_reader :branch_code + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Information about the object that generated this PaymentMethod. + attr_reader :generated_from + # Last four characters of the IBAN. + attr_reader :last4 + end + + class Shopeepay < Stripe::StripeObject; end + + class Sofort < Stripe::StripeObject + # Two-letter ISO code representing the country the bank account is located in. + attr_reader :country + end + + class Swish < Stripe::StripeObject; end + class Twint < Stripe::StripeObject; end + + class UsBankAccount < Stripe::StripeObject + class Networks < Stripe::StripeObject + # The preferred network. + attr_reader :preferred + # All supported networks. + attr_reader :supported + end + + class StatusDetails < Stripe::StripeObject + class Blocked < Stripe::StripeObject + # The ACH network code that resulted in this block. + attr_reader :network_code + # The reason why this PaymentMethod's fingerprint has been blocked + attr_reader :reason + end + # Attribute for field blocked + attr_reader :blocked + end + # Account holder type: individual or company. + attr_reader :account_holder_type + # Account number of the bank account. + attr_reader :account_number + # Account type: checkings or savings. Defaults to checking if omitted. + attr_reader :account_type + # The name of the bank. + attr_reader :bank_name + # The ID of the Financial Connections Account used to create the payment method. + attr_reader :financial_connections_account + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # Contains information about US bank account networks that can be used. + attr_reader :networks + # Routing number of the bank account. + attr_reader :routing_number + # Contains information about the future reusability of this PaymentMethod. + attr_reader :status_details + end + + class WechatPay < Stripe::StripeObject; end + class Zip < Stripe::StripeObject; end + # Attribute for field acss_debit + attr_reader :acss_debit + + # Attribute for field affirm + attr_reader :affirm + + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + + # Attribute for field alipay + attr_reader :alipay + + # This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + attr_reader :allow_redisplay + + # Attribute for field alma + attr_reader :alma + + # Attribute for field amazon_pay + attr_reader :amazon_pay + + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + + # Attribute for field bacs_debit + attr_reader :bacs_debit + + # Attribute for field bancontact + attr_reader :bancontact + + # Attribute for field billing_details + attr_reader :billing_details + + # Attribute for field blik + attr_reader :blik + + # Attribute for field boleto + attr_reader :boleto + + # Attribute for field card + attr_reader :card + + # Attribute for field card_present + attr_reader :card_present + + # Attribute for field cashapp + attr_reader :cashapp + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + attr_reader :customer + + # Attribute for field customer_balance + attr_reader :customer_balance + + # Attribute for field eps + attr_reader :eps + + # Attribute for field fpx + attr_reader :fpx + + # Attribute for field giropay + attr_reader :giropay + + # Attribute for field gopay + attr_reader :gopay + + # Attribute for field grabpay + attr_reader :grabpay + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + + # Attribute for field ideal + attr_reader :ideal + + # Attribute for field interac_present + attr_reader :interac_present + + # Attribute for field kakao_pay + attr_reader :kakao_pay + + # Attribute for field klarna + attr_reader :klarna + + # Attribute for field konbini + attr_reader :konbini + + # Attribute for field kr_card + attr_reader :kr_card + + # Attribute for field link + attr_reader :link + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Attribute for field mb_way + attr_reader :mb_way + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Attribute for field mobilepay + attr_reader :mobilepay + + # Attribute for field multibanco + attr_reader :multibanco + + # Attribute for field naver_pay + attr_reader :naver_pay + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field oxxo + attr_reader :oxxo + + # Attribute for field p24 + attr_reader :p24 + + # Attribute for field payco + attr_reader :payco + + # Attribute for field paynow + attr_reader :paynow + + # Attribute for field paypal + attr_reader :paypal + + # Attribute for field payto + attr_reader :payto + + # Attribute for field pix + attr_reader :pix + + # Attribute for field promptpay + attr_reader :promptpay + + # Attribute for field qris + attr_reader :qris + + # Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + attr_reader :radar_options + + # Attribute for field rechnung + attr_reader :rechnung + + # Attribute for field revolut_pay + attr_reader :revolut_pay + + # Attribute for field samsung_pay + attr_reader :samsung_pay + + # Attribute for field sepa_debit + attr_reader :sepa_debit + + # Attribute for field shopeepay + attr_reader :shopeepay + + # Attribute for field sofort + attr_reader :sofort + + # Attribute for field swish + attr_reader :swish + + # Attribute for field twint + attr_reader :twint + + # The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + attr_reader :type + + # Attribute for field us_bank_account + attr_reader :us_bank_account + + # Attribute for field wechat_pay + attr_reader :wechat_pay + + # Attribute for field zip + attr_reader :zip + # Attaches a PaymentMethod object to a Customer. # # To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) diff --git a/lib/stripe/resources/payment_method_configuration.rb b/lib/stripe/resources/payment_method_configuration.rb index 441e4c4c4..182861f7c 100644 --- a/lib/stripe/resources/payment_method_configuration.rb +++ b/lib/stripe/resources/payment_method_configuration.rb @@ -26,6 +26,857 @@ def self.object_name "payment_method_configuration" end + class AcssDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Affirm < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class AfterpayClearpay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Alipay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Alma < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class AmazonPay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class ApplePay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class AuBecsDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class BacsDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Bancontact < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Blik < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Boleto < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Card < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class CartesBancaires < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Cashapp < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class CustomerBalance < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Eps < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Fpx < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Giropay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class GooglePay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Gopay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Grabpay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class IdBankTransfer < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Ideal < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Jcb < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Klarna < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Konbini < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Link < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Mobilepay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Multibanco < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Oxxo < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class P24 < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Paynow < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Paypal < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Payto < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Promptpay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Qris < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class RevolutPay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class SepaDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Shopeepay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Sofort < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Swish < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Twint < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class UsBankAccount < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class WechatPay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + + class Zip < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + attr_reader :overridable + # The account's display preference. + attr_reader :preference + # The effective display preference value. + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + attr_reader :available + # Attribute for field display_preference + attr_reader :display_preference + end + # Attribute for field acss_debit + attr_reader :acss_debit + + # Whether the configuration can be used for new payments. + attr_reader :active + + # Attribute for field affirm + attr_reader :affirm + + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + + # Attribute for field alipay + attr_reader :alipay + + # Attribute for field alma + attr_reader :alma + + # Attribute for field amazon_pay + attr_reader :amazon_pay + + # Attribute for field apple_pay + attr_reader :apple_pay + + # For child configs, the Connect application associated with the configuration. + attr_reader :application + + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + + # Attribute for field bacs_debit + attr_reader :bacs_debit + + # Attribute for field bancontact + attr_reader :bancontact + + # Attribute for field blik + attr_reader :blik + + # Attribute for field boleto + attr_reader :boleto + + # Attribute for field card + attr_reader :card + + # Attribute for field cartes_bancaires + attr_reader :cartes_bancaires + + # Attribute for field cashapp + attr_reader :cashapp + + # Attribute for field customer_balance + attr_reader :customer_balance + + # Attribute for field eps + attr_reader :eps + + # Attribute for field fpx + attr_reader :fpx + + # Attribute for field giropay + attr_reader :giropay + + # Attribute for field google_pay + attr_reader :google_pay + + # Attribute for field gopay + attr_reader :gopay + + # Attribute for field grabpay + attr_reader :grabpay + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + + # Attribute for field ideal + attr_reader :ideal + + # The default configuration is used whenever a payment method configuration is not specified. + attr_reader :is_default + + # Attribute for field jcb + attr_reader :jcb + + # Attribute for field klarna + attr_reader :klarna + + # Attribute for field konbini + attr_reader :konbini + + # Attribute for field link + attr_reader :link + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Attribute for field mobilepay + attr_reader :mobilepay + + # Attribute for field multibanco + attr_reader :multibanco + + # The configuration's name. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field oxxo + attr_reader :oxxo + + # Attribute for field p24 + attr_reader :p24 + + # For child configs, the configuration's parent configuration. + attr_reader :parent + + # Attribute for field paynow + attr_reader :paynow + + # Attribute for field paypal + attr_reader :paypal + + # Attribute for field payto + attr_reader :payto + + # Attribute for field promptpay + attr_reader :promptpay + + # Attribute for field qris + attr_reader :qris + + # Attribute for field revolut_pay + attr_reader :revolut_pay + + # Attribute for field sepa_debit + attr_reader :sepa_debit + + # Attribute for field shopeepay + attr_reader :shopeepay + + # Attribute for field sofort + attr_reader :sofort + + # Attribute for field swish + attr_reader :swish + + # Attribute for field twint + attr_reader :twint + + # Attribute for field us_bank_account + attr_reader :us_bank_account + + # Attribute for field wechat_pay + attr_reader :wechat_pay + + # Attribute for field zip + attr_reader :zip + # Creates a payment method configuration def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/payment_method_domain.rb b/lib/stripe/resources/payment_method_domain.rb index 8ea787a59..a1fdafdcd 100644 --- a/lib/stripe/resources/payment_method_domain.rb +++ b/lib/stripe/resources/payment_method_domain.rb @@ -16,6 +16,93 @@ def self.object_name "payment_method_domain" end + class AmazonPay < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + attr_reader :error_message + end + # The status of the payment method on the domain. + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + attr_reader :status_details + end + + class ApplePay < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + attr_reader :error_message + end + # The status of the payment method on the domain. + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + attr_reader :status_details + end + + class GooglePay < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + attr_reader :error_message + end + # The status of the payment method on the domain. + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + attr_reader :status_details + end + + class Link < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + attr_reader :error_message + end + # The status of the payment method on the domain. + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + attr_reader :status_details + end + + class Paypal < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + attr_reader :error_message + end + # The status of the payment method on the domain. + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + attr_reader :status_details + end + # Indicates the status of a specific payment method on a payment method domain. + attr_reader :amazon_pay + + # Indicates the status of a specific payment method on a payment method domain. + attr_reader :apple_pay + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The domain name that this payment method domain object represents. + attr_reader :domain_name + + # Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + attr_reader :enabled + + # Indicates the status of a specific payment method on a payment method domain. + attr_reader :google_pay + + # Unique identifier for the object. + attr_reader :id + + # Indicates the status of a specific payment method on a payment method domain. + attr_reader :link + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Indicates the status of a specific payment method on a payment method domain. + attr_reader :paypal + # Creates a payment method domain. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/payment_record.rb b/lib/stripe/resources/payment_record.rb index 847a3f0a1..b1914f020 100644 --- a/lib/stripe/resources/payment_record.rb +++ b/lib/stripe/resources/payment_record.rb @@ -12,6 +12,167 @@ def self.object_name "payment_record" end + class AmountCanceled < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountFailed < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountGuaranteed < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountRefunded < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class AmountRequested < Stripe::StripeObject + # 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). + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + attr_reader :value + end + + class CustomerDetails < Stripe::StripeObject + # ID of the Stripe Customer associated with this payment. + attr_reader :customer + # The customer's email address. + attr_reader :email + # The customer's name. + attr_reader :name + # The customer's phone number. + attr_reader :phone + end + + class PaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # A representation of a physical address. + attr_reader :address + # The billing email associated with the method of payment. + attr_reader :email + # The billing name associated with the method of payment. + attr_reader :name + # The billing phone number associated with the method of payment. + attr_reader :phone + end + + class Custom < Stripe::StripeObject + # Display name for the custom (user-defined) payment method type used to make this payment. + attr_reader :display_name + # The custom payment method type associated with this payment. + attr_reader :type + end + # The billing details associated with the method of payment. + attr_reader :billing_details + # Information about the custom (user-defined) payment method used to make this payment. + attr_reader :custom + # ID of the Stripe PaymentMethod used to make this payment. + attr_reader :payment_method + # The type of Payment Method used for this payment attempt. + attr_reader :type + end + + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # A representation of a physical address. + attr_reader :address + # The shipping recipient's name. + attr_reader :name + # The shipping recipient's phone number. + attr_reader :phone + end + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_canceled + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_failed + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_guaranteed + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_refunded + + # A representation of an amount of money, consisting of an amount and a currency. + attr_reader :amount_requested + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Customer information for this payment. + attr_reader :customer_details + + # Indicates whether the customer was present in your checkout flow during this payment. + attr_reader :customer_presence + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # ID of the latest Payment Attempt Record attached to this Payment Record. + attr_reader :latest_payment_attempt_record + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Information about the Payment Method debited for this payment. + attr_reader :payment_method_details + + # An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + attr_reader :payment_reference + + # Shipping information for this payment. + attr_reader :shipping_details + # Report a new Payment Record. You may report a Payment Record as it is # initialized and later report updates through the other report_* methods, or report Payment # Records in a terminal state directly, through this method. diff --git a/lib/stripe/resources/payout.rb b/lib/stripe/resources/payout.rb index 1f98b485b..e2d007153 100644 --- a/lib/stripe/resources/payout.rb +++ b/lib/stripe/resources/payout.rb @@ -20,6 +20,90 @@ def self.object_name "payout" end + class TraceId < Stripe::StripeObject + # Possible values are `pending`, `supported`, and `unsupported`. When `payout.status` is `pending` or `in_transit`, this will be `pending`. When the payout transitions to `paid`, `failed`, or `canceled`, this status will become `supported` or `unsupported` shortly after in most cases. In some cases, this may appear as `pending` for up to 10 days after `arrival_date` until transitioning to `supported` or `unsupported`. + attr_reader :status + # The trace ID value if `trace_id.status` is `supported`, otherwise `nil`. + attr_reader :value + end + # The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. + attr_reader :amount + + # The application fee (if any) for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + attr_reader :application_fee + + # The amount of the application fee (if any) requested for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + attr_reader :application_fee_amount + + # Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays. + attr_reader :arrival_date + + # Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). + attr_reader :automatic + + # ID of the balance transaction that describes the impact of this payout on your account balance. + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # ID of the bank account or card the payout is sent to. + attr_reader :destination + + # If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. + attr_reader :failure_balance_transaction + + # Error code that provides a reason for a payout failure, if available. View our [list of failure codes](https://stripe.com/docs/api#payout_failures). + attr_reader :failure_code + + # Message that provides the reason for a payout failure, if available. + attr_reader :failure_message + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). + attr_reader :method + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # If the payout reverses another, this is the ID of the original payout. + attr_reader :original_payout + + # If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. + attr_reader :reconciliation_status + + # If the payout reverses, this is the ID of the payout that reverses this payout. + attr_reader :reversed_by + + # The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. + attr_reader :source_type + + # Extra information about a payout that displays on the user's bank statement. + attr_reader :statement_descriptor + + # Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`. + attr_reader :status + + # A value that generates from the beneficiary's bank that allows users to track payouts with their bank. Banks might call this a "reference number" or something similar. + attr_reader :trace_id + + # Can be `bank_account` or `card`. + attr_reader :type + # You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/person.rb b/lib/stripe/resources/person.rb index 1262a5ad9..923d406df 100644 --- a/lib/stripe/resources/person.rb +++ b/lib/stripe/resources/person.rb @@ -15,6 +15,300 @@ def self.object_name "person" end + class AdditionalTosAcceptances < Stripe::StripeObject + class Account < Stripe::StripeObject + # The Unix timestamp marking when the legal guardian accepted the service agreement. + attr_reader :date + # The IP address from which the legal guardian accepted the service agreement. + attr_reader :ip + # The user agent of the browser from which the legal guardian accepted the service agreement. + attr_reader :user_agent + end + # Details on the legal guardian's acceptance of the main Stripe service agreement. + attr_reader :account + end + + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class AddressKana < Stripe::StripeObject + # City/Ward. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Block/Building number. + attr_reader :line1 + # Building details. + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # Prefecture. + attr_reader :state + # Town/cho-me. + attr_reader :town + end + + class AddressKanji < Stripe::StripeObject + # City/Ward. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Block/Building number. + attr_reader :line1 + # Building details. + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # Prefecture. + attr_reader :state + # Town/cho-me. + attr_reader :town + end + + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + attr_reader :day + # The month of birth, between 1 and 12. + attr_reader :month + # The four-digit year of birth. + attr_reader :year + end + + class FutureRequirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + attr_reader :original_fields_due + end + + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + attr_reader :alternatives + # Fields that need to be collected to keep the person's account enabled. If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. + attr_reader :eventually_due + # Fields that weren't collected by the account's `requirements.current_deadline`. These fields need to be collected to enable the person's account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + + class RegisteredAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class Relationship < Stripe::StripeObject + # Whether the person is the authorizer of the account's representative. + attr_reader :authorizer + # Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + attr_reader :director + # Whether the person has significant responsibility to control, manage, or direct the organization. + attr_reader :executive + # Whether the person is the legal guardian of the account's representative. + attr_reader :legal_guardian + # Whether the person is an owner of the account’s legal entity. + attr_reader :owner + # The percent owned by the person of the account's legal entity. + attr_reader :percent_ownership + # Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + attr_reader :representative + # The person's title (e.g., CEO, Support Engineer). + attr_reader :title + end + + class Requirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + attr_reader :original_fields_due + end + + class Error < Stripe::StripeObject + # The code for the type of error. + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + attr_reader :alternatives + # Fields that need to be collected to keep the person's account enabled. If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. + attr_reader :eventually_due + # Fields that weren't collected by the account's `current_deadline`. These fields need to be collected to enable the person's account. + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + attr_reader :pending_verification + end + + class Verification < Stripe::StripeObject + class AdditionalDocument < Stripe::StripeObject + # The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + attr_reader :back + # A user-displayable string describing the verification state of this document. For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". + attr_reader :details + # One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. A machine-readable code specifying the verification state for this document. + attr_reader :details_code + # The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + attr_reader :front + end + + class Document < Stripe::StripeObject + # The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + attr_reader :back + # A user-displayable string describing the verification state of this document. For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". + attr_reader :details + # One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. A machine-readable code specifying the verification state for this document. + attr_reader :details_code + # The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + attr_reader :front + end + # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + attr_reader :additional_document + # A user-displayable string describing the verification state for the person. For example, this may say "Provided identity information could not be verified". + attr_reader :details + # One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. A machine-readable code specifying the verification state for the person. + attr_reader :details_code + # Attribute for field document + attr_reader :document + # The state of verification for the person. Possible values are `unverified`, `pending`, or `verified`. + attr_reader :status + end + # The account the person is associated with. + attr_reader :account + + # Attribute for field additional_tos_acceptances + attr_reader :additional_tos_acceptances + + # Attribute for field address + attr_reader :address + + # The Kana variation of the person's address (Japan only). + attr_reader :address_kana + + # The Kanji variation of the person's address (Japan only). + attr_reader :address_kanji + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Attribute for field dob + attr_reader :dob + + # The person's email address. + attr_reader :email + + # The person's first name. + attr_reader :first_name + + # The Kana variation of the person's first name (Japan only). + attr_reader :first_name_kana + + # The Kanji variation of the person's first name (Japan only). + attr_reader :first_name_kanji + + # A list of alternate names or aliases that the person is known by. + attr_reader :full_name_aliases + + # Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + attr_reader :future_requirements + + # The person's gender. + attr_reader :gender + + # Unique identifier for the object. + attr_reader :id + + # Whether the person's `id_number` was provided. True if either the full ID number was provided or if only the required part of the ID number was provided (ex. last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). + attr_reader :id_number_provided + + # Whether the person's `id_number_secondary` was provided. + attr_reader :id_number_secondary_provided + + # The person's last name. + attr_reader :last_name + + # The Kana variation of the person's last name (Japan only). + attr_reader :last_name_kana + + # The Kanji variation of the person's last name (Japan only). + attr_reader :last_name_kanji + + # The person's maiden name. + attr_reader :maiden_name + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The country where the person is a national. + attr_reader :nationality + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The person's phone number. + attr_reader :phone + + # Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + attr_reader :political_exposure + + # Attribute for field registered_address + attr_reader :registered_address + + # Attribute for field relationship + attr_reader :relationship + + # Information about the requirements for this person, including what information needs to be collected, and by when. + attr_reader :requirements + + # Whether the last four digits of the person's Social Security number have been provided (U.S. only). + attr_reader :ssn_last_4_provided + + # Attribute for field verification + attr_reader :verification + + # Always true for a deleted object + attr_reader :deleted + def resource_url if !respond_to?(:account) || account.nil? raise NotImplementedError, diff --git a/lib/stripe/resources/plan.rb b/lib/stripe/resources/plan.rb index 3b2d7cbd2..cad4164e5 100644 --- a/lib/stripe/resources/plan.rb +++ b/lib/stripe/resources/plan.rb @@ -21,6 +21,91 @@ def self.object_name "plan" end + class Tier < Stripe::StripeObject + # Price for the entire tier. + attr_reader :flat_amount + # Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :flat_amount_decimal + # Per unit price for units relevant to the tier. + attr_reader :unit_amount + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :unit_amount_decimal + # Up to and including to this quantity will be contained in the tier. + attr_reader :up_to + end + + class TransformUsage < Stripe::StripeObject + # Divide usage by this number. + attr_reader :divide_by + # After division, either round the result `up` or `down`. + attr_reader :round + end + # Whether the plan can be used for new purchases. + attr_reader :active + + # Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + attr_reader :aggregate_usage + + # The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + attr_reader :amount + + # The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + attr_reader :amount_decimal + + # Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + attr_reader :billing_scheme + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Unique identifier for the object. + attr_reader :id + + # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + attr_reader :interval + + # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. + attr_reader :interval_count + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The meter tracking the usage of a metered price + attr_reader :meter + + # A brief description of the plan, hidden from customers. + attr_reader :nickname + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The product whose pricing this plan determines. + attr_reader :product + + # Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + attr_reader :tiers + + # Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. + attr_reader :tiers_mode + + # Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. + attr_reader :transform_usage + + # Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + attr_reader :trial_period_days + + # Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + attr_reader :usage_type + + # Always true for a deleted object + attr_reader :deleted + # You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/plans", params: params, opts: opts) diff --git a/lib/stripe/resources/price.rb b/lib/stripe/resources/price.rb index 6b75f9e40..e3902cd78 100644 --- a/lib/stripe/resources/price.rb +++ b/lib/stripe/resources/price.rb @@ -19,6 +19,161 @@ def self.object_name "price" end + class CurrencyOptions < Stripe::StripeObject + class CustomUnitAmount < Stripe::StripeObject + # The maximum unit amount the customer can specify for this item. + attr_reader :maximum + # The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + attr_reader :minimum + # The starting unit amount which can be updated by the customer. + attr_reader :preset + end + + class Tier < Stripe::StripeObject + # Price for the entire tier. + attr_reader :flat_amount + # Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :flat_amount_decimal + # Per unit price for units relevant to the tier. + attr_reader :unit_amount + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :unit_amount_decimal + # Up to and including to this quantity will be contained in the tier. + attr_reader :up_to + end + # When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + attr_reader :custom_unit_amount + # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + attr_reader :tax_behavior + # Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + attr_reader :tiers + # The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + attr_reader :unit_amount + # The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + attr_reader :unit_amount_decimal + end + + class CustomUnitAmount < Stripe::StripeObject + # The maximum unit amount the customer can specify for this item. + attr_reader :maximum + # The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + attr_reader :minimum + # The starting unit amount which can be updated by the customer. + attr_reader :preset + end + + class MigrateTo < Stripe::StripeObject + # The behavior controlling at what point in the subscription lifecycle to migrate the price + attr_reader :behavior + # The unix timestamp after at which subscriptions will start to migrate to the new price. + attr_reader :effective_after + # The id of the price being migrated to + attr_reader :price + end + + class Recurring < Stripe::StripeObject + # Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. + attr_reader :aggregate_usage + # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + attr_reader :interval + # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. + attr_reader :interval_count + # The meter tracking the usage of a metered price + attr_reader :meter + # Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + attr_reader :trial_period_days + # Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + attr_reader :usage_type + end + + class Tier < Stripe::StripeObject + # Price for the entire tier. + attr_reader :flat_amount + # Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :flat_amount_decimal + # Per unit price for units relevant to the tier. + attr_reader :unit_amount + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + attr_reader :unit_amount_decimal + # Up to and including to this quantity will be contained in the tier. + attr_reader :up_to + end + + class TransformQuantity < Stripe::StripeObject + # Divide usage by this number. + attr_reader :divide_by + # After division, either round the result `up` or `down`. + attr_reader :round + end + # Whether the price can be used for new purchases. + attr_reader :active + + # Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + attr_reader :billing_scheme + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + attr_reader :currency_options + + # When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + attr_reader :custom_unit_amount + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. + attr_reader :lookup_key + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Subscriptions using this price will be migrated to use the new referenced price. + attr_reader :migrate_to + + # A brief description of the price, hidden from customers. + attr_reader :nickname + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ID of the product this price is associated with. + attr_reader :product + + # The recurring components of a price such as `interval` and `usage_type`. + attr_reader :recurring + + # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + attr_reader :tax_behavior + + # Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + attr_reader :tiers + + # Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. + attr_reader :tiers_mode + + # Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. + attr_reader :transform_quantity + + # One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + attr_reader :type + + # The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + attr_reader :unit_amount + + # The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + attr_reader :unit_amount_decimal + + # Always true for a deleted object + attr_reader :deleted + # Creates a new price for an existing product. The price can be recurring or one-time. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/prices", params: params, opts: opts) diff --git a/lib/stripe/resources/product.rb b/lib/stripe/resources/product.rb index adb55160c..ca12a7a2b 100644 --- a/lib/stripe/resources/product.rb +++ b/lib/stripe/resources/product.rb @@ -25,6 +25,103 @@ def self.object_name nested_resource_class_methods :feature, operations: %i[create retrieve delete list] + class MarketingFeature < Stripe::StripeObject + # The marketing feature name. Up to 80 characters long. + attr_reader :name + end + + class PackageDimensions < Stripe::StripeObject + # Height, in inches. + attr_reader :height + # Length, in inches. + attr_reader :length + # Weight, in ounces. + attr_reader :weight + # Width, in inches. + attr_reader :width + end + + class Provisioning < Stripe::StripeObject + class GiftCard < Stripe::StripeObject + class FixedAmount < Stripe::StripeObject + # The initial amount with which the provisioned gift card will be created. + attr_reader :amount + # 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). + attr_reader :currency + end + # Attribute for field fixed_amount + attr_reader :fixed_amount + # The specific type of gift_card provisioning, only `fixed_amount` currently supported. + attr_reader :type + end + # Attribute for field gift_card + attr_reader :gift_card + # The type of provisioning, only `gift_card` currently supported. + attr_reader :type + end + # Whether the product is currently available for purchase. + attr_reader :active + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + attr_reader :default_price + + # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + attr_reader :images + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + attr_reader :marketing_features + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The product's name, meant to be displayable to the customer. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The dimensions of this product for shipping purposes. + attr_reader :package_dimensions + + # Provisioning configuration for this product. + attr_reader :provisioning + + # Whether this product is shipped (i.e., physical goods). + attr_reader :shippable + + # Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only used for subscription payments. + attr_reader :statement_descriptor + + # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + attr_reader :tax_code + + # The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. + attr_reader :type + + # A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + attr_reader :unit_label + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + attr_reader :updated + + # A URL of a publicly-accessible webpage for this product. + attr_reader :url + + # Always true for a deleted object + attr_reader :deleted + # Creates a new product object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/products", params: params, opts: opts) diff --git a/lib/stripe/resources/product_feature.rb b/lib/stripe/resources/product_feature.rb index 5a36e5647..937633c6e 100644 --- a/lib/stripe/resources/product_feature.rb +++ b/lib/stripe/resources/product_feature.rb @@ -9,5 +9,21 @@ class ProductFeature < APIResource def self.object_name "product_feature" end + + # A feature represents a monetizable ability or functionality in your system. + # Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. + attr_reader :entitlement_feature + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Always true for a deleted object + attr_reader :deleted end end diff --git a/lib/stripe/resources/promotion_code.rb b/lib/stripe/resources/promotion_code.rb index dd285a1f3..aed9581ca 100644 --- a/lib/stripe/resources/promotion_code.rb +++ b/lib/stripe/resources/promotion_code.rb @@ -14,6 +14,61 @@ def self.object_name "promotion_code" end + class Restrictions < Stripe::StripeObject + class CurrencyOptions < Stripe::StripeObject + # Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + attr_reader :minimum_amount + end + # Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + attr_reader :currency_options + # A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices + attr_reader :first_time_transaction + # Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + attr_reader :minimum_amount + # Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount + attr_reader :minimum_amount_currency + end + # Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid. + attr_reader :active + + # The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). + attr_reader :code + + # A coupon contains information about a percent-off or amount-off discount you + # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). + attr_reader :coupon + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The customer that this promotion code can be used by. + attr_reader :customer + + # Date at which the promotion code can no longer be redeemed. + attr_reader :expires_at + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Maximum number of times this promotion code can be redeemed. + attr_reader :max_redemptions + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field restrictions + attr_reader :restrictions + + # Number of times this promotion code has been used. + attr_reader :times_redeemed + # A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/promotion_codes", params: params, opts: opts) diff --git a/lib/stripe/resources/quote.rb b/lib/stripe/resources/quote.rb index ca8f340c0..2291233a8 100644 --- a/lib/stripe/resources/quote.rb +++ b/lib/stripe/resources/quote.rb @@ -18,6 +18,563 @@ def self.object_name nested_resource_class_methods :preview_invoice, operations: %i[list] nested_resource_class_methods :preview_subscription_schedule, operations: %i[list] + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Automatically calculate taxes + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + # The status of the most recent automated tax calculation for this quote. + attr_reader :status + end + + class Computed < Stripe::StripeObject + class LastReestimationDetails < Stripe::StripeObject + class Failed < Stripe::StripeObject + # The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field. + attr_reader :failure_code + # Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID". + attr_reader :message + # The reason the reestimation failed. + attr_reader :reason + end + # When `status` is `failed`, provides details about the quote reestimation failure. + attr_reader :failed + # Latest status of the reestimation. + attr_reader :status + end + + class Recurring < Stripe::StripeObject + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + attr_reader :discount + end + + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The aggregated discounts. + attr_reader :discounts + # The aggregated tax amounts by rate. + attr_reader :taxes + end + # This is the sum of all the discounts. + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + attr_reader :amount_tax + # Attribute for field breakdown + attr_reader :breakdown + end + # Total before any discounts or taxes are applied. + attr_reader :amount_subtotal + # Total after discounts and taxes are applied. + attr_reader :amount_total + # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + attr_reader :interval + # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. + attr_reader :interval_count + # Attribute for field total_details + attr_reader :total_details + end + + class Upfront < Stripe::StripeObject + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + attr_reader :discount + end + + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The aggregated discounts. + attr_reader :discounts + # The aggregated tax amounts by rate. + attr_reader :taxes + end + # This is the sum of all the discounts. + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + attr_reader :amount_tax + # Attribute for field breakdown + attr_reader :breakdown + end + # Total before any discounts or taxes are applied. + attr_reader :amount_subtotal + # Total after discounts and taxes are applied. + attr_reader :amount_total + # The line items that will appear on the next invoice after this quote is accepted. This does not include pending invoice items that exist on the customer but may still be included in the next invoice. + attr_reader :line_items + # Attribute for field total_details + attr_reader :total_details + end + # Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation. + attr_reader :last_reestimation_details + # The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices. + attr_reader :recurring + # The time at which the quote's estimated schedules and upcoming invoices were generated. + attr_reader :updated_at + # Attribute for field upfront + attr_reader :upfront + end + + class FromQuote < Stripe::StripeObject + # Whether this quote is a revision of a different quote. + attr_reader :is_revision + # The quote that was cloned. + attr_reader :quote + end + + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + attr_reader :days_until_due + # Attribute for field issuer + attr_reader :issuer + end + + class StatusDetails < Stripe::StripeObject + class Canceled < Stripe::StripeObject + # The reason this quote was marked as canceled. + attr_reader :reason + # Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch. + attr_reader :transitioned_at + end + + class Stale < Stripe::StripeObject + class LastReason < Stripe::StripeObject + class LinesInvalid < Stripe::StripeObject + # The timestamp at which the lines were marked as invalid. + attr_reader :invalid_at + # The list of lines that became invalid at the given timestamp. + attr_reader :lines + end + + class SubscriptionChanged < Stripe::StripeObject + # The subscription's state before the quote was marked as stale. + attr_reader :previous_subscription + end + + class SubscriptionScheduleChanged < Stripe::StripeObject + # The subscription schedule's state before the quote was marked as stale. + attr_reader :previous_subscription_schedule + end + # The ID of the line that is invalid if the stale reason type is `line_invalid`. + attr_reader :line_invalid + # The IDs of the lines that are invalid if the stale reason type is `lines_invalid`. + attr_reader :lines_invalid + # The user supplied mark stale reason. + attr_reader :marked_stale + # The ID of the subscription that was canceled. + attr_reader :subscription_canceled + # Attribute for field subscription_changed + attr_reader :subscription_changed + # The ID of the subscription that was expired. + attr_reader :subscription_expired + # The ID of the subscription schedule that was canceled. + attr_reader :subscription_schedule_canceled + # Attribute for field subscription_schedule_changed + attr_reader :subscription_schedule_changed + # The ID of the subscription schedule that was released. + attr_reader :subscription_schedule_released + # The reason the quote was marked as stale. + attr_reader :type + end + # Time at which the quote expires. Measured in seconds since the Unix epoch. + attr_reader :expires_at + # The most recent reason this quote was marked as stale. + attr_reader :last_reason + # Time at which the stale reason was updated. Measured in seconds since the Unix epoch. + attr_reader :last_updated_at + # Time at which the quote was marked as stale. Measured in seconds since the Unix epoch. + attr_reader :transitioned_at + end + # Attribute for field canceled + attr_reader :canceled + # Attribute for field stale + attr_reader :stale + end + + class StatusTransitions < Stripe::StripeObject + # The time that the quote was accepted. Measured in seconds since Unix epoch. + attr_reader :accepted_at + # The time that the quote was canceled. Measured in seconds since Unix epoch. + attr_reader :canceled_at + # The time that the quote was finalized. Measured in seconds since Unix epoch. + attr_reader :finalized_at + end + + class SubscriptionData < Stripe::StripeObject + class BillOnAcceptance < Stripe::StripeObject + class BillFrom < Stripe::StripeObject + class LineStartsAt < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + end + # The materialized time. + attr_reader :computed + # The timestamp the given line starts at. + attr_reader :line_starts_at + # A precise Unix timestamp. + attr_reader :timestamp + # The type of method to specify the `bill_from` time. + attr_reader :type + end + + class BillUntil < Stripe::StripeObject + class Duration < Stripe::StripeObject + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + attr_reader :interval + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + attr_reader :interval_count + end + + class LineEndsAt < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + end + # The materialized time. + attr_reader :computed + # Time span for the quote line starting from the `starts_at` date. + attr_reader :duration + # The timestamp the given line ends at. + attr_reader :line_ends_at + # A precise Unix timestamp. + attr_reader :timestamp + # The type of method to specify the `bill_until` time. + attr_reader :type + end + # The start of the period to bill from when the Quote is accepted. + attr_reader :bill_from + # The end of the period to bill until when the Quote is accepted. + attr_reader :bill_until + end + + class Prebilling < Stripe::StripeObject + # Attribute for field iterations + attr_reader :iterations + end + # Describes the period to bill for upon accepting the quote. + attr_reader :bill_on_acceptance + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + attr_reader :billing_behavior + # Whether the subscription will always start a new billing period when the quote is accepted. + attr_reader :billing_cycle_anchor + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch. + attr_reader :effective_date + # Behavior of the subscription schedule and underlying subscription when it ends. + attr_reader :end_behavior + # The id of the subscription that will be updated when the quote is accepted. + attr_reader :from_subscription + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. + attr_reader :metadata + # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + attr_reader :prebilling + # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + attr_reader :proration_behavior + # Integer representing the number of trial period days before the customer is charged for the first time. + attr_reader :trial_period_days + end + + class SubscriptionDataOverride < Stripe::StripeObject + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + attr_reader :new_reference + # The ID of the schedule the line applies to. + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + attr_reader :type + end + + class BillOnAcceptance < Stripe::StripeObject + class BillFrom < Stripe::StripeObject + class LineStartsAt < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + end + # The materialized time. + attr_reader :computed + # The timestamp the given line starts at. + attr_reader :line_starts_at + # A precise Unix timestamp. + attr_reader :timestamp + # The type of method to specify the `bill_from` time. + attr_reader :type + end + + class BillUntil < Stripe::StripeObject + class Duration < Stripe::StripeObject + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + attr_reader :interval + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + attr_reader :interval_count + end + + class LineEndsAt < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + end + # The materialized time. + attr_reader :computed + # Time span for the quote line starting from the `starts_at` date. + attr_reader :duration + # The timestamp the given line ends at. + attr_reader :line_ends_at + # A precise Unix timestamp. + attr_reader :timestamp + # The type of method to specify the `bill_until` time. + attr_reader :type + end + # The start of the period to bill from when the Quote is accepted. + attr_reader :bill_from + # The end of the period to bill until when the Quote is accepted. + attr_reader :bill_until + end + # Attribute for field applies_to + attr_reader :applies_to + # Describes the period to bill for upon accepting the quote. + attr_reader :bill_on_acceptance + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + attr_reader :billing_behavior + # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + attr_reader :customer + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # Behavior of the subscription schedule and underlying subscription when it ends. + attr_reader :end_behavior + # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + attr_reader :proration_behavior + end + + class SubscriptionSchedule < Stripe::StripeObject + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + attr_reader :new_reference + # The ID of the schedule the line applies to. + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + attr_reader :type + end + # Attribute for field applies_to + attr_reader :applies_to + # The subscription schedule that was created or updated from this quote. + attr_reader :subscription_schedule + end + + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + attr_reader :discount + end + + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # The aggregated discounts. + attr_reader :discounts + # The aggregated tax amounts by rate. + attr_reader :taxes + end + # This is the sum of all the discounts. + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + attr_reader :amount_tax + # Attribute for field breakdown + attr_reader :breakdown + end + + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + attr_reader :amount + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount will be transferred to the destination. + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + # Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + attr_reader :allow_backdated_lines + + # Total before any discounts or taxes are applied. + attr_reader :amount_subtotal + + # Total after discounts and taxes are applied. + attr_reader :amount_total + + # ID of the Connect Application that created the quote. + attr_reader :application + + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. + attr_reader :application_fee_amount + + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. + attr_reader :application_fee_percent + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + attr_reader :collection_method + + # Attribute for field computed + attr_reader :computed + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + attr_reader :customer + + # The tax rates applied to this quote. + attr_reader :default_tax_rates + + # A description that will be displayed on the quote PDF. + attr_reader :description + + # The discounts applied to this quote. + attr_reader :discounts + + # The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + attr_reader :expires_at + + # A footer that will be displayed on the quote PDF. + attr_reader :footer + + # Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. + attr_reader :from_quote + + # A header that will be displayed on the quote PDF. + attr_reader :header + + # Unique identifier for the object. + attr_reader :id + + # The invoice that was created from this quote. + attr_reader :invoice + + # Attribute for field invoice_settings + attr_reader :invoice_settings + + # A list of items the customer is being quoted for. + attr_reader :line_items + + # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + attr_reader :on_behalf_of + + # The status of the quote. + attr_reader :status + + # Details on when and why a quote has been marked as stale or canceled. + attr_reader :status_details + + # Attribute for field status_transitions + attr_reader :status_transitions + + # The subscription that was created or updated from this quote. + attr_reader :subscription + + # Attribute for field subscription_data + attr_reader :subscription_data + + # List representing overrides for `subscription_data` configurations for specific subscription schedules. + attr_reader :subscription_data_overrides + + # The subscription schedule that was created or updated from this quote. + attr_reader :subscription_schedule + + # The subscription schedules that were created or updated from this quote. + attr_reader :subscription_schedules + + # ID of the test clock this quote belongs to. + attr_reader :test_clock + + # Attribute for field total_details + attr_reader :total_details + + # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + attr_reader :transfer_data + # Accepts the specified quote. def accept(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/quote_line.rb b/lib/stripe/resources/quote_line.rb new file mode 100644 index 000000000..9df1a44f4 --- /dev/null +++ b/lib/stripe/resources/quote_line.rb @@ -0,0 +1,285 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + # A quote line defines a set of changes, in the order provided, that will be applied upon quote acceptance. + class QuoteLine < APIResource + OBJECT_NAME = "quote_line" + def self.object_name + "quote_line" + end + + class Action < Stripe::StripeObject + class AddDiscount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + attr_reader :index + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class AddItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + attr_reader :converts_to + # Determines the type of trial for this item. + attr_reader :type + end + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + attr_reader :metadata + # ID of the price to which the customer should be subscribed. + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + attr_reader :trial + end + + class RemoveDiscount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class RemoveItem < Stripe::StripeObject + # ID of a price to remove. + attr_reader :price + end + + class SetDiscount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class SetItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + attr_reader :converts_to + # Determines the type of trial for this item. + attr_reader :type + end + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + attr_reader :metadata + # ID of the price to which the customer should be subscribed. + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + attr_reader :trial + end + # Details for the `add_discount` type. + attr_reader :add_discount + # Details for the `add_item` type. + attr_reader :add_item + # Details for the `add_metadata` type: specify a hash of key-value pairs. + attr_reader :add_metadata + # Details for the `remove_discount` type. + attr_reader :remove_discount + # Details for the `remove_item` type. + attr_reader :remove_item + # Details for the `remove_metadata` type: specify an array of metadata keys. + attr_reader :remove_metadata + # Details for the `set_discounts` type. + attr_reader :set_discounts + # Details for the `set_items` type. + attr_reader :set_items + # Details for the `set_metadata` type: specify an array of key-value pairs. + attr_reader :set_metadata + # The type of action the quote line performs. + attr_reader :type + end + + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + attr_reader :new_reference + # The ID of the schedule the line applies to. + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + attr_reader :type + end + + class CancelSubscriptionSchedule < Stripe::StripeObject + # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + attr_reader :cancel_at + # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + attr_reader :invoice_now + # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + attr_reader :prorate + end + + class EndsAt < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The ID of a specific discount. + attr_reader :discount + end + + class Duration < Stripe::StripeObject + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + attr_reader :interval + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + attr_reader :interval_count + end + # The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `ends_at` field. For example, if `ends_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `ends_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `ends_at` is respecified. This field is guaranteed to be populated after quote acceptance. + attr_reader :computed + # Use the `end` time of a given discount. + attr_reader :discount_end + # Time span for the quote line starting from the `starts_at` date. + attr_reader :duration + # A precise Unix timestamp. + attr_reader :timestamp + # Select a way to pass in `ends_at`. + attr_reader :type + end + + class SetPauseCollection < Stripe::StripeObject + class Set < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + attr_reader :behavior + end + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + attr_reader :set + # Defines the type of the pause_collection behavior for the quote line. + attr_reader :type + end + + class StartsAt < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The ID of a specific discount. + attr_reader :discount + end + + class LineEndsAt < Stripe::StripeObject + # Unique identifier for the object. + attr_reader :id + end + # The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `starts_at` field. For example, if `starts_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `starts_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `starts_at` is respecified. This field is guaranteed to be populated after quote acceptance. + attr_reader :computed + # Use the `end` time of a given discount. + attr_reader :discount_end + # The timestamp the given line ends at. + attr_reader :line_ends_at + # A precise Unix timestamp. + attr_reader :timestamp + # Select a way to pass in `starts_at`. + attr_reader :type + end + + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + attr_reader :prorate_up_front + end + # Defines how the subscription should behave when a trial ends. + attr_reader :end_behavior + end + # A list of items the customer is being quoted for. + attr_reader :actions + + # Details to identify the subscription schedule the quote line applies to. + attr_reader :applies_to + + # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. + attr_reader :billing_cycle_anchor + + # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. + attr_reader :cancel_subscription_schedule + + # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. + attr_reader :ends_at + + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. + attr_reader :proration_behavior + + # Details to modify the pause_collection behavior of the subscription schedule. + attr_reader :set_pause_collection + + # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. + attr_reader :set_schedule_end + + # Details to identify the earliest timestamp where the proposed change should take effect. + attr_reader :starts_at + + # Settings related to subscription trials. + attr_reader :trial_settings + end +end diff --git a/lib/stripe/resources/quote_preview_invoice.rb b/lib/stripe/resources/quote_preview_invoice.rb index e7068e8b2..9268b3533 100644 --- a/lib/stripe/resources/quote_preview_invoice.rb +++ b/lib/stripe/resources/quote_preview_invoice.rb @@ -39,5 +39,694 @@ class QuotePreviewInvoice < APIResource def self.object_name "quote_preview_invoice" end + + class AmountsDue < Stripe::StripeObject + # Incremental amount due for this payment in cents (or local equivalent). + attr_reader :amount + # The amount in cents (or local equivalent) that was paid for this payment. + attr_reader :amount_paid + # The difference between the payment’s amount and amount_paid, in cents (or local equivalent). + attr_reader :amount_remaining + # Number of days from when invoice is finalized until the payment is due. + attr_reader :days_until_due + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + # Date on which a payment plan’s payment is due. + attr_reader :due_date + # Timestamp when the payment was paid. + attr_reader :paid_at + # The status of the payment, one of `open`, `paid`, or `past_due` + attr_reader :status + end + + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + attr_reader :new_reference + # The ID of the schedule the line applies to. + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + attr_reader :type + end + + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + # The status of the most recent automated tax calculation for this invoice. + attr_reader :status + end + + class CustomField < Stripe::StripeObject + # The name of the custom field. + attr_reader :name + # The value of the custom field. + attr_reader :value + end + + class CustomerAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class CustomerShipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class CustomerTaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + + class FromInvoice < Stripe::StripeObject + # The relation between this invoice and the cloned invoice + attr_reader :action + # The invoice that was cloned. + attr_reader :invoice + end + + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + + class LastFinalizationError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + attr_reader :setup_intent + # Attribute for field source + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + attr_reader :type + end + + class PaymentSettings < Stripe::StripeObject + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Bank account verification method. + attr_reader :verification_method + end + + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + attr_reader :preferred_language + end + + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + # Whether Installments are enabled for this Invoice. + attr_reader :enabled + end + # Attribute for field installments + attr_reader :installments + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + attr_reader :request_three_d_secure + end + + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + attr_reader :country + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + attr_reader :funding_type + end + + class IdBankTransfer < Stripe::StripeObject; end + class Konbini < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + attr_reader :institution + end + # Attribute for field filters + attr_reader :filters + # The list of permissions to request. The `payment_method` permission must be included. + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + end + # Attribute for field financial_connections + attr_reader :financial_connections + # Bank account verification method. + attr_reader :verification_method + end + # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + attr_reader :acss_debit + # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + attr_reader :bancontact + # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + attr_reader :card + # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + attr_reader :customer_balance + # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent. + attr_reader :id_bank_transfer + # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + attr_reader :konbini + # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + attr_reader :sepa_debit + # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + attr_reader :us_bank_account + end + # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + attr_reader :default_mandate + # Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + attr_reader :payment_method_options + # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + attr_reader :payment_method_types + end + + class Rendering < Stripe::StripeObject + class Pdf < Stripe::StripeObject + # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. + attr_reader :page_size + end + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + attr_reader :amount_tax_display + # Invoice pdf rendering options + attr_reader :pdf + # ID of the rendering template that the invoice is formatted by. + attr_reader :template + # Version of the rendering template that the invoice is using. + attr_reader :template_version + end + + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + # Total shipping cost before any taxes are applied. + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + attr_reader :amount_tax + # Total shipping cost after taxes are applied. + attr_reader :amount_total + # The ID of the ShippingRate for this invoice. + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + attr_reader :taxes + end + + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + + class StatusTransitions < Stripe::StripeObject + # The time that the invoice draft was finalized. + attr_reader :finalized_at + # The time that the invoice was marked uncollectible. + attr_reader :marked_uncollectible_at + # The time that the invoice was paid. + attr_reader :paid_at + # The time that the invoice was voided. + attr_reader :voided_at + end + + class SubscriptionDetails < Stripe::StripeObject + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + attr_reader :behavior + # The time after which the subscription will resume collecting payments. + attr_reader :resumes_at + end + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + # *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + attr_reader :metadata + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + attr_reader :pause_collection + end + + class ThresholdReason < Stripe::StripeObject + class ItemReason < Stripe::StripeObject + # The IDs of the line items that triggered the threshold invoice. + attr_reader :line_item_ids + # The quantity threshold boundary that applied to the given line item. + attr_reader :usage_gte + end + # The total invoice amount threshold boundary if it triggered the threshold invoice. + attr_reader :amount_gte + # Indicates which line items triggered a threshold invoice. + attr_reader :item_reasons + end + + class TotalDiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + attr_reader :amount + # The discount that was applied to get this discount amount. + attr_reader :discount + end + + class TotalMarginAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the reduction in line item amount. + attr_reader :amount + # The margin that was applied to get this margin amount. + attr_reader :margin + end + + class TotalPretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + attr_reader :discount + # The margin that was applied to get this pretax credit amount. + attr_reader :margin + # Type of the pretax credit amount referenced. + attr_reader :type + end + + class TotalTaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + attr_reader :taxable_amount + end + + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + attr_reader :amount + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + # The country of the business associated with this invoice, most often the business creating the invoice. + attr_reader :account_country + + # The public name of the business associated with this invoice, most often the business creating the invoice. + attr_reader :account_name + + # The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + attr_reader :account_tax_ids + + # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + attr_reader :amount_due + + # Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit balance. + attr_reader :amount_overpaid + + # The amount, in cents (or local equivalent), that was paid. + attr_reader :amount_paid + + # The difference between amount_due and amount_paid, in cents (or local equivalent). + attr_reader :amount_remaining + + # This is the sum of all the shipping amounts. + attr_reader :amount_shipping + + # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. + attr_reader :amounts_due + + # ID of the Connect Application that created the invoice. + attr_reader :application + + # The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + attr_reader :application_fee_amount + + # Attribute for field applies_to + attr_reader :applies_to + + # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. + attr_reader :attempt_count + + # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + attr_reader :attempted + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + attr_reader :automatically_finalizes_at + + # Indicates the reason why the invoice was created. + # + # * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + # * `subscription_create`: A new subscription was created. + # * `subscription_cycle`: A subscription advanced into a new period. + # * `subscription_threshold`: A subscription reached a billing threshold. + # * `subscription_update`: A subscription was updated. + # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + attr_reader :billing_reason + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + attr_reader :collection_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Custom fields displayed on the invoice. + attr_reader :custom_fields + + # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_address + + # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_email + + # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_name + + # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_phone + + # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_shipping + + # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_tax_exempt + + # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. + attr_reader :customer_tax_ids + + # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin. + attr_reader :default_margins + + # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + attr_reader :default_payment_method + + # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + attr_reader :default_source + + # The tax rates applied to this invoice, if any. + attr_reader :default_tax_rates + + # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + attr_reader :description + + # Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + attr_reader :discount + + # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`. + attr_reader :due_date + + # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + attr_reader :effective_at + + # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + attr_reader :ending_balance + + # Footer displayed on the invoice. + attr_reader :footer + + # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + attr_reader :from_invoice + + # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. + attr_reader :id + + # Attribute for field issuer + attr_reader :issuer + + # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + attr_reader :last_finalization_error + + # The ID of the most recent non-draft revision of this invoice + attr_reader :latest_revision + + # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`. + attr_reader :next_payment_attempt + + # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + attr_reader :on_behalf_of + + # Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + attr_reader :paid + + # Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + attr_reader :paid_out_of_band + + # The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + attr_reader :payment_intent + + # Attribute for field payment_settings + attr_reader :payment_settings + + # Payments for this invoice + attr_reader :payments + + # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + attr_reader :period_end + + # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + attr_reader :period_start + + # Total amount of all post-payment credit notes issued for this invoice. + attr_reader :post_payment_credit_notes_amount + + # Total amount of all pre-payment credit notes issued for this invoice. + attr_reader :pre_payment_credit_notes_amount + + # The quote this invoice was generated from. + attr_reader :quote + + # This is the transaction number that appears on email receipts sent for this invoice. + attr_reader :receipt_number + + # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + attr_reader :rendering + + # The details of the cost of shipping, including the ShippingRate applied on the invoice. + attr_reader :shipping_cost + + # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + attr_reader :shipping_details + + # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. + attr_reader :starting_balance + + # Extra information about an invoice for the customer's credit card statement. + attr_reader :statement_descriptor + + # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # Attribute for field subscription + attr_reader :subscription + + # Details about the subscription that created this invoice. + attr_reader :subscription_details + + # Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + attr_reader :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 + attr_reader :subtotal + + # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + attr_reader :subtotal_excluding_tax + + # The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + attr_reader :tax + + # ID of the test clock this invoice belongs to. + attr_reader :test_clock + + # Attribute for field threshold_reason + attr_reader :threshold_reason + + # Total after discounts and taxes. + attr_reader :total + + # The aggregate amounts calculated per discount across all line items. + attr_reader :total_discount_amounts + + # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + attr_reader :total_excluding_tax + + # The aggregate amounts calculated per margin across all line items. + attr_reader :total_margin_amounts + + # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + attr_reader :total_pretax_credit_amounts + + # The aggregate amounts calculated per tax rate for all line items. + attr_reader :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. + attr_reader :transfer_data + + # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + attr_reader :webhooks_delivered_at end end diff --git a/lib/stripe/resources/quote_preview_subscription_schedule.rb b/lib/stripe/resources/quote_preview_subscription_schedule.rb index 1a408efd0..f91baab9d 100644 --- a/lib/stripe/resources/quote_preview_subscription_schedule.rb +++ b/lib/stripe/resources/quote_preview_subscription_schedule.rb @@ -7,5 +7,373 @@ class QuotePreviewSubscriptionSchedule < APIResource def self.object_name "quote_preview_subscription_schedule" end + + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + attr_reader :new_reference + # The ID of the schedule the line applies to. + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + attr_reader :type + end + + class CurrentPhase < Stripe::StripeObject + # The end of this phase of the subscription schedule. + attr_reader :end_date + # The start of this phase of the subscription schedule. + attr_reader :start_date + end + + class DefaultSettings < Stripe::StripeObject + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + end + + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + attr_reader :reset_billing_cycle_anchor + end + + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + attr_reader :days_until_due + # Attribute for field issuer + attr_reader :issuer + end + + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + attr_reader :application_fee_percent + # Attribute for field automatic_tax + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + attr_reader :collection_method + # ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + attr_reader :default_payment_method + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # Attribute for field invoice_settings + attr_reader :invoice_settings + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + attr_reader :on_behalf_of + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + attr_reader :transfer_data + end + + class LastPriceMigrationError < Stripe::StripeObject + class FailedTransition < Stripe::StripeObject + # The original price to be migrated. + attr_reader :source_price + # The intended resulting price of the migration. + attr_reader :target_price + end + # The time at which the price migration encountered an error. + attr_reader :errored_at + # The involved price pairs in each failed transition. + attr_reader :failed_transitions + # The type of error encountered by the price migration. + attr_reader :type + end + + class Phase < Stripe::StripeObject + class AddInvoiceItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + # The stackable discounts that will be applied to the item. + attr_reader :discounts + # ID of the price used to generate the invoice item. + attr_reader :price + # The quantity of the invoice item. + attr_reader :quantity + # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + attr_reader :tax_rates + end + + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + end + + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + attr_reader :reset_billing_cycle_anchor + end + + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + attr_reader :days_until_due + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + attr_reader :issuer + end + + class Item < Stripe::StripeObject + class BillingThresholds < Stripe::StripeObject + # Usage threshold that triggers the subscription to create an invoice + attr_reader :usage_gte + end + + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + attr_reader :converts_to + # Determines the type of trial for this item. + attr_reader :type + end + # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + attr_reader :billing_thresholds + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + attr_reader :metadata + # ID of the plan to which the customer should be subscribed. + attr_reader :plan + # ID of the price to which the customer should be subscribed. + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + attr_reader :trial + end + + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + attr_reader :behavior + end + + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + attr_reader :prorate_up_front + end + # Defines how the subscription should behave when a trial ends. + attr_reader :end_behavior + end + # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + attr_reader :add_invoice_items + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + attr_reader :application_fee_percent + # Attribute for field automatic_tax + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + attr_reader :collection_method + # ID of the coupon to use during this phase of the subscription schedule. + attr_reader :coupon + # 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). + attr_reader :currency + # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + attr_reader :default_payment_method + # The default tax rates to apply to the subscription during this phase of the subscription schedule. + attr_reader :default_tax_rates + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + attr_reader :discounts + # The end of this phase of the subscription schedule. + attr_reader :end_date + # The invoice settings applicable during this phase. + attr_reader :invoice_settings + # Subscription items to configure the subscription to during this phase of the subscription schedule. + attr_reader :items + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + attr_reader :metadata + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + attr_reader :on_behalf_of + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + attr_reader :pause_collection + # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. + attr_reader :proration_behavior + # The start of this phase of the subscription schedule. + attr_reader :start_date + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + attr_reader :transfer_data + # Specify behavior of the trial when crossing schedule phase boundaries + attr_reader :trial_continuation + # When the trial ends within the phase. + attr_reader :trial_end + # Settings related to any trials on the subscription during this phase. + attr_reader :trial_settings + end + + class Prebilling < Stripe::StripeObject + # ID of the prebilling invoice. + attr_reader :invoice + # The end of the last period for which the invoice pre-bills. + attr_reader :period_end + # The start of the first period for which the invoice pre-bills. + attr_reader :period_start + # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + attr_reader :update_behavior + end + # ID of the Connect Application that created the schedule. + attr_reader :application + + # Attribute for field applies_to + attr_reader :applies_to + + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + attr_reader :billing_behavior + + # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + attr_reader :canceled_at + + # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + attr_reader :completed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + attr_reader :current_phase + + # ID of the customer who owns the subscription schedule. + attr_reader :customer + + # Attribute for field default_settings + attr_reader :default_settings + + # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + attr_reader :end_behavior + + # Unique identifier for the object. + attr_reader :id + + # Details of the most recent price migration that failed for the subscription schedule. + attr_reader :last_price_migration_error + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Configuration for the subscription schedule's phases. + attr_reader :phases + + # Time period and invoice for a Subscription billed in advance. + attr_reader :prebilling + + # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + attr_reader :released_at + + # ID of the subscription once managed by the subscription schedule (if it is released). + attr_reader :released_subscription + + # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + attr_reader :status + + # ID of the subscription managed by the subscription schedule. + attr_reader :subscription + + # ID of the test clock this subscription schedule belongs to. + attr_reader :test_clock end end diff --git a/lib/stripe/resources/radar/early_fraud_warning.rb b/lib/stripe/resources/radar/early_fraud_warning.rb index 04a169878..20be30f79 100644 --- a/lib/stripe/resources/radar/early_fraud_warning.rb +++ b/lib/stripe/resources/radar/early_fraud_warning.rb @@ -15,6 +15,30 @@ def self.object_name "radar.early_fraud_warning" end + # An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. + attr_reader :actionable + + # ID of the charge this early fraud warning is for, optionally expanded. + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The type of fraud labelled by the issuer. One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`. + attr_reader :fraud_type + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the Payment Intent this early fraud warning is for, optionally expanded. + attr_reader :payment_intent + # Returns a list of early fraud warnings. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/radar/value_list.rb b/lib/stripe/resources/radar/value_list.rb index 80d1839ce..92464bf57 100644 --- a/lib/stripe/resources/radar/value_list.rb +++ b/lib/stripe/resources/radar/value_list.rb @@ -17,6 +17,39 @@ def self.object_name "radar.value_list" end + # The name of the value list for use in rules. + attr_reader :alias + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The name or email address of the user who created this value list. + attr_reader :created_by + + # Unique identifier for the object. + attr_reader :id + + # The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + attr_reader :item_type + + # List of items contained within this value list. + attr_reader :list_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The name of the value list. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Always true for a deleted object + attr_reader :deleted + # Creates a new ValueList object, which can then be referenced in rules. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/radar/value_list_item.rb b/lib/stripe/resources/radar/value_list_item.rb index 1940e1702..5f98cbfc6 100644 --- a/lib/stripe/resources/radar/value_list_item.rb +++ b/lib/stripe/resources/radar/value_list_item.rb @@ -16,6 +16,30 @@ def self.object_name "radar.value_list_item" end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The name or email address of the user who added this item to the value list. + attr_reader :created_by + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The value of the item. + attr_reader :value + + # The identifier of the value list this item belongs to. + attr_reader :value_list + + # Always true for a deleted object + attr_reader :deleted + # Creates a new ValueListItem object, which is added to the specified parent value list. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/refund.rb b/lib/stripe/resources/refund.rb index ad962b2da..6be35c196 100644 --- a/lib/stripe/resources/refund.rb +++ b/lib/stripe/resources/refund.rb @@ -17,6 +17,276 @@ def self.object_name "refund" end + class DestinationDetails < Stripe::StripeObject + class Affirm < Stripe::StripeObject; end + class AfterpayClearpay < Stripe::StripeObject; end + class Alipay < Stripe::StripeObject; end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + class AuBankTransfer < Stripe::StripeObject; end + + class Blik < Stripe::StripeObject + # For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. + attr_reader :network_decline_code + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class BrBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class Card < Stripe::StripeObject + # Value of the reference number assigned to the refund. + attr_reader :reference + # Status of the reference number on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + # Type of the reference number assigned to the refund. + attr_reader :reference_type + # The type of refund. This can be `refund`, `reversal`, or `pending`. + attr_reader :type + end + + class Cashapp < Stripe::StripeObject; end + class CustomerCashBalance < Stripe::StripeObject; end + class Eps < Stripe::StripeObject; end + + class EuBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class GbBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class Giropay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject; end + + class IdBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class JpBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class Klarna < Stripe::StripeObject; end + + class Multibanco < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class MxBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class P24 < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class Paynow < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject; end + class Pix < Stripe::StripeObject; end + class Revolut < Stripe::StripeObject; end + class Sofort < Stripe::StripeObject; end + + class Swish < Stripe::StripeObject + # For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. + attr_reader :network_decline_code + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class ThBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class UsBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + attr_reader :reference_status + end + + class WechatPay < Stripe::StripeObject; end + class Zip < Stripe::StripeObject; end + # Attribute for field affirm + attr_reader :affirm + # Attribute for field afterpay_clearpay + attr_reader :afterpay_clearpay + # Attribute for field alipay + attr_reader :alipay + # Attribute for field alma + attr_reader :alma + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_bank_transfer + attr_reader :au_bank_transfer + # Attribute for field blik + attr_reader :blik + # Attribute for field br_bank_transfer + attr_reader :br_bank_transfer + # Attribute for field card + attr_reader :card + # Attribute for field cashapp + attr_reader :cashapp + # Attribute for field customer_cash_balance + attr_reader :customer_cash_balance + # Attribute for field eps + attr_reader :eps + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # Attribute for field gb_bank_transfer + attr_reader :gb_bank_transfer + # Attribute for field giropay + attr_reader :giropay + # Attribute for field grabpay + attr_reader :grabpay + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + # Attribute for field jp_bank_transfer + attr_reader :jp_bank_transfer + # Attribute for field klarna + attr_reader :klarna + # Attribute for field multibanco + attr_reader :multibanco + # Attribute for field mx_bank_transfer + attr_reader :mx_bank_transfer + # Attribute for field p24 + attr_reader :p24 + # Attribute for field paynow + attr_reader :paynow + # Attribute for field paypal + attr_reader :paypal + # Attribute for field pix + attr_reader :pix + # Attribute for field revolut + attr_reader :revolut + # Attribute for field sofort + attr_reader :sofort + # Attribute for field swish + attr_reader :swish + # Attribute for field th_bank_transfer + attr_reader :th_bank_transfer + # The type of transaction-specific details of the payment method used in the refund (e.g., `card`). An additional hash is included on `destination_details` with a name matching this value. It contains information specific to the refund transaction. + attr_reader :type + # Attribute for field us_bank_transfer + attr_reader :us_bank_transfer + # Attribute for field wechat_pay + attr_reader :wechat_pay + # Attribute for field zip + attr_reader :zip + end + + class NextAction < Stripe::StripeObject + class DisplayDetails < Stripe::StripeObject + class EmailSent < Stripe::StripeObject + # The timestamp when the email was sent. + attr_reader :email_sent_at + # The recipient's email address. + attr_reader :email_sent_to + end + # Attribute for field email_sent + attr_reader :email_sent + # The expiry timestamp. + attr_reader :expires_at + end + # Attribute for field display_details + attr_reader :display_details + # Type of the next action to perform. + attr_reader :type + end + # Amount, in cents (or local equivalent). + attr_reader :amount + + # Balance transaction that describes the impact on your account balance. + attr_reader :balance_transaction + + # ID of the charge that's refunded. + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). + attr_reader :description + + # Attribute for field destination_details + attr_reader :destination_details + + # After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + attr_reader :failure_balance_transaction + + # Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. + attr_reader :failure_reason + + # Unique identifier for the object. + attr_reader :id + + # For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. + attr_reader :instructions_email + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Attribute for field next_action + attr_reader :next_action + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the PaymentIntent that's refunded. + attr_reader :payment_intent + + # Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). + attr_reader :reason + + # This is the transaction number that appears on email receipts sent for this refund. + attr_reader :receipt_number + + # The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. + attr_reader :source_transfer_reversal + + # Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). + attr_reader :status + + # This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. + attr_reader :transfer_reversal + # Cancels a refund with a status of requires_action. # # You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. diff --git a/lib/stripe/resources/reporting/report_run.rb b/lib/stripe/resources/reporting/report_run.rb index 32f259be0..bbbc086cb 100644 --- a/lib/stripe/resources/reporting/report_run.rb +++ b/lib/stripe/resources/reporting/report_run.rb @@ -20,6 +20,59 @@ def self.object_name "reporting.report_run" end + class Parameters < Stripe::StripeObject + # The set of output columns requested for inclusion in the report run. + attr_reader :columns + # Connected account ID by which to filter the report run. + attr_reader :connected_account + # Currency of objects to be included in the report run. + attr_reader :currency + # Ending timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. + attr_reader :interval_end + # Starting timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. + attr_reader :interval_start + # Payout ID by which to filter the report run. + attr_reader :payout + # Category of balance transactions to be included in the report run. + attr_reader :reporting_category + # Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. + attr_reader :timezone + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # If something should go wrong during the run, a message about the failure (populated when + # `status=failed`). + attr_reader :error + + # Unique identifier for the object. + attr_reader :id + + # `true` if the report is run on live mode data and `false` if it is run on test mode data. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field parameters + attr_reader :parameters + + # The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. + attr_reader :report_type + + # The file object representing the result of the report run (populated when + # `status=succeeded`). + attr_reader :result + + # Status of this report run. This will be `pending` when the run is initially created. + # When the run finishes, this will be set to `succeeded` and the `result` field will be populated. + # Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. + attr_reader :status + + # Timestamp at which this run successfully finished (populated when + # `status=succeeded`). Measured in seconds since the Unix epoch. + attr_reader :succeeded_at + # Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/reporting/report_type.rb b/lib/stripe/resources/reporting/report_type.rb index 8d0683253..3e1870cfc 100644 --- a/lib/stripe/resources/reporting/report_type.rb +++ b/lib/stripe/resources/reporting/report_type.rb @@ -19,6 +19,33 @@ def self.object_name "reporting.report_type" end + # Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. + attr_reader :data_available_end + + # Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. + attr_reader :data_available_start + + # List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the `columns` parameter, this will be null.) + attr_reader :default_columns + + # The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Human-readable name of the Report Type + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # When this Report Type was latest updated. Measured in seconds since the Unix epoch. + attr_reader :updated + + # Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + attr_reader :version + # Returns a full list of Report Types. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/reserve_transaction.rb b/lib/stripe/resources/reserve_transaction.rb new file mode 100644 index 000000000..78b98dab1 --- /dev/null +++ b/lib/stripe/resources/reserve_transaction.rb @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class ReserveTransaction < APIResource + OBJECT_NAME = "reserve_transaction" + def self.object_name + "reserve_transaction" + end + + # Attribute for field amount + attr_reader :amount + + # 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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + end +end diff --git a/lib/stripe/resources/reversal.rb b/lib/stripe/resources/reversal.rb index 5dd783112..135a51e88 100644 --- a/lib/stripe/resources/reversal.rb +++ b/lib/stripe/resources/reversal.rb @@ -23,6 +23,36 @@ def self.object_name "transfer_reversal" end + # Amount, in cents (or local equivalent). + attr_reader :amount + + # Balance transaction that describes the impact on your account balance. + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Linked payment refund for the transfer reversal. + attr_reader :destination_payment_refund + + # Unique identifier for the object. + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # ID of the refund responsible for the transfer reversal. + attr_reader :source_refund + + # ID of the transfer that was reversed. + attr_reader :transfer + def resource_url "#{Transfer.resource_url}/#{CGI.escape(transfer)}/reversals" \ "/#{CGI.escape(id)}" diff --git a/lib/stripe/resources/review.rb b/lib/stripe/resources/review.rb index d94344ff6..e3a4ddd8b 100644 --- a/lib/stripe/resources/review.rb +++ b/lib/stripe/resources/review.rb @@ -14,6 +14,71 @@ def self.object_name "review" end + class IpAddressLocation < Stripe::StripeObject + # The city where the payment originated. + attr_reader :city + # Two-letter ISO code representing the country where the payment originated. + attr_reader :country + # The geographic latitude where the payment originated. + attr_reader :latitude + # The geographic longitude where the payment originated. + attr_reader :longitude + # The state/county/province/region where the payment originated. + attr_reader :region + end + + class Session < Stripe::StripeObject + # The browser used in this browser session (e.g., `Chrome`). + attr_reader :browser + # Information about the device used for the browser session (e.g., `Samsung SM-G930T`). + attr_reader :device + # The platform for the browser session (e.g., `Macintosh`). + attr_reader :platform + # The version for the browser session (e.g., `61.0.3163.100`). + attr_reader :version + end + # The ZIP or postal code of the card used, if applicable. + attr_reader :billing_zip + + # The charge associated with this review. + attr_reader :charge + + # The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + attr_reader :closed_reason + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # The IP address where the payment originated. + attr_reader :ip_address + + # Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + attr_reader :ip_address_location + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # If `true`, the review needs action. + attr_reader :open + + # The reason the review was opened. One of `rule` or `manual`. + attr_reader :opened_reason + + # The PaymentIntent ID associated with this review, if one exists. + attr_reader :payment_intent + + # The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + attr_reader :reason + + # Information related to the browsing session of the user who initiated the payment. + attr_reader :session + # Approves a Review object, closing it and removing it from the list of reviews. def approve(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/setup_attempt.rb b/lib/stripe/resources/setup_attempt.rb index bbe8eb25d..d87da884d 100644 --- a/lib/stripe/resources/setup_attempt.rb +++ b/lib/stripe/resources/setup_attempt.rb @@ -14,6 +14,340 @@ def self.object_name "setup_attempt" end + class PaymentMethodDetails < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + class AuBecsDebit < Stripe::StripeObject; end + class BacsDebit < Stripe::StripeObject; end + + class Bancontact < Stripe::StripeObject + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + attr_reader :iban_last4 + # Preferred language of the Bancontact authorization page that the customer is redirected to. + # Can be one of `en`, `de`, `fr`, or `nl` + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by Bancontact directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class Boleto < Stripe::StripeObject; end + + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + attr_reader :cvc_check + end + + class ThreeDSecure < Stripe::StripeObject + # For authenticated transactions: how the customer was authenticated by + # the issuing bank. + attr_reader :authentication_flow + # The Electronic Commerce Indicator (ECI). A protocol-level field + # indicating what degree of authentication was performed. + attr_reader :electronic_commerce_indicator + # Indicates the outcome of 3D Secure authentication. + attr_reader :result + # Additional information about why 3D Secure succeeded or failed based + # on the `result`. + attr_reader :result_reason + # The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + # (dsTransId) for this payment. + attr_reader :transaction_id + # The version of 3D Secure that was used. + attr_reader :version + end + + class Wallet < Stripe::StripeObject + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + # Attribute for field apple_pay + attr_reader :apple_pay + # Attribute for field google_pay + attr_reader :google_pay + # The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + attr_reader :type + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :brand + # Check results by Card networks on Card address and CVC at the time of authorization + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + attr_reader :description + # Two-digit number representing the card's expiration month. + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + attr_reader :issuer + # The last four digits of the card. + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + attr_reader :network + # Populated if this authorization used 3D Secure authentication. + attr_reader :three_d_secure + # If this Card is part of a card wallet, this contains the details of the card wallet. + attr_reader :wallet + end + + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + attr_reader :type + end + # The ID of the Card PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_card + # Details about payments collected offline. + attr_reader :offline + end + + class Cashapp < Stripe::StripeObject; end + + class IdBankTransfer < Stripe::StripeObject + # Bank where the account is located. + attr_reader :bank + # Local bank code of the bank. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + attr_reader :display_name + end + + class Ideal < Stripe::StripeObject + # The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + attr_reader :bank + # The Bank Identifier Code of the customer's bank. + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + attr_reader :iban_last4 + # Owner's verified full name. Values are verified or provided by iDEAL directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class KakaoPay < Stripe::StripeObject; end + class Klarna < Stripe::StripeObject; end + class KrCard < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject; end + class Payto < Stripe::StripeObject; end + class RevolutPay < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + + class Sofort < Stripe::StripeObject + # Bank code of bank associated with the bank account. + attr_reader :bank_code + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + attr_reader :iban_last4 + # Preferred language of the Sofort authorization page that the customer is redirected to. + # Can be one of `en`, `de`, `fr`, or `nl` + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by Sofort directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + end + + class UsBankAccount < Stripe::StripeObject; end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field bancontact + attr_reader :bancontact + # Attribute for field boleto + attr_reader :boleto + # Attribute for field card + attr_reader :card + # Attribute for field card_present + attr_reader :card_present + # Attribute for field cashapp + attr_reader :cashapp + # Attribute for field id_bank_transfer + attr_reader :id_bank_transfer + # Attribute for field ideal + attr_reader :ideal + # Attribute for field kakao_pay + attr_reader :kakao_pay + # Attribute for field klarna + attr_reader :klarna + # Attribute for field kr_card + attr_reader :kr_card + # Attribute for field link + attr_reader :link + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field revolut_pay + attr_reader :revolut_pay + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field sofort + attr_reader :sofort + # The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class SetupError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + attr_reader :setup_intent + # Attribute for field source + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + attr_reader :type + end + # The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. + attr_reader :application + + # If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + # + # It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + attr_reader :attach_to_self + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. + attr_reader :customer + + # Indicates the directions of money movement for which this payment method is intended to be used. + # + # Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + attr_reader :flow_directions + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. + attr_reader :on_behalf_of + + # ID of the payment method used with this SetupAttempt. + attr_reader :payment_method + + # Attribute for field payment_method_details + attr_reader :payment_method_details + + # The error encountered during this attempt to confirm the SetupIntent, if any. + attr_reader :setup_error + + # ID of the SetupIntent that this attempt belongs to. + attr_reader :setup_intent + + # Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. + attr_reader :status + + # The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. + attr_reader :usage + # Returns a list of SetupAttempts that associate with a provided SetupIntent. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/setup_attempts", params: filters, opts: opts) diff --git a/lib/stripe/resources/setup_intent.rb b/lib/stripe/resources/setup_intent.rb index 9aa3b2b66..b7ef78516 100644 --- a/lib/stripe/resources/setup_intent.rb +++ b/lib/stripe/resources/setup_intent.rb @@ -33,6 +33,380 @@ def self.object_name "setup_intent" end + class AutomaticPaymentMethods < Stripe::StripeObject + # Controls whether this SetupIntent will accept redirect-based payment methods. + # + # Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + attr_reader :allow_redirects + # Automatically calculates compatible payment methods + attr_reader :enabled + end + + class LastSetupError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + attr_reader :setup_intent + # Attribute for field source + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + attr_reader :type + end + + class NextAction < Stripe::StripeObject + class CashappHandleRedirectOrDisplayQrCode < Stripe::StripeObject + class QrCode < Stripe::StripeObject + # The date (unix timestamp) when the QR code expires. + attr_reader :expires_at + # The image_url_png string used to render QR code + attr_reader :image_url_png + # The image_url_svg string used to render QR code + attr_reader :image_url_svg + end + # The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + attr_reader :hosted_instructions_url + # The url for mobile redirect based auth + attr_reader :mobile_auth_url + # Attribute for field qr_code + attr_reader :qr_code + end + + class RedirectToUrl < Stripe::StripeObject + # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + attr_reader :return_url + # The URL you must redirect your customer to in order to authenticate. + attr_reader :url + end + + class VerifyWithMicrodeposits < Stripe::StripeObject + # The timestamp when the microdeposits are expected to land. + attr_reader :arrival_date + # The URL for the hosted verification page, which allows customers to verify their bank account. + attr_reader :hosted_verification_url + # The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. + attr_reader :microdeposit_type + end + # Attribute for field cashapp_handle_redirect_or_display_qr_code + attr_reader :cashapp_handle_redirect_or_display_qr_code + # Attribute for field redirect_to_url + attr_reader :redirect_to_url + # Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + attr_reader :type + # When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. + attr_reader :use_stripe_sdk + # Attribute for field verify_with_microdeposits + attr_reader :verify_with_microdeposits + end + + class PaymentMethodConfigurationDetails < Stripe::StripeObject + # ID of the payment method configuration used. + attr_reader :id + # ID of the parent payment method configuration used. + attr_reader :parent + end + + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + attr_reader :custom_mandate_url + # List of Stripe products where this mandate can be selected automatically. + attr_reader :default_for + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + attr_reader :interval_description + # Payment schedule for the mandate. + attr_reader :payment_schedule + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Currency supported by the bank account + attr_reader :currency + # Attribute for field mandate_options + attr_reader :mandate_options + # Bank account verification method. + attr_reader :verification_method + end + + class AmazonPay < Stripe::StripeObject; end + + class BacsDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + end + + class Card < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount to be charged for future payments. + attr_reader :amount + # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + attr_reader :amount_type + # 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). + attr_reader :currency + # A description of the mandate or subscription that is meant to be displayed to the customer. + attr_reader :description + # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + attr_reader :end_date + # Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + attr_reader :interval + # The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + attr_reader :interval_count + # Unique identifier for the mandate or subscription. + attr_reader :reference + # Start date of the mandate or subscription. Start date should not be lesser than yesterday. + attr_reader :start_date + # Specifies the type of mandates supported. Possible values are `india`. + attr_reader :supported_types + end + # Configuration options for setting up an eMandate for cards issued in India. + attr_reader :mandate_options + # Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. + attr_reader :network + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + attr_reader :request_three_d_secure + end + + class CardPresent < Stripe::StripeObject; end + + class Link < Stripe::StripeObject + # [Deprecated] This is a legacy parameter that no longer has any function. + attr_reader :persistent_token + end + + class Paypal < Stripe::StripeObject + # The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + attr_reader :billing_agreement_id + # 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). + attr_reader :currency + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + attr_reader :subsellers + end + + class Payto < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + attr_reader :end_date + # The periodicity at which payments will be collected. + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + attr_reader :purpose + # Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + attr_reader :start_date + end + # Attribute for field mandate_options + attr_reader :mandate_options + end + + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + attr_reader :mandate_options + end + + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + attr_reader :institution + end + + class ManualEntry < Stripe::StripeObject + # Settings for configuring manual entry of account details. + attr_reader :mode + end + # Attribute for field filters + attr_reader :filters + # Attribute for field manual_entry + attr_reader :manual_entry + # The list of permissions to request. The `payment_method` permission must be included. + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + attr_reader :return_url + end + + class MandateOptions < Stripe::StripeObject + # Mandate collection method + attr_reader :collection_method + end + # Attribute for field financial_connections + attr_reader :financial_connections + # Attribute for field mandate_options + attr_reader :mandate_options + # Bank account verification method. + attr_reader :verification_method + end + # Attribute for field acss_debit + attr_reader :acss_debit + # Attribute for field amazon_pay + attr_reader :amazon_pay + # Attribute for field bacs_debit + attr_reader :bacs_debit + # Attribute for field card + attr_reader :card + # Attribute for field card_present + attr_reader :card_present + # Attribute for field link + attr_reader :link + # Attribute for field paypal + attr_reader :paypal + # Attribute for field payto + attr_reader :payto + # Attribute for field sepa_debit + attr_reader :sepa_debit + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + # ID of the Connect application that created the SetupIntent. + attr_reader :application + + # If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + # + # It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + attr_reader :attach_to_self + + # Settings for dynamic payment methods compatible with this Setup Intent + attr_reader :automatic_payment_methods + + # Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + attr_reader :cancellation_reason + + # The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. + # + # The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + attr_reader :client_secret + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # ID of the Customer this SetupIntent belongs to, if one exists. + # + # If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Indicates the directions of money movement for which this payment method is intended to be used. + # + # Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + attr_reader :flow_directions + + # Unique identifier for the object. + attr_reader :id + + # The error encountered in the previous SetupIntent confirmation. + attr_reader :last_setup_error + + # The most recent SetupAttempt for this SetupIntent. + attr_reader :latest_attempt + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # ID of the multi use Mandate generated by the SetupIntent. + attr_reader :mandate + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + attr_reader :next_action + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) for which the setup is intended. + attr_reader :on_behalf_of + + # ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead. + attr_reader :payment_method + + # Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this Setup Intent. + attr_reader :payment_method_configuration_details + + # Payment method-specific configuration for this SetupIntent. + attr_reader :payment_method_options + + # The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + attr_reader :payment_method_types + + # ID of the single_use Mandate generated by the SetupIntent. + attr_reader :single_use_mandate + + # [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + attr_reader :status + + # Indicates how the payment method is intended to be used in the future. + # + # Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`. + attr_reader :usage + # You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. # # After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. diff --git a/lib/stripe/resources/shipping_rate.rb b/lib/stripe/resources/shipping_rate.rb index 16a850fa9..d7877f956 100644 --- a/lib/stripe/resources/shipping_rate.rb +++ b/lib/stripe/resources/shipping_rate.rb @@ -14,6 +14,76 @@ def self.object_name "shipping_rate" end + class DeliveryEstimate < Stripe::StripeObject + class Maximum < Stripe::StripeObject + # A unit of time. + attr_reader :unit + # Must be greater than 0. + attr_reader :value + end + + class Minimum < Stripe::StripeObject + # A unit of time. + attr_reader :unit + # Must be greater than 0. + attr_reader :value + end + # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + attr_reader :maximum + # The lower bound of the estimated range. If empty, represents no lower bound. + attr_reader :minimum + end + + class FixedAmount < Stripe::StripeObject + class CurrencyOptions < Stripe::StripeObject + # A non-negative integer in cents representing how much to charge. + attr_reader :amount + # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + attr_reader :tax_behavior + end + # A non-negative integer in cents representing how much to charge. + attr_reader :amount + # 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). + attr_reader :currency + # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + attr_reader :currency_options + end + # Whether the shipping rate can be used for new purchases. Defaults to `true`. + attr_reader :active + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + attr_reader :delivery_estimate + + # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + attr_reader :display_name + + # Attribute for field fixed_amount + attr_reader :fixed_amount + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + attr_reader :tax_behavior + + # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + attr_reader :tax_code + + # The type of calculation to use on the shipping rate. + attr_reader :type + # Creates a new shipping rate object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/shipping_rates", params: params, opts: opts) diff --git a/lib/stripe/resources/sigma/scheduled_query_run.rb b/lib/stripe/resources/sigma/scheduled_query_run.rb index b5626aa8f..9443a693b 100644 --- a/lib/stripe/resources/sigma/scheduled_query_run.rb +++ b/lib/stripe/resources/sigma/scheduled_query_run.rb @@ -15,6 +15,43 @@ def self.object_name "scheduled_query_run" end + class Error < Stripe::StripeObject + # Information about the run failure. + attr_reader :message + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # When the query was run, Sigma contained a snapshot of your Stripe data at this time. + attr_reader :data_load_time + + # Attribute for field error + attr_reader :error + + # The file object representing the results of the query. + attr_reader :file + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Time at which the result expires and is no longer available for download. + attr_reader :result_available_until + + # SQL for the query. + attr_reader :sql + + # The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. + attr_reader :status + + # Title of the query. + attr_reader :title + # Returns a list of scheduled query runs. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/source.rb b/lib/stripe/resources/source.rb index 0ba0009e8..5ef265e9a 100644 --- a/lib/stripe/resources/source.rb +++ b/lib/stripe/resources/source.rb @@ -24,6 +24,683 @@ def self.object_name nested_resource_class_methods :source_transaction, operations: %i[retrieve list] + class AchCreditTransfer < Stripe::StripeObject + # Attribute for field account_number + attr_reader :account_number + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field refund_account_holder_name + attr_reader :refund_account_holder_name + # Attribute for field refund_account_holder_type + attr_reader :refund_account_holder_type + # Attribute for field refund_routing_number + attr_reader :refund_routing_number + # Attribute for field routing_number + attr_reader :routing_number + # Attribute for field swift_code + attr_reader :swift_code + end + + class AchDebit < Stripe::StripeObject + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field country + attr_reader :country + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field last4 + attr_reader :last4 + # Attribute for field routing_number + attr_reader :routing_number + # Attribute for field type + attr_reader :type + end + + class AcssDebit < Stripe::StripeObject + # Attribute for field bank_address_city + attr_reader :bank_address_city + # Attribute for field bank_address_line_1 + attr_reader :bank_address_line_1 + # Attribute for field bank_address_line_2 + attr_reader :bank_address_line_2 + # Attribute for field bank_address_postal_code + attr_reader :bank_address_postal_code + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field category + attr_reader :category + # Attribute for field country + attr_reader :country + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field last4 + attr_reader :last4 + # Attribute for field routing_number + attr_reader :routing_number + end + + class Alipay < Stripe::StripeObject + # Attribute for field data_string + attr_reader :data_string + # Attribute for field native_url + attr_reader :native_url + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + + class AuBecsDebit < Stripe::StripeObject + # Attribute for field bsb_number + attr_reader :bsb_number + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field last4 + attr_reader :last4 + end + + class Bancontact < Stripe::StripeObject + # Attribute for field bank_code + attr_reader :bank_code + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field bic + attr_reader :bic + # Attribute for field iban_last4 + attr_reader :iban_last4 + # Attribute for field preferred_language + attr_reader :preferred_language + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + + class Card < Stripe::StripeObject + # Attribute for field address_line1_check + attr_reader :address_line1_check + # Attribute for field address_zip_check + attr_reader :address_zip_check + # Attribute for field brand + attr_reader :brand + # Attribute for field country + attr_reader :country + # Attribute for field cvc_check + attr_reader :cvc_check + # Attribute for field description + attr_reader :description + # Attribute for field dynamic_last4 + attr_reader :dynamic_last4 + # Attribute for field exp_month + attr_reader :exp_month + # Attribute for field exp_year + attr_reader :exp_year + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field funding + attr_reader :funding + # Attribute for field iin + attr_reader :iin + # Attribute for field issuer + attr_reader :issuer + # Attribute for field last4 + attr_reader :last4 + # Attribute for field name + attr_reader :name + # Attribute for field three_d_secure + attr_reader :three_d_secure + # Attribute for field tokenization_method + attr_reader :tokenization_method + end + + class CardPresent < Stripe::StripeObject + # Attribute for field application_cryptogram + attr_reader :application_cryptogram + # Attribute for field application_preferred_name + attr_reader :application_preferred_name + # Attribute for field authorization_code + attr_reader :authorization_code + # Attribute for field authorization_response_code + attr_reader :authorization_response_code + # Attribute for field brand + attr_reader :brand + # Attribute for field country + attr_reader :country + # Attribute for field cvm_type + attr_reader :cvm_type + # Attribute for field data_type + attr_reader :data_type + # Attribute for field dedicated_file_name + attr_reader :dedicated_file_name + # Attribute for field description + attr_reader :description + # Attribute for field emv_auth_data + attr_reader :emv_auth_data + # Attribute for field evidence_customer_signature + attr_reader :evidence_customer_signature + # Attribute for field evidence_transaction_certificate + attr_reader :evidence_transaction_certificate + # Attribute for field exp_month + attr_reader :exp_month + # Attribute for field exp_year + attr_reader :exp_year + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field funding + attr_reader :funding + # Attribute for field iin + attr_reader :iin + # Attribute for field issuer + attr_reader :issuer + # Attribute for field last4 + attr_reader :last4 + # Attribute for field pos_device_id + attr_reader :pos_device_id + # Attribute for field pos_entry_mode + attr_reader :pos_entry_mode + # Attribute for field read_method + attr_reader :read_method + # Attribute for field reader + attr_reader :reader + # Attribute for field terminal_verification_results + attr_reader :terminal_verification_results + # Attribute for field transaction_status_information + attr_reader :transaction_status_information + end + + class CodeVerification < Stripe::StripeObject + # The number of attempts remaining to authenticate the source object with a verification code. + attr_reader :attempts_remaining + # The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). + attr_reader :status + end + + class Eps < Stripe::StripeObject + # Attribute for field reference + attr_reader :reference + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + + class Giropay < Stripe::StripeObject + # Attribute for field bank_code + attr_reader :bank_code + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field bic + attr_reader :bic + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + + class Ideal < Stripe::StripeObject + # Attribute for field bank + attr_reader :bank + # Attribute for field bic + attr_reader :bic + # Attribute for field iban_last4 + attr_reader :iban_last4 + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + + class Klarna < Stripe::StripeObject + # Attribute for field background_image_url + attr_reader :background_image_url + # Attribute for field client_token + attr_reader :client_token + # Attribute for field first_name + attr_reader :first_name + # Attribute for field last_name + attr_reader :last_name + # Attribute for field locale + attr_reader :locale + # Attribute for field logo_url + attr_reader :logo_url + # Attribute for field page_title + attr_reader :page_title + # Attribute for field pay_later_asset_urls_descriptive + attr_reader :pay_later_asset_urls_descriptive + # Attribute for field pay_later_asset_urls_standard + attr_reader :pay_later_asset_urls_standard + # Attribute for field pay_later_name + attr_reader :pay_later_name + # Attribute for field pay_later_redirect_url + attr_reader :pay_later_redirect_url + # Attribute for field pay_now_asset_urls_descriptive + attr_reader :pay_now_asset_urls_descriptive + # Attribute for field pay_now_asset_urls_standard + attr_reader :pay_now_asset_urls_standard + # Attribute for field pay_now_name + attr_reader :pay_now_name + # Attribute for field pay_now_redirect_url + attr_reader :pay_now_redirect_url + # Attribute for field pay_over_time_asset_urls_descriptive + attr_reader :pay_over_time_asset_urls_descriptive + # Attribute for field pay_over_time_asset_urls_standard + attr_reader :pay_over_time_asset_urls_standard + # Attribute for field pay_over_time_name + attr_reader :pay_over_time_name + # Attribute for field pay_over_time_redirect_url + attr_reader :pay_over_time_redirect_url + # Attribute for field payment_method_categories + attr_reader :payment_method_categories + # Attribute for field purchase_country + attr_reader :purchase_country + # Attribute for field purchase_type + attr_reader :purchase_type + # Attribute for field redirect_url + attr_reader :redirect_url + # Attribute for field shipping_delay + attr_reader :shipping_delay + # Attribute for field shipping_first_name + attr_reader :shipping_first_name + # Attribute for field shipping_last_name + attr_reader :shipping_last_name + end + + class Multibanco < Stripe::StripeObject + # Attribute for field entity + attr_reader :entity + # Attribute for field reference + attr_reader :reference + # Attribute for field refund_account_holder_address_city + attr_reader :refund_account_holder_address_city + # Attribute for field refund_account_holder_address_country + attr_reader :refund_account_holder_address_country + # Attribute for field refund_account_holder_address_line1 + attr_reader :refund_account_holder_address_line1 + # Attribute for field refund_account_holder_address_line2 + attr_reader :refund_account_holder_address_line2 + # Attribute for field refund_account_holder_address_postal_code + attr_reader :refund_account_holder_address_postal_code + # Attribute for field refund_account_holder_address_state + attr_reader :refund_account_holder_address_state + # Attribute for field refund_account_holder_name + attr_reader :refund_account_holder_name + # Attribute for field refund_iban + attr_reader :refund_iban + end + + class Owner < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + + class VerifiedAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Owner's address. + attr_reader :address + # Owner's email address. + attr_reader :email + # Owner's full name. + attr_reader :name + # Owner's phone number (including extension). + attr_reader :phone + # Verified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_address + # Verified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_email + # Verified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_name + # Verified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + attr_reader :verified_phone + end + + class P24 < Stripe::StripeObject + # Attribute for field reference + attr_reader :reference + end + + class Paypal < Stripe::StripeObject + # Attribute for field billing_agreement + attr_reader :billing_agreement + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field payer_id + attr_reader :payer_id + # Attribute for field reference_id + attr_reader :reference_id + # Attribute for field reference_transaction_amount + attr_reader :reference_transaction_amount + # Attribute for field reference_transaction_charged + attr_reader :reference_transaction_charged + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + # Attribute for field transaction_id + attr_reader :transaction_id + # Attribute for field verified_email + attr_reader :verified_email + end + + class Receiver < Stripe::StripeObject + # The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. + attr_reader :address + # The total amount that was moved to your balance. This is almost always equal to the amount charged. In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. The amount charged is expressed in the source's currency. + attr_reader :amount_charged + # The total amount received by the receiver source. `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. The amount received is expressed in the source's currency. + attr_reader :amount_received + # The total amount that was returned to the customer. The amount returned is expressed in the source's currency. + attr_reader :amount_returned + # Type of refund attribute method, one of `email`, `manual`, or `none`. + attr_reader :refund_attributes_method + # Type of refund attribute status, one of `missing`, `requested`, or `available`. + attr_reader :refund_attributes_status + end + + class Redirect < Stripe::StripeObject + # The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. + attr_reader :failure_reason + # The URL you provide to redirect the customer to after they authenticated their payment. + attr_reader :return_url + # The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). + attr_reader :status + # The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. + attr_reader :url + end + + class SepaCreditTransfer < Stripe::StripeObject + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field bic + attr_reader :bic + # Attribute for field iban + attr_reader :iban + # Attribute for field refund_account_holder_address_city + attr_reader :refund_account_holder_address_city + # Attribute for field refund_account_holder_address_country + attr_reader :refund_account_holder_address_country + # Attribute for field refund_account_holder_address_line1 + attr_reader :refund_account_holder_address_line1 + # Attribute for field refund_account_holder_address_line2 + attr_reader :refund_account_holder_address_line2 + # Attribute for field refund_account_holder_address_postal_code + attr_reader :refund_account_holder_address_postal_code + # Attribute for field refund_account_holder_address_state + attr_reader :refund_account_holder_address_state + # Attribute for field refund_account_holder_name + attr_reader :refund_account_holder_name + # Attribute for field refund_iban + attr_reader :refund_iban + end + + class SepaDebit < Stripe::StripeObject + # Attribute for field bank_code + attr_reader :bank_code + # Attribute for field branch_code + attr_reader :branch_code + # Attribute for field country + attr_reader :country + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field last4 + attr_reader :last4 + # Attribute for field mandate_reference + attr_reader :mandate_reference + # Attribute for field mandate_url + attr_reader :mandate_url + end + + class Sofort < Stripe::StripeObject + # Attribute for field bank_code + attr_reader :bank_code + # Attribute for field bank_name + attr_reader :bank_name + # Attribute for field bic + attr_reader :bic + # Attribute for field country + attr_reader :country + # Attribute for field iban_last4 + attr_reader :iban_last4 + # Attribute for field preferred_language + attr_reader :preferred_language + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + + class SourceOrder < Stripe::StripeObject + class Item < Stripe::StripeObject + # The amount (price) for this order item. + attr_reader :amount + # This currency of this order item. Required when `amount` is present. + attr_reader :currency + # Human-readable description for this order item. + attr_reader :description + # The ID of the associated object for this line item. Expandable if not null (e.g., expandable to a SKU). + attr_reader :parent + # The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + attr_reader :quantity + # The type of this order item. Must be `sku`, `tax`, or `shipping`. + attr_reader :type + end + + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + attr_reader :carrier + # Recipient name. + attr_reader :name + # Recipient phone (including extension). + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + attr_reader :tracking_number + end + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + attr_reader :amount + # 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). + attr_reader :currency + # The email address of the customer placing the order. + attr_reader :email + # List of items constituting the order. + attr_reader :items + # Attribute for field shipping + attr_reader :shipping + end + + class ThreeDSecure < Stripe::StripeObject + # Attribute for field address_line1_check + attr_reader :address_line1_check + # Attribute for field address_zip_check + attr_reader :address_zip_check + # Attribute for field authenticated + attr_reader :authenticated + # Attribute for field brand + attr_reader :brand + # Attribute for field card + attr_reader :card + # Attribute for field country + attr_reader :country + # Attribute for field customer + attr_reader :customer + # Attribute for field cvc_check + attr_reader :cvc_check + # Attribute for field description + attr_reader :description + # Attribute for field dynamic_last4 + attr_reader :dynamic_last4 + # Attribute for field exp_month + attr_reader :exp_month + # Attribute for field exp_year + attr_reader :exp_year + # Attribute for field fingerprint + attr_reader :fingerprint + # Attribute for field funding + attr_reader :funding + # Attribute for field iin + attr_reader :iin + # Attribute for field issuer + attr_reader :issuer + # Attribute for field last4 + attr_reader :last4 + # Attribute for field name + attr_reader :name + # Attribute for field three_d_secure + attr_reader :three_d_secure + # Attribute for field tokenization_method + attr_reader :tokenization_method + end + + class Wechat < Stripe::StripeObject + # Attribute for field prepay_id + attr_reader :prepay_id + # Attribute for field qr_code_url + attr_reader :qr_code_url + # Attribute for field statement_descriptor + attr_reader :statement_descriptor + end + # Attribute for field ach_credit_transfer + attr_reader :ach_credit_transfer + + # Attribute for field ach_debit + attr_reader :ach_debit + + # Attribute for field acss_debit + attr_reader :acss_debit + + # Attribute for field alipay + attr_reader :alipay + + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. + attr_reader :amount + + # Attribute for field au_becs_debit + attr_reader :au_becs_debit + + # Attribute for field bancontact + attr_reader :bancontact + + # Attribute for field card + attr_reader :card + + # Attribute for field card_present + attr_reader :card_present + + # The client secret of the source. Used for client-side retrieval using a publishable key. + attr_reader :client_secret + + # Attribute for field code_verification + attr_reader :code_verification + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources. + attr_reader :currency + + # The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + attr_reader :customer + + # Attribute for field eps + attr_reader :eps + + # The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + attr_reader :flow + + # Attribute for field giropay + attr_reader :giropay + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field ideal + attr_reader :ideal + + # Attribute for field klarna + attr_reader :klarna + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Attribute for field multibanco + attr_reader :multibanco + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Information about the owner of the payment instrument that may be used or required by particular source types. + attr_reader :owner + + # Attribute for field p24 + attr_reader :p24 + + # Attribute for field paypal + attr_reader :paypal + + # Attribute for field receiver + attr_reader :receiver + + # Attribute for field redirect + attr_reader :redirect + + # Attribute for field sepa_credit_transfer + attr_reader :sepa_credit_transfer + + # Attribute for field sepa_debit + attr_reader :sepa_debit + + # Attribute for field sofort + attr_reader :sofort + + # Attribute for field source_order + attr_reader :source_order + + # Extra information about a source. This will appear on your customer's statement every time you charge the source. + attr_reader :statement_descriptor + + # The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. + attr_reader :status + + # Attribute for field three_d_secure + attr_reader :three_d_secure + + # The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + attr_reader :type + + # Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + attr_reader :usage + + # Attribute for field wechat + attr_reader :wechat + # Creates a new source object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/sources", params: params, opts: opts) diff --git a/lib/stripe/resources/source_mandate_notification.rb b/lib/stripe/resources/source_mandate_notification.rb new file mode 100644 index 000000000..e9342a5ac --- /dev/null +++ b/lib/stripe/resources/source_mandate_notification.rb @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + # Source mandate notifications should be created when a notification related to + # a source mandate must be sent to the payer. They will trigger a webhook or + # deliver an email to the customer. + class SourceMandateNotification < APIResource + OBJECT_NAME = "source_mandate_notification" + def self.object_name + "source_mandate_notification" + end + + class AcssDebit < Stripe::StripeObject + # The statement descriptor associate with the debit. + attr_reader :statement_descriptor + end + + class BacsDebit < Stripe::StripeObject + # Last 4 digits of the account number associated with the debit. + attr_reader :last4 + end + + class SepaDebit < Stripe::StripeObject + # SEPA creditor ID. + attr_reader :creditor_identifier + # Last 4 digits of the account number associated with the debit. + attr_reader :last4 + # Mandate reference associated with the debit. + attr_reader :mandate_reference + end + # Attribute for field acss_debit + attr_reader :acss_debit + + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. The amount is expressed in the currency of the underlying source. Required if the notification type is `debit_initiated`. + attr_reader :amount + + # Attribute for field bacs_debit + attr_reader :bacs_debit + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The reason of the mandate notification. Valid reasons are `mandate_confirmed` or `debit_initiated`. + attr_reader :reason + + # Attribute for field sepa_debit + attr_reader :sepa_debit + + # `Source` objects allow you to accept a variety of payment methods. They + # represent a customer's payment instrument, and can be used with the Stripe API + # just like a `Card` object: once chargeable, they can be charged, or can be + # attached to customers. + # + # Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). + # We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). + # This newer API provides access to our latest features and payment method types. + # + # Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). + attr_reader :source + + # The status of the mandate notification. Valid statuses are `pending` or `submitted`. + attr_reader :status + + # The type of source this mandate notification is attached to. Should be the source type identifier code for the payment method, such as `three_d_secure`. + attr_reader :type + end +end diff --git a/lib/stripe/resources/source_transaction.rb b/lib/stripe/resources/source_transaction.rb index 53864e779..85f4b5e08 100644 --- a/lib/stripe/resources/source_transaction.rb +++ b/lib/stripe/resources/source_transaction.rb @@ -11,5 +11,103 @@ class SourceTransaction < StripeObject def self.object_name "source_transaction" end + + class AchCreditTransfer < Stripe::StripeObject + # Customer data associated with the transfer. + attr_reader :customer_data + # Bank account fingerprint associated with the transfer. + attr_reader :fingerprint + # Last 4 digits of the account number associated with the transfer. + attr_reader :last4 + # Routing number associated with the transfer. + attr_reader :routing_number + end + + class ChfCreditTransfer < Stripe::StripeObject + # Reference associated with the transfer. + attr_reader :reference + # Sender's country address. + attr_reader :sender_address_country + # Sender's line 1 address. + attr_reader :sender_address_line1 + # Sender's bank account IBAN. + attr_reader :sender_iban + # Sender's name. + attr_reader :sender_name + end + + class GbpCreditTransfer < Stripe::StripeObject + # Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. + attr_reader :fingerprint + # The credit transfer rails the sender used to push this transfer. The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. Currently only Faster Payments is supported. + attr_reader :funding_method + # Last 4 digits of sender account number associated with the transfer. + attr_reader :last4 + # Sender entered arbitrary information about the transfer. + attr_reader :reference + # Sender account number associated with the transfer. + attr_reader :sender_account_number + # Sender name associated with the transfer. + attr_reader :sender_name + # Sender sort code associated with the transfer. + attr_reader :sender_sort_code + end + + class PaperCheck < Stripe::StripeObject + # Time at which the deposited funds will be available for use. Measured in seconds since the Unix epoch. + attr_reader :available_at + # Comma-separated list of invoice IDs associated with the paper check. + attr_reader :invoices + end + + class SepaCreditTransfer < Stripe::StripeObject + # Reference associated with the transfer. + attr_reader :reference + # Sender's bank account IBAN. + attr_reader :sender_iban + # Sender's name. + attr_reader :sender_name + end + # Attribute for field ach_credit_transfer + attr_reader :ach_credit_transfer + + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. + attr_reader :amount + + # Attribute for field chf_credit_transfer + attr_reader :chf_credit_transfer + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # Attribute for field gbp_credit_transfer + attr_reader :gbp_credit_transfer + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field paper_check + attr_reader :paper_check + + # Attribute for field sepa_credit_transfer + attr_reader :sepa_credit_transfer + + # The ID of the source this transaction is attached to. + attr_reader :source + + # The status of the transaction, one of `succeeded`, `pending`, or `failed`. + attr_reader :status + + # The type of source this transaction is attached to. + attr_reader :type end end diff --git a/lib/stripe/resources/subscription.rb b/lib/stripe/resources/subscription.rb index d00880253..c2e07c430 100644 --- a/lib/stripe/resources/subscription.rb +++ b/lib/stripe/resources/subscription.rb @@ -16,6 +16,386 @@ def self.object_name "subscription" end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on this subscription. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + end + + class BillingCycleAnchorConfig < Stripe::StripeObject + # The day of the month of the billing_cycle_anchor. + attr_reader :day_of_month + # The hour of the day of the billing_cycle_anchor. + attr_reader :hour + # The minute of the hour of the billing_cycle_anchor. + attr_reader :minute + # The month to start full cycle billing periods. + attr_reader :month + # The second of the minute of the billing_cycle_anchor. + attr_reader :second + end + + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + attr_reader :reset_billing_cycle_anchor + end + + class CancellationDetails < Stripe::StripeObject + # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + attr_reader :comment + # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + attr_reader :feedback + # Why this subscription was canceled. + attr_reader :reason + end + + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + attr_reader :account_tax_ids + # Attribute for field issuer + attr_reader :issuer + end + + class LastPriceMigrationError < Stripe::StripeObject + class FailedTransition < Stripe::StripeObject + # The original price to be migrated. + attr_reader :source_price + # The intended resulting price of the migration. + attr_reader :target_price + end + # The time at which the price migration encountered an error. + attr_reader :errored_at + # The involved price pairs in each failed transition. + attr_reader :failed_transitions + # The type of error encountered by the price migration. + attr_reader :type + end + + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + attr_reader :behavior + # The time after which the subscription will resume collecting payments. + attr_reader :resumes_at + end + + class PaymentSettings < Stripe::StripeObject + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Transaction type of the mandate. + attr_reader :transaction_type + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Bank account verification method. + attr_reader :verification_method + end + + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + attr_reader :preferred_language + end + + class Card < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount to be charged for future payments. + attr_reader :amount + # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + attr_reader :amount_type + # A description of the mandate or subscription that is meant to be displayed to the customer. + attr_reader :description + end + # Attribute for field mandate_options + attr_reader :mandate_options + # Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. + attr_reader :network + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + attr_reader :request_three_d_secure + end + + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + attr_reader :country + end + # Attribute for field eu_bank_transfer + attr_reader :eu_bank_transfer + # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + attr_reader :type + end + # Attribute for field bank_transfer + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + attr_reader :funding_type + end + + class IdBankTransfer < Stripe::StripeObject; end + class Konbini < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + attr_reader :institution + end + # Attribute for field filters + attr_reader :filters + # The list of permissions to request. The `payment_method` permission must be included. + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + attr_reader :prefetch + end + # Attribute for field financial_connections + attr_reader :financial_connections + # Bank account verification method. + attr_reader :verification_method + end + # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. + attr_reader :acss_debit + # This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. + attr_reader :bancontact + # This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. + attr_reader :card + # This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. + attr_reader :customer_balance + # This sub-hash contains details about the Indonesia bank transfer payment method options to pass to invoices created by the subscription. + attr_reader :id_bank_transfer + # This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. + attr_reader :konbini + # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to invoices created by the subscription. + attr_reader :sepa_debit + # This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. + attr_reader :us_bank_account + end + # Payment-method-specific configuration to provide to invoices created by the subscription. + attr_reader :payment_method_options + # The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + attr_reader :payment_method_types + # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`. + attr_reader :save_default_payment_method + end + + class PendingInvoiceItemInterval < Stripe::StripeObject + # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + attr_reader :interval + # The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + attr_reader :interval_count + end + + class PendingUpdate < Stripe::StripeObject + # If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. + attr_reader :billing_cycle_anchor + # The point after which the changes reflected by this update will be discarded and no longer applied. + attr_reader :expires_at + # The number of iterations of prebilling to apply. + attr_reader :prebilling_iterations + # List of subscription items, each with an attached plan, that will be set if the update is applied. + attr_reader :subscription_items + # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. + attr_reader :trial_end + # Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + attr_reader :trial_from_plan + end + + class Prebilling < Stripe::StripeObject + # ID of the prebilling invoice. + attr_reader :invoice + # The end of the last period for which the invoice pre-bills. + attr_reader :period_end + # The start of the first period for which the invoice pre-bills. + attr_reader :period_start + # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + attr_reader :update_behavior + end + + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + attr_reader :missing_payment_method + end + # Defines how a subscription behaves when a free trial ends. + attr_reader :end_behavior + end + # ID of the Connect Application that created the subscription. + attr_reader :application + + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + attr_reader :application_fee_percent + + # Attribute for field automatic_tax + attr_reader :automatic_tax + + # The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format. + attr_reader :billing_cycle_anchor + + # The fixed values used to calculate the `billing_cycle_anchor`. + attr_reader :billing_cycle_anchor_config + + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + attr_reader :billing_thresholds + + # A date in the future at which the subscription will automatically get canceled + attr_reader :cancel_at + + # Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. + attr_reader :cancel_at_period_end + + # If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + attr_reader :canceled_at + + # Details about why this subscription was cancelled + attr_reader :cancellation_details + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + attr_reader :collection_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. + attr_reader :current_period_end + + # Start of the current period that the subscription has been invoiced for. + attr_reader :current_period_start + + # ID of the customer who owns the subscription. + attr_reader :customer + + # Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`. + attr_reader :days_until_due + + # ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + attr_reader :default_payment_method + + # ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + attr_reader :default_source + + # The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. + attr_reader :default_tax_rates + + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + + # Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + attr_reader :discount + + # The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # If the subscription has ended, the date the subscription ended. + attr_reader :ended_at + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field invoice_settings + attr_reader :invoice_settings + + # List of subscription items, each with an attached price. + attr_reader :items + + # Details of the most recent price migration that failed for the subscription. + attr_reader :last_price_migration_error + + # The most recent invoice this subscription has generated. + attr_reader :latest_invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. + attr_reader :next_pending_invoice_item_invoice + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. + attr_reader :on_behalf_of + + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + attr_reader :pause_collection + + # Payment settings passed on to invoices created by the subscription. + attr_reader :payment_settings + + # Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + attr_reader :pending_invoice_item_interval + + # You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). + attr_reader :pending_setup_intent + + # If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. + attr_reader :pending_update + + # Time period and invoice for a Subscription billed in advance. + attr_reader :prebilling + + # The schedule attached to the subscription + attr_reader :schedule + + # Date when the subscription was first created. The date might differ from the `created` date due to backdating. + attr_reader :start_date + + # Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. + # + # For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. + # + # A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. + # + # A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/docs/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. + # + # If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). + # + # If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. + attr_reader :status + + # ID of the test clock this subscription belongs to. + attr_reader :test_clock + + # The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + attr_reader :transfer_data + + # If the subscription has a trial, the end of that trial. + attr_reader :trial_end + + # Settings related to subscription trials. + attr_reader :trial_settings + + # If the subscription has a trial, the beginning of that trial. + attr_reader :trial_start + # Cancels a customer's subscription immediately. The customer won't be charged again for the subscription. After it's canceled, you can no longer update the subscription or its [metadata](https://stripe.com/metadata). # # Any pending invoice items that you've created are still charged at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations are also left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations are removed. diff --git a/lib/stripe/resources/subscription_item.rb b/lib/stripe/resources/subscription_item.rb index d37a70b2a..8b8b4bdaa 100644 --- a/lib/stripe/resources/subscription_item.rb +++ b/lib/stripe/resources/subscription_item.rb @@ -21,6 +21,68 @@ def self.object_name operations: %i[list], resource_plural: "usage_record_summaries" + class BillingThresholds < Stripe::StripeObject + # Usage threshold that triggers the subscription to create an invoice + attr_reader :usage_gte + end + + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + attr_reader :converts_to + # Determines the type of trial for this item. + attr_reader :type + end + # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + attr_reader :billing_thresholds + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + + # Unique identifier for the object. + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + # + # Plans define the base price, currency, and billing cycle for recurring purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). + attr_reader :plan + + # Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). + attr_reader :price + + # The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. + attr_reader :quantity + + # The `subscription` this `subscription_item` belongs to. + attr_reader :subscription + + # The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + attr_reader :tax_rates + + # Options that configure the trial on the subscription item. + attr_reader :trial + + # Always true for a deleted object + attr_reader :deleted + # Adds a new item to an existing subscription. No existing items will be changed or replaced. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/subscription_schedule.rb b/lib/stripe/resources/subscription_schedule.rb index 01db55ef9..05a9827b1 100644 --- a/lib/stripe/resources/subscription_schedule.rb +++ b/lib/stripe/resources/subscription_schedule.rb @@ -15,6 +15,362 @@ def self.object_name "subscription_schedule" end + class CurrentPhase < Stripe::StripeObject + # The end of this phase of the subscription schedule. + attr_reader :end_date + # The start of this phase of the subscription schedule. + attr_reader :start_date + end + + class DefaultSettings < Stripe::StripeObject + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + end + + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + attr_reader :reset_billing_cycle_anchor + end + + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + attr_reader :days_until_due + # Attribute for field issuer + attr_reader :issuer + end + + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + attr_reader :application_fee_percent + # Attribute for field automatic_tax + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + attr_reader :collection_method + # ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + attr_reader :default_payment_method + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # Attribute for field invoice_settings + attr_reader :invoice_settings + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + attr_reader :on_behalf_of + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + attr_reader :transfer_data + end + + class LastPriceMigrationError < Stripe::StripeObject + class FailedTransition < Stripe::StripeObject + # The original price to be migrated. + attr_reader :source_price + # The intended resulting price of the migration. + attr_reader :target_price + end + # The time at which the price migration encountered an error. + attr_reader :errored_at + # The involved price pairs in each failed transition. + attr_reader :failed_transitions + # The type of error encountered by the price migration. + attr_reader :type + end + + class Phase < Stripe::StripeObject + class AddInvoiceItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + # The stackable discounts that will be applied to the item. + attr_reader :discounts + # ID of the price used to generate the invoice item. + attr_reader :price + # The quantity of the invoice item. + attr_reader :quantity + # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + attr_reader :tax_rates + end + + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + attr_reader :liability + end + + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + attr_reader :reset_billing_cycle_anchor + end + + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + attr_reader :account + # Type of the account referenced. + attr_reader :type + end + # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + attr_reader :days_until_due + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + attr_reader :issuer + end + + class Item < Stripe::StripeObject + class BillingThresholds < Stripe::StripeObject + # Usage threshold that triggers the subscription to create an invoice + attr_reader :usage_gte + end + + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + attr_reader :timestamp + # The discount end type. + attr_reader :type + end + # ID of the coupon to create a new discount for. + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + attr_reader :discount + # Details to determine how long the discount should be applied for. + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + attr_reader :promotion_code + end + + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + attr_reader :converts_to + # Determines the type of trial for this item. + attr_reader :type + end + # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + attr_reader :billing_thresholds + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + attr_reader :metadata + # ID of the plan to which the customer should be subscribed. + attr_reader :plan + # ID of the price to which the customer should be subscribed. + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + attr_reader :trial + end + + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + attr_reader :behavior + end + + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + attr_reader :destination + end + + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + attr_reader :prorate_up_front + end + # Defines how the subscription should behave when a trial ends. + attr_reader :end_behavior + end + # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + attr_reader :add_invoice_items + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + attr_reader :application_fee_percent + # Attribute for field automatic_tax + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + attr_reader :collection_method + # ID of the coupon to use during this phase of the subscription schedule. + attr_reader :coupon + # 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). + attr_reader :currency + # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + attr_reader :default_payment_method + # The default tax rates to apply to the subscription during this phase of the subscription schedule. + attr_reader :default_tax_rates + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + attr_reader :description + # The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + attr_reader :discounts + # The end of this phase of the subscription schedule. + attr_reader :end_date + # The invoice settings applicable during this phase. + attr_reader :invoice_settings + # Subscription items to configure the subscription to during this phase of the subscription schedule. + attr_reader :items + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + attr_reader :metadata + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + attr_reader :on_behalf_of + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + attr_reader :pause_collection + # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. + attr_reader :proration_behavior + # The start of this phase of the subscription schedule. + attr_reader :start_date + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + attr_reader :transfer_data + # Specify behavior of the trial when crossing schedule phase boundaries + attr_reader :trial_continuation + # When the trial ends within the phase. + attr_reader :trial_end + # Settings related to any trials on the subscription during this phase. + attr_reader :trial_settings + end + + class Prebilling < Stripe::StripeObject + # ID of the prebilling invoice. + attr_reader :invoice + # The end of the last period for which the invoice pre-bills. + attr_reader :period_end + # The start of the first period for which the invoice pre-bills. + attr_reader :period_start + # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + attr_reader :update_behavior + end + # ID of the Connect Application that created the schedule. + attr_reader :application + + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + attr_reader :billing_behavior + + # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + attr_reader :canceled_at + + # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + attr_reader :completed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + attr_reader :current_phase + + # ID of the customer who owns the subscription schedule. + attr_reader :customer + + # Attribute for field default_settings + attr_reader :default_settings + + # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + attr_reader :end_behavior + + # Unique identifier for the object. + attr_reader :id + + # Details of the most recent price migration that failed for the subscription schedule. + attr_reader :last_price_migration_error + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Configuration for the subscription schedule's phases. + attr_reader :phases + + # Time period and invoice for a Subscription billed in advance. + attr_reader :prebilling + + # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + attr_reader :released_at + + # ID of the subscription once managed by the subscription schedule (if it is released). + attr_reader :released_subscription + + # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + attr_reader :status + + # ID of the subscription managed by the subscription schedule. + attr_reader :subscription + + # ID of the test clock this subscription schedule belongs to. + attr_reader :test_clock + # Amends an existing subscription schedule. def amend(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/tax/association.rb b/lib/stripe/resources/tax/association.rb index 1edd114d0..1379412dd 100644 --- a/lib/stripe/resources/tax/association.rb +++ b/lib/stripe/resources/tax/association.rb @@ -10,6 +10,64 @@ def self.object_name "tax.association" end + class StatusDetails < Stripe::StripeObject + class Committed < Stripe::StripeObject + class Reversal < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + class Committed < Stripe::StripeObject + # The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + attr_reader :transaction + end + + class Errored < Stripe::StripeObject + # Details on why we could not commit the reversal Tax Transaction + attr_reader :reason + # The [Refund](https://stripe.com/docs/api/refunds/object) ID that should have created a tax reversal. + attr_reader :refund_id + end + # Attribute for field committed + attr_reader :committed + # Attribute for field errored + attr_reader :errored + end + # Status of the attempted Tax Transaction reversal. + attr_reader :status + # Attribute for field status_details + attr_reader :status_details + end + # Attempts to create Tax Transaction reversals + attr_reader :reversals + # The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + attr_reader :transaction + end + + class Errored < Stripe::StripeObject + # Details on why we could not commit the Tax Transaction + attr_reader :reason + end + # Attribute for field committed + attr_reader :committed + # Attribute for field errored + attr_reader :errored + end + # The [Tax Calculation](https://stripe.com/docs/api/tax/calculations/object) that was included in PaymentIntent. + attr_reader :calculation + + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) that this Tax Association is tracking. + attr_reader :payment_intent + + # Status of the Tax Association. + attr_reader :status + + # Attribute for field status_details + attr_reader :status_details + # Finds a tax association object by PaymentIntent id. def self.find(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/tax/calculation.rb b/lib/stripe/resources/tax/calculation.rb index 99cd00e65..241bba6c8 100644 --- a/lib/stripe/resources/tax/calculation.rb +++ b/lib/stripe/resources/tax/calculation.rb @@ -14,6 +14,184 @@ def self.object_name "tax.calculation" end + class CustomerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + attr_reader :state + end + + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + # The customer's postal address (for example, home or business location). + attr_reader :address + # The type of customer address provided. + attr_reader :address_source + # The customer's IP address (IPv4 or IPv6). + attr_reader :ip_address + # The customer's tax IDs (for example, EU VAT numbers). + attr_reader :tax_ids + # The taxability override used for taxation. + attr_reader :taxability_override + end + + class ShipFromDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + attr_reader :state + end + # Attribute for field address + attr_reader :address + end + + class ShippingCost < Stripe::StripeObject + class TaxBreakdown < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # A human-readable name for the jurisdiction imposing the tax. + attr_reader :display_name + # Indicates the level of the jurisdiction imposing the tax. + attr_reader :level + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + attr_reader :state + end + + class TaxRateDetails < Stripe::StripeObject + # A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + attr_reader :display_name + # The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + attr_reader :percentage_decimal + # The tax type, such as `vat` or `sales_tax`. + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Attribute for field jurisdiction + attr_reader :jurisdiction + # Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + attr_reader :sourcing + # Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :taxable_amount + end + # The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + attr_reader :amount + # The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_tax + # The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + attr_reader :shipping_rate + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + attr_reader :tax_behavior + # Detailed account of taxes relevant to shipping cost. + attr_reader :tax_breakdown + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + attr_reader :tax_code + end + + class TaxBreakdown < Stripe::StripeObject + class TaxRateDetails < Stripe::StripeObject + class FlatAmount < Stripe::StripeObject + # Amount of the tax when the `rate_type` is `flat_amount`. This positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + attr_reader :amount + # Three-letter ISO currency code, in lowercase. + attr_reader :currency + end + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate. + attr_reader :flat_amount + # The tax rate percentage as a string. For example, 8.5% is represented as `"8.5"`. + attr_reader :percentage_decimal + # Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + attr_reader :rate_type + # State, county, province, or region. + attr_reader :state + # The tax type, such as `vat` or `sales_tax`. + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Specifies whether the tax amount is included in the line item amount. + attr_reader :inclusive + # Attribute for field tax_rate_details + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. We might extend the possible values for this field to support new tax rules. + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :taxable_amount + end + # Total amount after taxes in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_total + + # 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). + attr_reader :currency + + # The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + attr_reader :customer + + # Attribute for field customer_details + attr_reader :customer_details + + # Timestamp of date at which the tax calculation will expire. + attr_reader :expires_at + + # Unique identifier for the calculation. + attr_reader :id + + # The list of items the customer is purchasing. + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The details of the ship from location, such as the address. + attr_reader :ship_from_details + + # The shipping cost details for the calculation. + attr_reader :shipping_cost + + # The amount of tax to be collected on top of the line item prices. + attr_reader :tax_amount_exclusive + + # The amount of tax already included in the line item prices. + attr_reader :tax_amount_inclusive + + # Breakdown of individual tax amounts that add up to the total. + attr_reader :tax_breakdown + + # Timestamp of date at which the tax rules and rates in effect applies for the calculation. + attr_reader :tax_date + # Calculates tax based on the input and returns a Tax Calculation object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/tax/calculation_line_item.rb b/lib/stripe/resources/tax/calculation_line_item.rb index 1dbcdc73d..48f167961 100644 --- a/lib/stripe/resources/tax/calculation_line_item.rb +++ b/lib/stripe/resources/tax/calculation_line_item.rb @@ -8,6 +8,72 @@ class CalculationLineItem < APIResource def self.object_name "tax.calculation_line_item" end + + class TaxBreakdown < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # A human-readable name for the jurisdiction imposing the tax. + attr_reader :display_name + # Indicates the level of the jurisdiction imposing the tax. + attr_reader :level + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + attr_reader :state + end + + class TaxRateDetails < Stripe::StripeObject + # A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + attr_reader :display_name + # The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + attr_reader :percentage_decimal + # The tax type, such as `vat` or `sales_tax`. + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Attribute for field jurisdiction + attr_reader :jurisdiction + # Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + attr_reader :sourcing + # Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :taxable_amount + end + # The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + attr_reader :amount + + # The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_tax + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ID of an existing [Product](https://stripe.com/docs/api/products/object). + attr_reader :product + + # The number of units of the item being purchased. For reversals, this is the quantity reversed. + attr_reader :quantity + + # A custom identifier for this line item. + attr_reader :reference + + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + attr_reader :tax_behavior + + # Detailed account of taxes relevant to this line item. + attr_reader :tax_breakdown + + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + attr_reader :tax_code end end end diff --git a/lib/stripe/resources/tax/form.rb b/lib/stripe/resources/tax/form.rb index 58bd83f9f..009f10d53 100644 --- a/lib/stripe/resources/tax/form.rb +++ b/lib/stripe/resources/tax/form.rb @@ -14,6 +14,129 @@ def self.object_name "tax.form" end + class AuSerr < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_start_date + end + + class CaMrdp < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_start_date + end + + class EuDac7 < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_start_date + end + + class FilingStatus < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Always `US`. + attr_reader :country + # Indicates the level of the jurisdiction where the form was filed. + attr_reader :level + # [ISO 3166-2 U.S. state code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix, if any. For example, "NY" for New York, United States. + attr_reader :state + end + # Time when the filing status was updated. + attr_reader :effective_at + # Attribute for field jurisdiction + attr_reader :jurisdiction + # The current status of the filed form. + attr_reader :value + end + + class GbMrdp < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_start_date + end + + class NzMrdp < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + attr_reader :reporting_period_start_date + end + + class Payee < Stripe::StripeObject + # The ID of the payee's Stripe account. + attr_reader :account + # The external reference to this payee. + attr_reader :external_reference + # Either `account` or `external_reference`. + attr_reader :type + end + + class Us1099K < Stripe::StripeObject + # Year represented by the information reported on the tax form. + attr_reader :reporting_year + end + + class Us1099Misc < Stripe::StripeObject + # Year represented by the information reported on the tax form. + attr_reader :reporting_year + end + + class Us1099Nec < Stripe::StripeObject + # Year represented by the information reported on the tax form. + attr_reader :reporting_year + end + # Attribute for field au_serr + attr_reader :au_serr + + # Attribute for field ca_mrdp + attr_reader :ca_mrdp + + # The form that corrects this form, if any. + attr_reader :corrected_by + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Attribute for field eu_dac7 + attr_reader :eu_dac7 + + # A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction’s tax authority. + attr_reader :filing_statuses + + # Attribute for field gb_mrdp + attr_reader :gb_mrdp + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Attribute for field nz_mrdp + attr_reader :nz_mrdp + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field payee + attr_reader :payee + + # The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type. + attr_reader :type + + # Attribute for field us_1099_k + attr_reader :us_1099_k + + # Attribute for field us_1099_misc + attr_reader :us_1099_misc + + # Attribute for field us_1099_nec + attr_reader :us_1099_nec + # Returns a list of tax forms which were previously created. The tax forms are returned in sorted order, with the oldest tax forms appearing first. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/tax/forms", params: filters, opts: opts) diff --git a/lib/stripe/resources/tax/registration.rb b/lib/stripe/resources/tax/registration.rb index 6055c4f5d..66a4bb9f3 100644 --- a/lib/stripe/resources/tax/registration.rb +++ b/lib/stripe/resources/tax/registration.rb @@ -18,6 +18,685 @@ def self.object_name "tax.registration" end + class CountryOptions < Stripe::StripeObject + class Ae < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class At < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Au < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Be < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Bg < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Bh < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class By < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ca < Stripe::StripeObject + class ProvinceStandard < Stripe::StripeObject + # Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + attr_reader :province + end + # Attribute for field province_standard + attr_reader :province_standard + # Type of registration in Canada. + attr_reader :type + end + + class Ch < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Cl < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Co < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Cr < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Cy < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Cz < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class De < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Dk < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Ec < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ee < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Eg < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Es < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Fi < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Fr < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Gb < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ge < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Gr < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Hr < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Hu < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Id < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ie < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Is < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class It < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Jp < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ke < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Kr < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Kz < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Lt < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Lu < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Lv < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Ma < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Md < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Mt < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Mx < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class My < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ng < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Nl < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class No < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Nz < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Om < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Pl < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Pt < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Ro < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Rs < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Ru < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Sa < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Se < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Sg < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Si < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Sk < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + attr_reader :standard + # Type of registration in an EU country. + attr_reader :type + end + + class Th < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Tr < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Tz < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Us < Stripe::StripeObject + class LocalAmusementTax < Stripe::StripeObject + # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + attr_reader :jurisdiction + end + + class LocalLeaseTax < Stripe::StripeObject + # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + attr_reader :jurisdiction + end + + class StateSalesTax < Stripe::StripeObject + class Election < Stripe::StripeObject + # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + attr_reader :jurisdiction + # The type of the election for the state sales tax registration. + attr_reader :type + end + # Elections for the state sales tax registration. + attr_reader :elections + end + # Attribute for field local_amusement_tax + attr_reader :local_amusement_tax + # Attribute for field local_lease_tax + attr_reader :local_lease_tax + # Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + attr_reader :state + # Attribute for field state_sales_tax + attr_reader :state_sales_tax + # Type of registration in the US. + attr_reader :type + end + + class Uz < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Vn < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + + class Za < Stripe::StripeObject + # Type of registration in `country`. + attr_reader :type + end + # Attribute for field ae + attr_reader :ae + # Attribute for field at + attr_reader :at + # Attribute for field au + attr_reader :au + # Attribute for field be + attr_reader :be + # Attribute for field bg + attr_reader :bg + # Attribute for field bh + attr_reader :bh + # Attribute for field by + attr_reader :by + # Attribute for field ca + attr_reader :ca + # Attribute for field ch + attr_reader :ch + # Attribute for field cl + attr_reader :cl + # Attribute for field co + attr_reader :co + # Attribute for field cr + attr_reader :cr + # Attribute for field cy + attr_reader :cy + # Attribute for field cz + attr_reader :cz + # Attribute for field de + attr_reader :de + # Attribute for field dk + attr_reader :dk + # Attribute for field ec + attr_reader :ec + # Attribute for field ee + attr_reader :ee + # Attribute for field eg + attr_reader :eg + # Attribute for field es + attr_reader :es + # Attribute for field fi + attr_reader :fi + # Attribute for field fr + attr_reader :fr + # Attribute for field gb + attr_reader :gb + # Attribute for field ge + attr_reader :ge + # Attribute for field gr + attr_reader :gr + # Attribute for field hr + attr_reader :hr + # Attribute for field hu + attr_reader :hu + # Attribute for field id + attr_reader :id + # Attribute for field ie + attr_reader :ie + # Attribute for field is + attr_reader :is + # Attribute for field it + attr_reader :it + # Attribute for field jp + attr_reader :jp + # Attribute for field ke + attr_reader :ke + # Attribute for field kr + attr_reader :kr + # Attribute for field kz + attr_reader :kz + # Attribute for field lt + attr_reader :lt + # Attribute for field lu + attr_reader :lu + # Attribute for field lv + attr_reader :lv + # Attribute for field ma + attr_reader :ma + # Attribute for field md + attr_reader :md + # Attribute for field mt + attr_reader :mt + # Attribute for field mx + attr_reader :mx + # Attribute for field my + attr_reader :my + # Attribute for field ng + attr_reader :ng + # Attribute for field nl + attr_reader :nl + # Attribute for field no + attr_reader :no + # Attribute for field nz + attr_reader :nz + # Attribute for field om + attr_reader :om + # Attribute for field pl + attr_reader :pl + # Attribute for field pt + attr_reader :pt + # Attribute for field ro + attr_reader :ro + # Attribute for field rs + attr_reader :rs + # Attribute for field ru + attr_reader :ru + # Attribute for field sa + attr_reader :sa + # Attribute for field se + attr_reader :se + # Attribute for field sg + attr_reader :sg + # Attribute for field si + attr_reader :si + # Attribute for field sk + attr_reader :sk + # Attribute for field th + attr_reader :th + # Attribute for field tr + attr_reader :tr + # Attribute for field tz + attr_reader :tz + # Attribute for field us + attr_reader :us + # Attribute for field uz + attr_reader :uz + # Attribute for field vn + attr_reader :vn + # Attribute for field za + attr_reader :za + end + # Time at which the registration becomes active. Measured in seconds since the Unix epoch. + attr_reader :active_from + + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + + # Attribute for field country_options + attr_reader :country_options + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. Measured in seconds since the Unix epoch. + attr_reader :expires_at + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The status of the registration. This field is present for convenience and can be deduced from `active_from` and `expires_at`. + attr_reader :status + # Creates a new Tax Registration object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/tax/settings.rb b/lib/stripe/resources/tax/settings.rb index 1250ea35f..2a8048b7c 100644 --- a/lib/stripe/resources/tax/settings.rb +++ b/lib/stripe/resources/tax/settings.rb @@ -8,10 +8,67 @@ module Tax # Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api) class Settings < SingletonAPIResource include Stripe::APIOperations::SingletonSave + OBJECT_NAME = "tax.settings" def self.object_name "tax.settings" end + + class Defaults < Stripe::StripeObject + # Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior. + attr_reader :tax_behavior + # Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. + attr_reader :tax_code + end + + class HeadOffice < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + end + + class StatusDetails < Stripe::StripeObject + class Active < Stripe::StripeObject; end + + class Pending < Stripe::StripeObject + # The list of missing fields that are required to perform calculations. It includes the entry `head_office` when the status is `pending`. It is recommended to set the optional values even if they aren't listed as required for calculating taxes. Calculations can fail if missing fields aren't explicitly provided on every call. + attr_reader :missing_fields + end + # Attribute for field active + attr_reader :active + # Attribute for field pending + attr_reader :pending + end + # Attribute for field defaults + attr_reader :defaults + + # The place where your business is located. + attr_reader :head_office + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The status of the Tax `Settings`. + attr_reader :status + + # Attribute for field status_details + attr_reader :status_details end end end diff --git a/lib/stripe/resources/tax/transaction.rb b/lib/stripe/resources/tax/transaction.rb index bdbfa41d9..67b1c0c52 100644 --- a/lib/stripe/resources/tax/transaction.rb +++ b/lib/stripe/resources/tax/transaction.rb @@ -12,6 +12,159 @@ def self.object_name "tax.transaction" end + class CustomerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + attr_reader :state + end + + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + attr_reader :type + # The value of the tax ID. + attr_reader :value + end + # The customer's postal address (for example, home or business location). + attr_reader :address + # The type of customer address provided. + attr_reader :address_source + # The customer's IP address (IPv4 or IPv6). + attr_reader :ip_address + # The customer's tax IDs (for example, EU VAT numbers). + attr_reader :tax_ids + # The taxability override used for taxation. + attr_reader :taxability_override + end + + class Reversal < Stripe::StripeObject + # The `id` of the reversed `Transaction` object. + attr_reader :original_transaction + end + + class ShipFromDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + attr_reader :state + end + # Attribute for field address + attr_reader :address + end + + class ShippingCost < Stripe::StripeObject + class TaxBreakdown < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # A human-readable name for the jurisdiction imposing the tax. + attr_reader :display_name + # Indicates the level of the jurisdiction imposing the tax. + attr_reader :level + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + attr_reader :state + end + + class TaxRateDetails < Stripe::StripeObject + # A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + attr_reader :display_name + # The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + attr_reader :percentage_decimal + # The tax type, such as `vat` or `sales_tax`. + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Attribute for field jurisdiction + attr_reader :jurisdiction + # Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + attr_reader :sourcing + # Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :taxable_amount + end + # The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + attr_reader :amount + # The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_tax + # The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + attr_reader :shipping_rate + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + attr_reader :tax_behavior + # Detailed account of taxes relevant to shipping cost. (It is not populated for the transaction resource object and will be removed in the next API version.) + attr_reader :tax_breakdown + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + attr_reader :tax_code + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + attr_reader :customer + + # Attribute for field customer_details + attr_reader :customer_details + + # Unique identifier for the transaction. + attr_reader :id + + # The tax collected or refunded, by line item. + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The Unix timestamp representing when the tax liability is assumed or reduced. + attr_reader :posted_at + + # A custom unique identifier, such as 'myOrder_123'. + attr_reader :reference + + # If `type=reversal`, contains information about what was reversed. + attr_reader :reversal + + # The details of the ship from location, such as the address. + attr_reader :ship_from_details + + # The shipping cost details for the transaction. + attr_reader :shipping_cost + + # Timestamp of date at which the tax rules and rates in effect applies for the calculation. + attr_reader :tax_date + + # If `reversal`, this transaction reverses an earlier transaction. + attr_reader :type + # Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. def self.create_from_calculation(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/tax/transaction_line_item.rb b/lib/stripe/resources/tax/transaction_line_item.rb index b0d8face8..08db51f98 100644 --- a/lib/stripe/resources/tax/transaction_line_item.rb +++ b/lib/stripe/resources/tax/transaction_line_item.rb @@ -8,6 +8,49 @@ class TransactionLineItem < APIResource def self.object_name "tax.transaction_line_item" end + + class Reversal < Stripe::StripeObject + # The `id` of the line item to reverse in the original transaction. + attr_reader :original_line_item + end + # The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + attr_reader :amount + + # The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount_tax + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ID of an existing [Product](https://stripe.com/docs/api/products/object). + attr_reader :product + + # The number of units of the item being purchased. For reversals, this is the quantity reversed. + attr_reader :quantity + + # A custom identifier for this line item in the transaction. + attr_reader :reference + + # If `type=reversal`, contains information about what was reversed. + attr_reader :reversal + + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + attr_reader :tax_behavior + + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + attr_reader :tax_code + + # If `reversal`, this line item reverses an earlier transaction. + attr_reader :type end end end diff --git a/lib/stripe/resources/tax_code.rb b/lib/stripe/resources/tax_code.rb index ad9b321d6..952eae56d 100644 --- a/lib/stripe/resources/tax_code.rb +++ b/lib/stripe/resources/tax_code.rb @@ -11,6 +11,18 @@ def self.object_name "tax_code" end + # A detailed description of which types of products the tax code represents. + attr_reader :description + + # Unique identifier for the object. + attr_reader :id + + # A short name for the tax code. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + # A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. def self.list(filters = {}, opts = {}) request_stripe_object(method: :get, path: "/v1/tax_codes", params: filters, opts: opts) diff --git a/lib/stripe/resources/tax_deducted_at_source.rb b/lib/stripe/resources/tax_deducted_at_source.rb new file mode 100644 index 000000000..901aa4c72 --- /dev/null +++ b/lib/stripe/resources/tax_deducted_at_source.rb @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +module Stripe + class TaxDeductedAtSource < APIResource + OBJECT_NAME = "tax_deducted_at_source" + def self.object_name + "tax_deducted_at_source" + end + + # Unique identifier for the object. + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The end of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. + attr_reader :period_end + + # The start of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. + attr_reader :period_start + + # The TAN that was supplied to Stripe when TDS was assessed + attr_reader :tax_deduction_account_number + end +end diff --git a/lib/stripe/resources/tax_id.rb b/lib/stripe/resources/tax_id.rb index 6ce2a98ff..169fe1df8 100644 --- a/lib/stripe/resources/tax_id.rb +++ b/lib/stripe/resources/tax_id.rb @@ -16,6 +16,58 @@ def self.object_name "tax_id" end + class Owner < Stripe::StripeObject + # The account being referenced when `type` is `account`. + attr_reader :account + # The Connect Application being referenced when `type` is `application`. + attr_reader :application + # The customer being referenced when `type` is `customer`. + attr_reader :customer + # Type of owner referenced. + attr_reader :type + end + + class Verification < Stripe::StripeObject + # Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. + attr_reader :status + # Verified address. + attr_reader :verified_address + # Verified name. + attr_reader :verified_name + end + # Two-letter ISO code representing the country of the tax ID. + attr_reader :country + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # ID of the customer. + attr_reader :customer + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The account or customer the tax ID belongs to. + attr_reader :owner + + # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + attr_reader :type + + # Value of the tax ID. + attr_reader :value + + # Tax ID verification information. + attr_reader :verification + + # Always true for a deleted object + attr_reader :deleted + # Creates a new account or customer tax_id object. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/tax_ids", params: params, opts: opts) diff --git a/lib/stripe/resources/tax_rate.rb b/lib/stripe/resources/tax_rate.rb index 54e534d56..f566e95b7 100644 --- a/lib/stripe/resources/tax_rate.rb +++ b/lib/stripe/resources/tax_rate.rb @@ -15,6 +15,68 @@ def self.object_name "tax_rate" end + class FlatAmount < Stripe::StripeObject + # Amount of the tax when the `rate_type` is `flat_amount`. This positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + attr_reader :amount + # Three-letter ISO currency code, in lowercase. + attr_reader :currency + end + # Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + attr_reader :active + + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + attr_reader :description + + # The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + attr_reader :display_name + + # Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, + # this percentage reflects the rate actually used to calculate tax based on the product's taxability + # and whether the user is registered to collect taxes in the corresponding jurisdiction. + attr_reader :effective_percentage + + # The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate. + attr_reader :flat_amount + + # Unique identifier for the object. + attr_reader :id + + # This specifies if the tax rate is inclusive or exclusive. + attr_reader :inclusive + + # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. + attr_reader :jurisdiction + + # The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates. + attr_reader :jurisdiction_level + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. + attr_reader :percentage + + # Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + attr_reader :rate_type + + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + attr_reader :state + + # The high-level tax type, such as `vat` or `sales_tax`. + attr_reader :tax_type + # Creates a new tax rate. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/tax_rates", params: params, opts: opts) diff --git a/lib/stripe/resources/terminal/configuration.rb b/lib/stripe/resources/terminal/configuration.rb index 9ba829037..f7b7d2ae1 100644 --- a/lib/stripe/resources/terminal/configuration.rb +++ b/lib/stripe/resources/terminal/configuration.rb @@ -15,6 +15,235 @@ def self.object_name "terminal.configuration" end + class BbposWiseposE < Stripe::StripeObject + # A File ID representing an image you would like displayed on the reader. + attr_reader :splashscreen + end + + class Offline < Stripe::StripeObject + # Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + attr_reader :enabled + end + + class RebootWindow < Stripe::StripeObject + # Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + attr_reader :end_hour + # Integer between 0 to 23 that represents the start hour of the reboot time window. + attr_reader :start_hour + end + + class StripeS700 < Stripe::StripeObject + # A File ID representing an image you would like displayed on the reader. + attr_reader :splashscreen + end + + class Tipping < Stripe::StripeObject + class Aud < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Cad < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Chf < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Czk < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Dkk < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Eur < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Gbp < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Hkd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Myr < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Nok < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Nzd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Pln < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Sek < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Sgd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + + class Usd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + attr_reader :smart_tip_threshold + end + # Attribute for field aud + attr_reader :aud + # Attribute for field cad + attr_reader :cad + # Attribute for field chf + attr_reader :chf + # Attribute for field czk + attr_reader :czk + # Attribute for field dkk + attr_reader :dkk + # Attribute for field eur + attr_reader :eur + # Attribute for field gbp + attr_reader :gbp + # Attribute for field hkd + attr_reader :hkd + # Attribute for field myr + attr_reader :myr + # Attribute for field nok + attr_reader :nok + # Attribute for field nzd + attr_reader :nzd + # Attribute for field pln + attr_reader :pln + # Attribute for field sek + attr_reader :sek + # Attribute for field sgd + attr_reader :sgd + # Attribute for field usd + attr_reader :usd + end + + class VerifoneP400 < Stripe::StripeObject + # A File ID representing an image you would like displayed on the reader. + attr_reader :splashscreen + end + # Attribute for field bbpos_wisepos_e + attr_reader :bbpos_wisepos_e + + # Unique identifier for the object. + attr_reader :id + + # Whether this Configuration is the default for your account + attr_reader :is_account_default + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String indicating the name of the Configuration object, set by the user + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field offline + attr_reader :offline + + # Attribute for field reboot_window + attr_reader :reboot_window + + # Attribute for field stripe_s700 + attr_reader :stripe_s700 + + # Attribute for field tipping + attr_reader :tipping + + # Attribute for field verifone_p400 + attr_reader :verifone_p400 + + # Always true for a deleted object + attr_reader :deleted + # Creates a new Configuration object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/terminal/connection_token.rb b/lib/stripe/resources/terminal/connection_token.rb index 3decf1fc2..27f6bc24b 100644 --- a/lib/stripe/resources/terminal/connection_token.rb +++ b/lib/stripe/resources/terminal/connection_token.rb @@ -14,6 +14,15 @@ def self.object_name "terminal.connection_token" end + # The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). + attr_reader :location + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Your application should pass this token to the Stripe Terminal SDK. + attr_reader :secret + # To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/terminal/location.rb b/lib/stripe/resources/terminal/location.rb index 9f4fbccc5..b5bbfd9e5 100644 --- a/lib/stripe/resources/terminal/location.rb +++ b/lib/stripe/resources/terminal/location.rb @@ -17,6 +17,44 @@ def self.object_name "terminal.location" end + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + + # The ID of a configuration that will be used to customize all readers in this location. + attr_reader :configuration_overrides + + # The display name of the location. + attr_reader :display_name + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Always true for a deleted object + attr_reader :deleted + # Creates a new Location object. # For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. def self.create(params = {}, opts = {}) diff --git a/lib/stripe/resources/terminal/reader.rb b/lib/stripe/resources/terminal/reader.rb index d33952010..493b031d6 100644 --- a/lib/stripe/resources/terminal/reader.rb +++ b/lib/stripe/resources/terminal/reader.rb @@ -17,6 +17,278 @@ def self.object_name "terminal.reader" end + class Action < Stripe::StripeObject + class CollectInputs < Stripe::StripeObject + class Input < Stripe::StripeObject + class CustomText < Stripe::StripeObject + # Customize the default description for this input + attr_reader :description + # Customize the default label for this input's skip button + attr_reader :skip_button + # Customize the default label for this input's submit button + attr_reader :submit_button + # Customize the default title for this input + attr_reader :title + end + + class Email < Stripe::StripeObject + # The collected email address + attr_reader :value + end + + class Numeric < Stripe::StripeObject + # The collected number + attr_reader :value + end + + class Phone < Stripe::StripeObject + # The collected phone number + attr_reader :value + end + + class Selection < Stripe::StripeObject + class Choice < Stripe::StripeObject + # The button style for the choice + attr_reader :style + # A value to be selected + attr_reader :value + end + # List of possible choices to be selected + attr_reader :choices + # The value of the selected choice + attr_reader :value + end + + class Signature < Stripe::StripeObject + # The File ID of a collected signature image + attr_reader :value + end + + class Text < Stripe::StripeObject + # The collected text value + attr_reader :value + end + + class Toggle < Stripe::StripeObject + # The toggle's default value + attr_reader :default_value + # The toggle's description text + attr_reader :description + # The toggle's title text + attr_reader :title + # The toggle's collected value + attr_reader :value + end + # Default text of input being collected. + attr_reader :custom_text + # Information about a email being collected using a reader + attr_reader :email + # Information about a number being collected using a reader + attr_reader :numeric + # Information about a phone number being collected using a reader + attr_reader :phone + # Indicate that this input is required, disabling the skip button. + attr_reader :required + # Information about a selection being collected using a reader + attr_reader :selection + # Information about a signature being collected using a reader + attr_reader :signature + # Indicate that this input was skipped by the user. + attr_reader :skipped + # Information about text being collected using a reader + attr_reader :text + # List of toggles being collected. Values are present if collection is complete. + attr_reader :toggles + # Type of input being collected. + attr_reader :type + end + # List of inputs to be collected. + attr_reader :inputs + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + end + + class CollectPaymentMethod < Stripe::StripeObject + class CollectConfig < Stripe::StripeObject + class Tipping < Stripe::StripeObject + # Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + attr_reader :amount_eligible + end + # Enable customer initiated cancellation when processing this payment. + attr_reader :enable_customer_cancellation + # Override showing a tipping selection screen on this transaction. + attr_reader :skip_tipping + # Represents a per-transaction tipping configuration + attr_reader :tipping + end + # Represents a per-transaction override of a reader configuration + attr_reader :collect_config + # Most recent PaymentIntent processed by the reader. + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + attr_reader :payment_method + # Attribute for field stripe_account + attr_reader :stripe_account + end + + class ConfirmPaymentIntent < Stripe::StripeObject + # Most recent PaymentIntent processed by the reader. + attr_reader :payment_intent + # Attribute for field stripe_account + attr_reader :stripe_account + end + + class ProcessPaymentIntent < Stripe::StripeObject + class ProcessConfig < Stripe::StripeObject + class Tipping < Stripe::StripeObject + # Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + attr_reader :amount_eligible + end + # Enable customer initiated cancellation when processing this payment. + attr_reader :enable_customer_cancellation + # Override showing a tipping selection screen on this transaction. + attr_reader :skip_tipping + # Represents a per-transaction tipping configuration + attr_reader :tipping + end + # Most recent PaymentIntent processed by the reader. + attr_reader :payment_intent + # Represents a per-transaction override of a reader configuration + attr_reader :process_config + # Attribute for field stripe_account + attr_reader :stripe_account + end + + class ProcessSetupIntent < Stripe::StripeObject + class ProcessConfig < Stripe::StripeObject + # Enable customer initiated cancellation when processing this SetupIntent. + attr_reader :enable_customer_cancellation + end + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + attr_reader :generated_card + # Represents a per-setup override of a reader configuration + attr_reader :process_config + # Most recent SetupIntent processed by the reader. + attr_reader :setup_intent + end + + class RefundPayment < Stripe::StripeObject + class RefundPaymentConfig < Stripe::StripeObject + # Enable customer initiated cancellation when refunding this payment. + attr_reader :enable_customer_cancellation + end + # The amount being refunded. + attr_reader :amount + # Charge that is being refunded. + attr_reader :charge + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + # Payment intent that is being refunded. + attr_reader :payment_intent + # The reason for the refund. + attr_reader :reason + # Unique identifier for the refund object. + attr_reader :refund + # Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. + attr_reader :refund_application_fee + # Represents a per-transaction override of a reader configuration + attr_reader :refund_payment_config + # Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. + attr_reader :reverse_transfer + # Attribute for field stripe_account + attr_reader :stripe_account + end + + class SetReaderDisplay < Stripe::StripeObject + class Cart < Stripe::StripeObject + class LineItem < Stripe::StripeObject + # The amount of the line item. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :amount + # Description of the line item. + attr_reader :description + # The quantity of the line item. + attr_reader :quantity + end + # 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). + attr_reader :currency + # List of line items in the cart. + attr_reader :line_items + # Tax amount for the entire cart. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :tax + # Total amount for the entire cart, including tax. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + attr_reader :total + end + # Cart object to be displayed by the reader. + attr_reader :cart + # Type of information to be displayed by the reader. + attr_reader :type + end + # Represents a reader action to collect customer inputs + attr_reader :collect_inputs + # Represents a reader action to collect a payment method + attr_reader :collect_payment_method + # Represents a reader action to confirm a payment + attr_reader :confirm_payment_intent + # Failure code, only set if status is `failed`. + attr_reader :failure_code + # Detailed failure message, only set if status is `failed`. + attr_reader :failure_message + # Represents a reader action to process a payment intent + attr_reader :process_payment_intent + # Represents a reader action to process a setup intent + attr_reader :process_setup_intent + # Represents a reader action to refund a payment + attr_reader :refund_payment + # Represents a reader action to set the reader display + attr_reader :set_reader_display + # Status of the action performed by the reader. + attr_reader :status + # Type of action performed by the reader. + attr_reader :type + end + # The most recent action performed by the reader. + attr_reader :action + + # The current software version of the reader. + attr_reader :device_sw_version + + # Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `stripe_s700`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. + attr_reader :device_type + + # Unique identifier for the object. + attr_reader :id + + # The local IP address of the reader. + attr_reader :ip_address + + # Custom label given to the reader for easier identification. + attr_reader :label + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The location identifier of the reader. + attr_reader :location + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Serial number of the reader. + attr_reader :serial_number + + # The networking status of the reader. We do not recommend using this field in flows that may block taking payments. + attr_reader :status + + # Always true for a deleted object + attr_reader :deleted + # Cancels the current reader action. def cancel_action(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/terminal/reader_collected_data.rb b/lib/stripe/resources/terminal/reader_collected_data.rb index 8a9ebe146..e890cd496 100644 --- a/lib/stripe/resources/terminal/reader_collected_data.rb +++ b/lib/stripe/resources/terminal/reader_collected_data.rb @@ -9,6 +9,28 @@ class ReaderCollectedData < APIResource def self.object_name "terminal.reader_collected_data" end + + class Magstripe < Stripe::StripeObject + # The raw magstripe data collected by the reader. + attr_reader :data + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The magstripe data collected by the reader. + attr_reader :magstripe + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The type of data collected by the reader. + attr_reader :type end end end diff --git a/lib/stripe/resources/test_helpers/test_clock.rb b/lib/stripe/resources/test_helpers/test_clock.rb index 31b49a059..9cfd48451 100644 --- a/lib/stripe/resources/test_helpers/test_clock.rb +++ b/lib/stripe/resources/test_helpers/test_clock.rb @@ -16,6 +16,44 @@ def self.object_name "test_helpers.test_clock" end + class StatusDetails < Stripe::StripeObject + class Advancing < Stripe::StripeObject + # The `frozen_time` that the Test Clock is advancing towards. + attr_reader :target_frozen_time + end + # Attribute for field advancing + attr_reader :advancing + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Time at which this clock is scheduled to auto delete. + attr_reader :deletes_after + + # Time at which all objects belonging to this clock are frozen. + attr_reader :frozen_time + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The custom name supplied at creation. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The status of the Test Clock. + attr_reader :status + + # Attribute for field status_details + attr_reader :status_details + + # Always true for a deleted object + attr_reader :deleted + # Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. def advance(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/token.rb b/lib/stripe/resources/token.rb index ffef36deb..967c7c186 100644 --- a/lib/stripe/resources/token.rb +++ b/lib/stripe/resources/token.rb @@ -30,6 +30,43 @@ def self.object_name "token" end + # These bank accounts are payment methods on `Customer` objects. + # + # On the other hand [External Accounts](/api#external_accounts) are transfer + # destinations on `Account` objects for connected accounts. + # They can be bank accounts or debit cards as well, and are documented in the links above. + # + # Related guide: [Bank debits and transfers](/payments/bank-debits-transfers) + attr_reader :bank_account + + # You can store multiple cards on a customer in order to charge the customer + # later. You can also store multiple debit cards on a recipient in order to + # transfer to those cards later. + # + # Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) + attr_reader :card + + # IP address of the client that generates the token. + attr_reader :client_ip + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Type of the token: `account`, `bank_account`, `card`, or `pii`. + attr_reader :type + + # Determines if you have already used this token (you can only use tokens once). + attr_reader :used + # Creates a single-use token that represents a bank account's details. # You can use this token with any v1 API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. def self.create(params = {}, opts = {}) diff --git a/lib/stripe/resources/topup.rb b/lib/stripe/resources/topup.rb index 53ef333d2..82857279f 100644 --- a/lib/stripe/resources/topup.rb +++ b/lib/stripe/resources/topup.rb @@ -17,6 +17,54 @@ def self.object_name "topup" end + # Amount transferred. + attr_reader :amount + + # ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. + attr_reader :expected_availability_date + + # Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). + attr_reader :failure_code + + # Message to user further explaining reason for top-up failure if available. + attr_reader :failure_message + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The source field is deprecated. It might not always be present in the API response. + attr_reader :source + + # Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. + attr_reader :statement_descriptor + + # The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. + attr_reader :status + + # A string that identifies this top-up as part of a group. + attr_reader :transfer_group + # Cancels a top-up. Only pending top-ups can be canceled. def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/transfer.rb b/lib/stripe/resources/transfer.rb index 476be51fd..6b37c649a 100644 --- a/lib/stripe/resources/transfer.rb +++ b/lib/stripe/resources/transfer.rb @@ -25,6 +25,57 @@ def self.object_name nested_resource_class_methods :reversal, operations: %i[create retrieve update list] + # Amount in cents (or local equivalent) to be transferred. + attr_reader :amount + + # Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + attr_reader :amount_reversed + + # Balance transaction that describes the impact of this transfer on your account balance. + attr_reader :balance_transaction + + # Time that this record of the transfer was first created. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # ID of the Stripe account the transfer was sent to. + attr_reader :destination + + # If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + attr_reader :destination_payment + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # A list of reversals that have been applied to the transfer. + attr_reader :reversals + + # Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. + attr_reader :reversed + + # ID of the charge that was used to fund the transfer. If null, the transfer was funded from the available balance. + attr_reader :source_transaction + + # The source balance this transfer came from. One of `card`, `fpx`, or `bank_account`. + attr_reader :source_type + + # A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + attr_reader :transfer_group + # To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. def self.create(params = {}, opts = {}) request_stripe_object(method: :post, path: "/v1/transfers", params: params, opts: opts) diff --git a/lib/stripe/resources/treasury/credit_reversal.rb b/lib/stripe/resources/treasury/credit_reversal.rb index ad3ea0bd6..33444780c 100644 --- a/lib/stripe/resources/treasury/credit_reversal.rb +++ b/lib/stripe/resources/treasury/credit_reversal.rb @@ -13,6 +13,52 @@ def self.object_name "treasury.credit_reversal" end + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when the CreditReversal changed status to `posted` + attr_reader :posted_at + end + # Amount (in cents) transferred. + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # The FinancialAccount to reverse funds from. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The rails used to reverse the funds. + attr_reader :network + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ReceivedCredit being reversed. + attr_reader :received_credit + + # Status of the CreditReversal + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # The Transaction associated with this object. + attr_reader :transaction + # Reverses a ReceivedCredit and creates a CreditReversal object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/debit_reversal.rb b/lib/stripe/resources/treasury/debit_reversal.rb index 0021ad438..f87c5bfe0 100644 --- a/lib/stripe/resources/treasury/debit_reversal.rb +++ b/lib/stripe/resources/treasury/debit_reversal.rb @@ -13,6 +13,60 @@ def self.object_name "treasury.debit_reversal" end + class LinkedFlows < Stripe::StripeObject + # Set if there is an Issuing dispute associated with the DebitReversal. + attr_reader :issuing_dispute + end + + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when the DebitReversal changed status to `completed`. + attr_reader :completed_at + end + # Amount (in cents) transferred. + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # The FinancialAccount to reverse funds from. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Other flows linked to a DebitReversal. + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # The rails used to reverse the funds. + attr_reader :network + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The ReceivedDebit being reversed. + attr_reader :received_debit + + # Status of the DebitReversal + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # The Transaction associated with this object. + attr_reader :transaction + # Reverses a ReceivedDebit and creates a DebitReversal object. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/financial_account.rb b/lib/stripe/resources/treasury/financial_account.rb index 22cdfa831..275f8c2ff 100644 --- a/lib/stripe/resources/treasury/financial_account.rb +++ b/lib/stripe/resources/treasury/financial_account.rb @@ -15,6 +15,103 @@ def self.object_name "treasury.financial_account" end + class Balance < Stripe::StripeObject + # Funds the user can spend right now. + attr_reader :cash + # Funds not spendable yet, but will become available at a later time. + attr_reader :inbound_pending + # Funds in the account, but not spendable because they are being held for pending outbound flows. + attr_reader :outbound_pending + end + + class FinancialAddress < Stripe::StripeObject + class Aba < Stripe::StripeObject + # The name of the person or business that owns the bank account. + attr_reader :account_holder_name + # The account number. + attr_reader :account_number + # The last four characters of the account number. + attr_reader :account_number_last4 + # Name of the bank. + attr_reader :bank_name + # Routing number for the account. + attr_reader :routing_number + end + # ABA Records contain U.S. bank account details per the ABA format. + attr_reader :aba + # The list of networks that the address supports + attr_reader :supported_networks + # The type of financial address + attr_reader :type + end + + class PlatformRestrictions < Stripe::StripeObject + # Restricts all inbound money movement. + attr_reader :inbound_flows + # Restricts all outbound money movement. + attr_reader :outbound_flows + end + + class StatusDetails < Stripe::StripeObject + class Closed < Stripe::StripeObject + # The array that contains reasons for a FinancialAccount closure. + attr_reader :reasons + end + # Details related to the closure of this FinancialAccount + attr_reader :closed + end + # The array of paths to active Features in the Features hash. + attr_reader :active_features + + # Balance information for the FinancialAccount + attr_reader :balance + + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + attr_reader :display_name + + # Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. + # Stripe or the platform can control Features via the requested field. + attr_reader :features + + # The set of credentials that resolve to a FinancialAccount. + attr_reader :financial_addresses + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The array of paths to pending Features in the Features hash. + attr_reader :pending_features + + # The set of functionalities that the platform can restrict on the FinancialAccount. + attr_reader :platform_restrictions + + # The array of paths to restricted Features in the Features hash. + attr_reader :restricted_features + + # Status of this FinancialAccount. + attr_reader :status + + # Attribute for field status_details + attr_reader :status_details + + # The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + attr_reader :supported_currencies + # Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/financial_account_features.rb b/lib/stripe/resources/treasury/financial_account_features.rb index e8849b8ef..02f159ff0 100644 --- a/lib/stripe/resources/treasury/financial_account_features.rb +++ b/lib/stripe/resources/treasury/financial_account_features.rb @@ -10,6 +10,204 @@ class FinancialAccountFeatures < APIResource def self.object_name "treasury.financial_account_features" end + + class CardIssuing < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + + class DepositInsurance < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + + class FinancialAddresses < Stripe::StripeObject + class Aba < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Requested bank partner for this Financial Account + attr_reader :bank + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + # Toggle settings for enabling/disabling the ABA address feature + attr_reader :aba + end + + class InboundTransfers < Stripe::StripeObject + class Ach < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + # Toggle settings for enabling/disabling an ACH specific feature + attr_reader :ach + end + + class IntraStripeFlows < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + + class OutboundPayments < Stripe::StripeObject + class Ach < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + + class UsDomesticWire < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + # Toggle settings for enabling/disabling an ACH specific feature + attr_reader :ach + # Toggle settings for enabling/disabling a feature + attr_reader :us_domestic_wire + end + + class OutboundTransfers < Stripe::StripeObject + class Ach < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + + class UsDomesticWire < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + attr_reader :requested + # Whether the Feature is operational. + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + attr_reader :status_details + end + # Toggle settings for enabling/disabling an ACH specific feature + attr_reader :ach + # Toggle settings for enabling/disabling a feature + attr_reader :us_domestic_wire + end + # Toggle settings for enabling/disabling a feature + attr_reader :card_issuing + + # Toggle settings for enabling/disabling a feature + attr_reader :deposit_insurance + + # Settings related to Financial Addresses features on a Financial Account + attr_reader :financial_addresses + + # InboundTransfers contains inbound transfers features for a FinancialAccount. + attr_reader :inbound_transfers + + # Toggle settings for enabling/disabling a feature + attr_reader :intra_stripe_flows + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Settings related to Outbound Payments features on a Financial Account + attr_reader :outbound_payments + + # OutboundTransfers contains outbound transfers features for a FinancialAccount. + attr_reader :outbound_transfers end end end diff --git a/lib/stripe/resources/treasury/inbound_transfer.rb b/lib/stripe/resources/treasury/inbound_transfer.rb index ed8c70ff6..3deb0bb8f 100644 --- a/lib/stripe/resources/treasury/inbound_transfer.rb +++ b/lib/stripe/resources/treasury/inbound_transfer.rb @@ -15,6 +15,134 @@ def self.object_name "treasury.inbound_transfer" end + class FailureDetails < Stripe::StripeObject + # Reason for the failure. + attr_reader :code + end + + class LinkedFlows < Stripe::StripeObject + # If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. + attr_reader :received_debit + end + + class OriginPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + end + + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + attr_reader :account_type + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. + attr_reader :network + # Routing number of the bank account. + attr_reader :routing_number + end + # Attribute for field billing_details + attr_reader :billing_details + # The type of the payment method used in the InboundTransfer. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when an InboundTransfer changed status to `canceled`. + attr_reader :canceled_at + # Timestamp describing when an InboundTransfer changed status to `failed`. + attr_reader :failed_at + # Timestamp describing when an InboundTransfer changed status to `succeeded`. + attr_reader :succeeded_at + end + # Amount (in cents) transferred. + attr_reader :amount + + # Returns `true` if the InboundTransfer is able to be canceled. + attr_reader :cancelable + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Details about this InboundTransfer's failure. Only set when status is `failed`. + attr_reader :failure_details + + # The FinancialAccount that received the funds. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field linked_flows + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The origin payment method to be debited for an InboundTransfer. + attr_reader :origin_payment_method + + # Details about the PaymentMethod for an InboundTransfer. + attr_reader :origin_payment_method_details + + # Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. + attr_reader :returned + + # Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`. + attr_reader :statement_descriptor + + # Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # The Transaction associated with this object. + attr_reader :transaction + # Cancels an InboundTransfer. def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/outbound_payment.rb b/lib/stripe/resources/treasury/outbound_payment.rb index dd61f55d5..8878731a5 100644 --- a/lib/stripe/resources/treasury/outbound_payment.rb +++ b/lib/stripe/resources/treasury/outbound_payment.rb @@ -17,6 +17,177 @@ def self.object_name "treasury.outbound_payment" end + class DestinationPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + end + + class FinancialAccount < Stripe::StripeObject + # Token of the FinancialAccount. + attr_reader :id + # The rails used to send funds. + attr_reader :network + end + + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + attr_reader :account_type + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. + attr_reader :network + # Routing number of the bank account. + attr_reader :routing_number + end + # Attribute for field billing_details + attr_reader :billing_details + # Attribute for field financial_account + attr_reader :financial_account + # The type of the payment method used in the OutboundPayment. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class EndUserDetails < Stripe::StripeObject + # IP address of the user initiating the OutboundPayment. Set if `present` is set to `true`. IP address collection is required for risk and compliance reasons. This will be used to help determine if the OutboundPayment is authorized or should be blocked. + attr_reader :ip_address + # `true` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. + attr_reader :present + end + + class ReturnedDetails < Stripe::StripeObject + # Reason for the return. + attr_reader :code + # The Transaction associated with this object. + attr_reader :transaction + end + + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when an OutboundPayment changed status to `canceled`. + attr_reader :canceled_at + # Timestamp describing when an OutboundPayment changed status to `failed`. + attr_reader :failed_at + # Timestamp describing when an OutboundPayment changed status to `posted`. + attr_reader :posted_at + # Timestamp describing when an OutboundPayment changed status to `returned`. + attr_reader :returned_at + end + + class TrackingDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH trace ID of the OutboundPayment for payments sent over the `ach` network. + attr_reader :trace_id + end + + class UsDomesticWire < Stripe::StripeObject + # CHIPS System Sequence Number (SSN) of the OutboundPayment for payments sent over the `us_domestic_wire` network. + attr_reader :chips + # IMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + attr_reader :imad + # OMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + attr_reader :omad + end + # Attribute for field ach + attr_reader :ach + # The US bank account network used to send funds. + attr_reader :type + # Attribute for field us_domestic_wire + attr_reader :us_domestic_wire + end + # Amount (in cents) transferred. + attr_reader :amount + + # Returns `true` if the object can be canceled, and `false` otherwise. + attr_reader :cancelable + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. + attr_reader :destination_payment_method + + # Details about the PaymentMethod for an OutboundPayment. + attr_reader :destination_payment_method_details + + # Details about the end user. + attr_reader :end_user_details + + # The date when funds are expected to arrive in the destination account. + attr_reader :expected_arrival_date + + # The FinancialAccount that funds were pulled from. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Details about a returned OutboundPayment. Only set when the status is `returned`. + attr_reader :returned_details + + # The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + attr_reader :statement_descriptor + + # Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. An OutboundPayment is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # Details about network-specific tracking information if available. + attr_reader :tracking_details + + # The Transaction associated with this object. + attr_reader :transaction + # Cancel an OutboundPayment. def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/outbound_transfer.rb b/lib/stripe/resources/treasury/outbound_transfer.rb index a5ed090df..490fd9ccf 100644 --- a/lib/stripe/resources/treasury/outbound_transfer.rb +++ b/lib/stripe/resources/treasury/outbound_transfer.rb @@ -17,6 +17,169 @@ def self.object_name "treasury.outbound_transfer" end + class DestinationPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + end + + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + attr_reader :account_type + # Name of the bank associated with the bank account. + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + attr_reader :fingerprint + # Last four digits of the bank account number. + attr_reader :last4 + # ID of the mandate used to make this payment. + attr_reader :mandate + # The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. + attr_reader :network + # Routing number of the bank account. + attr_reader :routing_number + end + # Attribute for field billing_details + attr_reader :billing_details + # The type of the payment method used in the OutboundTransfer. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class NetworkDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH Addenda record + attr_reader :addenda + end + # Details about an ACH transaction. + attr_reader :ach + # The type of flow that originated the OutboundTransfer. + attr_reader :type + end + + class ReturnedDetails < Stripe::StripeObject + # Reason for the return. + attr_reader :code + # The Transaction associated with this object. + attr_reader :transaction + end + + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when an OutboundTransfer changed status to `canceled` + attr_reader :canceled_at + # Timestamp describing when an OutboundTransfer changed status to `failed` + attr_reader :failed_at + # Timestamp describing when an OutboundTransfer changed status to `posted` + attr_reader :posted_at + # Timestamp describing when an OutboundTransfer changed status to `returned` + attr_reader :returned_at + end + + class TrackingDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH trace ID of the OutboundTransfer for transfers sent over the `ach` network. + attr_reader :trace_id + end + + class UsDomesticWire < Stripe::StripeObject + # CHIPS System Sequence Number (SSN) of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + attr_reader :chips + # IMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + attr_reader :imad + # OMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + attr_reader :omad + end + # Attribute for field ach + attr_reader :ach + # The US bank account network used to send funds. + attr_reader :type + # Attribute for field us_domestic_wire + attr_reader :us_domestic_wire + end + # Amount (in cents) transferred. + attr_reader :amount + + # Returns `true` if the object can be canceled, and `false` otherwise. + attr_reader :cancelable + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # The PaymentMethod used as the payment instrument for an OutboundTransfer. + attr_reader :destination_payment_method + + # Attribute for field destination_payment_method_details + attr_reader :destination_payment_method_details + + # The date when funds are expected to arrive in the destination account. + attr_reader :expected_arrival_date + + # The FinancialAccount that funds were pulled from. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # Details about the network used for the OutboundTransfer. + attr_reader :network_details + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Details about a returned OutboundTransfer. Only set when the status is `returned`. + attr_reader :returned_details + + # Information about the OutboundTransfer to be sent to the recipient account. + attr_reader :statement_descriptor + + # Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + + # Details about network-specific tracking information if available. + attr_reader :tracking_details + + # The Transaction associated with this object. + attr_reader :transaction + # An OutboundTransfer can be canceled if the funds have not yet been paid out. def cancel(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/received_credit.rb b/lib/stripe/resources/treasury/received_credit.rb index 9445abc96..635915590 100644 --- a/lib/stripe/resources/treasury/received_credit.rb +++ b/lib/stripe/resources/treasury/received_credit.rb @@ -12,6 +12,163 @@ def self.object_name "treasury.received_credit" end + class InitiatingPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + end + + class FinancialAccount < Stripe::StripeObject + # The FinancialAccount ID. + attr_reader :id + # The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + attr_reader :network + end + + class UsBankAccount < Stripe::StripeObject + # Bank name. + attr_reader :bank_name + # The last four digits of the bank account number. + attr_reader :last4 + # The routing number for the bank account. + attr_reader :routing_number + end + # Set when `type` is `balance`. + attr_reader :balance + # Attribute for field billing_details + attr_reader :billing_details + # Attribute for field financial_account + attr_reader :financial_account + # Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + attr_reader :issuing_card + # Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class LinkedFlows < Stripe::StripeObject + class SourceFlowDetails < Stripe::StripeObject + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + attr_reader :credit_reversal + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + attr_reader :outbound_payment + # A `Payout` object is created when you receive funds from Stripe, or when you + # initiate a payout to either a bank account or debit card of a [connected + # Stripe account](/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, + # and list all payouts. Payouts are made on [varying + # schedules](/docs/connect/manage-payout-schedule), depending on your country and + # industry. + # + # Related guide: [Receiving payouts](https://stripe.com/docs/payouts) + attr_reader :payout + # The type of the source flow that originated the ReceivedCredit. + attr_reader :type + end + # The CreditReversal created as a result of this ReceivedCredit being reversed. + attr_reader :credit_reversal + # Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + attr_reader :issuing_authorization + # Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. + attr_reader :issuing_transaction + # ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the user. Examples of source flows include OutboundPayments, payouts, or CreditReversals. + attr_reader :source_flow + # The expandable object of the source flow. + attr_reader :source_flow_details + # The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). + attr_reader :source_flow_type + end + + class NetworkDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH Addenda record + attr_reader :addenda + end + # Details about an ACH transaction. + attr_reader :ach + # The type of flow that originated the ReceivedCredit. + attr_reader :type + end + + class ReversalDetails < Stripe::StripeObject + # Time before which a ReceivedCredit can be reversed. + attr_reader :deadline + # Set if a ReceivedCredit cannot be reversed. + attr_reader :restricted_reason + end + # Amount (in cents) transferred. + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. + attr_reader :failure_code + + # The FinancialAccount that received the funds. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field initiating_payment_method_details + attr_reader :initiating_payment_method_details + + # Attribute for field linked_flows + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The rails used to send the funds. + attr_reader :network + + # Details specific to the money movement rails. + attr_reader :network_details + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Details describing when a ReceivedCredit may be reversed. + attr_reader :reversal_details + + # Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. + attr_reader :status + + # The Transaction associated with this object. + attr_reader :transaction + # Returns a list of ReceivedCredits. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/received_debit.rb b/lib/stripe/resources/treasury/received_debit.rb index 8b92213fa..f89784ebf 100644 --- a/lib/stripe/resources/treasury/received_debit.rb +++ b/lib/stripe/resources/treasury/received_debit.rb @@ -12,6 +12,142 @@ def self.object_name "treasury.received_debit" end + class InitiatingPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + attr_reader :line2 + # ZIP or postal code. + attr_reader :postal_code + # State, county, province, or region. + attr_reader :state + end + # Attribute for field address + attr_reader :address + # Email address. + attr_reader :email + # Full name. + attr_reader :name + end + + class FinancialAccount < Stripe::StripeObject + # The FinancialAccount ID. + attr_reader :id + # The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + attr_reader :network + end + + class UsBankAccount < Stripe::StripeObject + # Bank name. + attr_reader :bank_name + # The last four digits of the bank account number. + attr_reader :last4 + # The routing number for the bank account. + attr_reader :routing_number + end + # Set when `type` is `balance`. + attr_reader :balance + # Attribute for field billing_details + attr_reader :billing_details + # Attribute for field financial_account + attr_reader :financial_account + # Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + attr_reader :issuing_card + # Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. + attr_reader :type + # Attribute for field us_bank_account + attr_reader :us_bank_account + end + + class LinkedFlows < Stripe::StripeObject + # The DebitReversal created as a result of this ReceivedDebit being reversed. + attr_reader :debit_reversal + # Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. + attr_reader :inbound_transfer + # Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + attr_reader :issuing_authorization + # Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. + attr_reader :issuing_transaction + # Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. + attr_reader :payout + # The ReceivedCredit that Capital withheld from + attr_reader :received_credit_capital_withholding + end + + class NetworkDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH Addenda record + attr_reader :addenda + end + # Details about an ACH transaction. + attr_reader :ach + # The type of flow that originated the ReceivedDebit. + attr_reader :type + end + + class ReversalDetails < Stripe::StripeObject + # Time before which a ReceivedDebit can be reversed. + attr_reader :deadline + # Set if a ReceivedDebit can't be reversed. + attr_reader :restricted_reason + end + # Amount (in cents) transferred. + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. + attr_reader :failure_code + + # The FinancialAccount that funds were pulled from. + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + attr_reader :id + + # Attribute for field initiating_payment_method_details + attr_reader :initiating_payment_method_details + + # Attribute for field linked_flows + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # The network used for the ReceivedDebit. + attr_reader :network + + # Details specific to the money movement rails. + attr_reader :network_details + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Details describing when a ReceivedDebit might be reversed. + attr_reader :reversal_details + + # Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. + attr_reader :status + + # The Transaction associated with this object. + attr_reader :transaction + # Returns a list of ReceivedDebits. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/transaction.rb b/lib/stripe/resources/treasury/transaction.rb index c40c42fa6..3d2dbf77f 100644 --- a/lib/stripe/resources/treasury/transaction.rb +++ b/lib/stripe/resources/treasury/transaction.rb @@ -12,6 +12,101 @@ def self.object_name "treasury.transaction" end + class BalanceImpact < Stripe::StripeObject + # The change made to funds the user can spend right now. + attr_reader :cash + # The change made to funds that are not spendable yet, but will become available at a later time. + attr_reader :inbound_pending + # The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + attr_reader :outbound_pending + end + + class FlowDetails < Stripe::StripeObject + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + attr_reader :credit_reversal + # You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + attr_reader :debit_reversal + # Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + # + # Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) + attr_reader :inbound_transfer + # When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + # object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + # purchase to be completed successfully. + # + # Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) + attr_reader :issuing_authorization + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + attr_reader :outbound_payment + # Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + # + # Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + attr_reader :outbound_transfer + # ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + attr_reader :received_credit + # ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + attr_reader :received_debit + # Type of the flow that created the Transaction. Set to the same value as `flow_type`. + attr_reader :type + end + + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when the Transaction changed status to `posted`. + attr_reader :posted_at + # Timestamp describing when the Transaction changed status to `void`. + attr_reader :void_at + end + # Amount (in cents) transferred. + attr_reader :amount + + # Change to a FinancialAccount's balance + attr_reader :balance_impact + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + attr_reader :description + + # A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. + attr_reader :entries + + # The FinancialAccount associated with this object. + attr_reader :financial_account + + # ID of the flow that created the Transaction. + attr_reader :flow + + # Details of the flow that created the Transaction. + attr_reader :flow_details + + # Type of the flow that created the Transaction. + attr_reader :flow_type + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Status of the Transaction. + attr_reader :status + + # Attribute for field status_transitions + attr_reader :status_transitions + # Retrieves a list of Transaction objects. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/treasury/transaction_entry.rb b/lib/stripe/resources/treasury/transaction_entry.rb index 599624352..81f724ac9 100644 --- a/lib/stripe/resources/treasury/transaction_entry.rb +++ b/lib/stripe/resources/treasury/transaction_entry.rb @@ -12,6 +12,88 @@ def self.object_name "treasury.transaction_entry" end + class BalanceImpact < Stripe::StripeObject + # The change made to funds the user can spend right now. + attr_reader :cash + # The change made to funds that are not spendable yet, but will become available at a later time. + attr_reader :inbound_pending + # The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + attr_reader :outbound_pending + end + + class FlowDetails < Stripe::StripeObject + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + attr_reader :credit_reversal + # You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + attr_reader :debit_reversal + # Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + # + # Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) + attr_reader :inbound_transfer + # When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + # object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + # purchase to be completed successfully. + # + # Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) + attr_reader :issuing_authorization + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + attr_reader :outbound_payment + # Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + # + # Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + attr_reader :outbound_transfer + # ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + attr_reader :received_credit + # ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + attr_reader :received_debit + # Type of the flow that created the Transaction. Set to the same value as `flow_type`. + attr_reader :type + end + # Change to a FinancialAccount's balance + attr_reader :balance_impact + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :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). + attr_reader :currency + + # When the TransactionEntry will impact the FinancialAccount's balance. + attr_reader :effective_at + + # The FinancialAccount associated with this object. + attr_reader :financial_account + + # Token of the flow associated with the TransactionEntry. + attr_reader :flow + + # Details of the flow associated with the TransactionEntry. + attr_reader :flow_details + + # Type of the flow associated with the TransactionEntry. + attr_reader :flow_type + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The Transaction associated with this object. + attr_reader :transaction + + # The specific money movement that generated the TransactionEntry. + attr_reader :type + # Retrieves a list of TransactionEntry objects. def self.list(filters = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/resources/usage_record.rb b/lib/stripe/resources/usage_record.rb index 3444824f7..4ee5ee93c 100644 --- a/lib/stripe/resources/usage_record.rb +++ b/lib/stripe/resources/usage_record.rb @@ -13,5 +13,23 @@ class UsageRecord < APIResource def self.object_name "usage_record" end + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The usage quantity for the specified date. + attr_reader :quantity + + # The ID of the subscription item this usage record contains data for. + attr_reader :subscription_item + + # The timestamp when this usage occurred. + attr_reader :timestamp end end diff --git a/lib/stripe/resources/usage_record_summary.rb b/lib/stripe/resources/usage_record_summary.rb index 1186754d6..10c875ee3 100644 --- a/lib/stripe/resources/usage_record_summary.rb +++ b/lib/stripe/resources/usage_record_summary.rb @@ -8,5 +8,32 @@ class UsageRecordSummary < StripeObject def self.object_name "usage_record_summary" end + + class Period < Stripe::StripeObject + # The end date of this usage period. All usage up to and including this point in time is included. + attr_reader :end + # The start date of this usage period. All usage after this point in time is included. + attr_reader :start + end + # Unique identifier for the object. + attr_reader :id + + # The invoice in which this usage period has been billed for. + attr_reader :invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # Attribute for field period + attr_reader :period + + # The ID of the subscription item this summary is describing. + attr_reader :subscription_item + + # The total usage within this usage period. + attr_reader :total_usage end end diff --git a/lib/stripe/resources/v2/amount.rb b/lib/stripe/resources/v2/amount.rb new file mode 100644 index 000000000..357bf0593 --- /dev/null +++ b/lib/stripe/resources/v2/amount.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module Stripe + module V2 + class Amount + attr_reader :value, :currency + end + end +end diff --git a/lib/stripe/resources/v2/billing/meter_event.rb b/lib/stripe/resources/v2/billing/meter_event.rb index 95f1e494f..4828d3b59 100644 --- a/lib/stripe/resources/v2/billing/meter_event.rb +++ b/lib/stripe/resources/v2/billing/meter_event.rb @@ -10,6 +10,30 @@ class MeterEvent < APIResource def self.object_name "v2.billing.meter_event" end + + # The creation time of this meter event. + attr_reader :created + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + attr_reader :event_name + + # A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We’ll enforce uniqueness within a rolling 24 hour period. + attr_reader :identifier + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + attr_reader :object + + # The payload of the event. This must contain the fields corresponding to a meter’s + # `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and + # `value_settings.event_payload_key` (default is `value`). Read more about the payload. + attr_reader :payload + + # The time of the event. Must be within the past 35 calendar days or up to + # 5 minutes in the future. Defaults to current timestamp if not specified. + attr_reader :timestamp end end end diff --git a/lib/stripe/resources/v2/billing/meter_event_adjustment.rb b/lib/stripe/resources/v2/billing/meter_event_adjustment.rb index f26f857f2..85c44b302 100644 --- a/lib/stripe/resources/v2/billing/meter_event_adjustment.rb +++ b/lib/stripe/resources/v2/billing/meter_event_adjustment.rb @@ -9,6 +9,34 @@ class MeterEventAdjustment < APIResource def self.object_name "v2.billing.meter_event_adjustment" end + + class Cancel < Stripe::StripeObject + # Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + attr_reader :identifier + end + # Specifies which event to cancel. + attr_reader :cancel + + # The time the adjustment was created. + attr_reader :created + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + attr_reader :event_name + + # The unique id of this meter event adjustment. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + attr_reader :object + + # Open Enum. The meter event adjustment’s status. + attr_reader :status + + # Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + attr_reader :type end end end diff --git a/lib/stripe/resources/v2/billing/meter_event_session.rb b/lib/stripe/resources/v2/billing/meter_event_session.rb index 0bb2ac4d1..295dfe22e 100644 --- a/lib/stripe/resources/v2/billing/meter_event_session.rb +++ b/lib/stripe/resources/v2/billing/meter_event_session.rb @@ -9,6 +9,25 @@ class MeterEventSession < APIResource def self.object_name "v2.billing.meter_event_session" end + + # The authentication token for this session. Use this token when calling the + # high-throughput meter event API. + attr_reader :authentication_token + + # The creation time of this session. + attr_reader :created + + # The time at which this session will expire. + attr_reader :expires_at + + # The unique id of this auth session. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + attr_reader :object end end end diff --git a/lib/stripe/resources/v2/event.rb b/lib/stripe/resources/v2/event.rb index df657b403..da00e6243 100644 --- a/lib/stripe/resources/v2/event.rb +++ b/lib/stripe/resources/v2/event.rb @@ -8,6 +8,39 @@ class Event < APIResource def self.object_name "v2.core.event" end + + class Reason < Stripe::StripeObject + class Request < Stripe::StripeObject + # ID of the API request that caused the event. + attr_reader :id + # The idempotency key transmitted during the request. + attr_reader :idempotency_key + end + # Event reason type. + attr_reader :type + # Information on the API request that instigated the event. + attr_reader :request + end + # Authentication context needed to fetch the event or related object. + attr_reader :context + + # Time at which the object was created. + attr_reader :created + + # Unique identifier for the event. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + attr_reader :object + + # Reason for the event. + attr_reader :reason + + # The type of the event. + attr_reader :type end end end diff --git a/lib/stripe/resources/v2/event_destination.rb b/lib/stripe/resources/v2/event_destination.rb index ea0880238..060914691 100644 --- a/lib/stripe/resources/v2/event_destination.rb +++ b/lib/stripe/resources/v2/event_destination.rb @@ -8,6 +8,81 @@ class EventDestination < APIResource def self.object_name "v2.core.event_destination" end + + class StatusDetails < Stripe::StripeObject + class Disabled < Stripe::StripeObject + # Reason event destination has been disabled. + attr_reader :reason + end + # Details about why the event destination has been disabled. + attr_reader :disabled + end + + class AmazonEventbridge < Stripe::StripeObject + # The AWS account ID. + attr_reader :aws_account_id + # The ARN of the AWS event source. + attr_reader :aws_event_source_arn + # The state of the AWS event source. + attr_reader :aws_event_source_status + end + + class WebhookEndpoint < Stripe::StripeObject + # The signing secret of the webhook endpoint, only includable on creation. + attr_reader :signing_secret + # The URL of the webhook endpoint, includable. + attr_reader :url + end + # Time at which the object was created. + attr_reader :created + + # An optional description of what the event destination is used for. + attr_reader :description + + # The list of events to enable for this endpoint. + attr_reader :enabled_events + + # Payload type of events being subscribed to. + attr_reader :event_payload + + # Where events should be routed from. + attr_reader :events_from + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Metadata. + attr_reader :metadata + + # Event destination name. + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value of the object field. + attr_reader :object + + # If using the snapshot event payload, the API version events are rendered as. + attr_reader :snapshot_api_version + + # Status. It can be set to either enabled or disabled. + attr_reader :status + + # Additional information about event destination status. + attr_reader :status_details + + # Event destination type. + attr_reader :type + + # Time at which the object was last updated. + attr_reader :updated + + # Amazon EventBridge configuration. + attr_reader :amazon_eventbridge + + # Webhook endpoint configuration. + attr_reader :webhook_endpoint end end end diff --git a/lib/stripe/resources/webhook_endpoint.rb b/lib/stripe/resources/webhook_endpoint.rb index 9f9ca1925..c5a6eb774 100644 --- a/lib/stripe/resources/webhook_endpoint.rb +++ b/lib/stripe/resources/webhook_endpoint.rb @@ -20,6 +20,45 @@ def self.object_name "webhook_endpoint" end + # The API version events are rendered as for this webhook endpoint. + attr_reader :api_version + + # The ID of the associated Connect application. + attr_reader :application + + # Time at which the object was created. Measured in seconds since the Unix epoch. + attr_reader :created + + # An optional description of what the webhook is used for. + attr_reader :description + + # The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection. + attr_reader :enabled_events + + # Unique identifier for the object. + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + attr_reader :object + + # The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. + attr_reader :secret + + # The status of the webhook. It can be `enabled` or `disabled`. + attr_reader :status + + # The URL of the webhook endpoint. + attr_reader :url + + # Always true for a deleted object + attr_reader :deleted + # A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. def self.create(params = {}, opts = {}) request_stripe_object( diff --git a/lib/stripe/stripe_object.rb b/lib/stripe/stripe_object.rb index c73f8ee50..a6070fa46 100644 --- a/lib/stripe/stripe_object.rb +++ b/lib/stripe/stripe_object.rb @@ -83,6 +83,7 @@ def initialize(id = nil, opts = {}, api_mode = :v1, requestor = nil) @unsaved_values = Set.new @transient_values = Set.new @values[:id] = id if id + @id = id @last_response = nil @requestor = requestor || APIRequestor.active_requestor end @@ -369,6 +370,10 @@ class << self; self; end define_method(:"#{k}?") { @values[k] } if [FalseClass, TrueClass].include?(values[k].class) end end + + keys.each do |k| + instance_variable_set(:"@#{k}", values[k]) + end end # Disabling the cop because it's confused by the fact that the methods are diff --git a/rbi/stripe/resources/account.rbi b/rbi/stripe/resources/account.rbi new file mode 100644 index 000000000..e4a909925 --- /dev/null +++ b/rbi/stripe/resources/account.rbi @@ -0,0 +1,928 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # This is an object representing a Stripe account. You can retrieve it to see + # properties on the account like its current requirements or if the account is + # enabled to make live charges or receive payouts. + # + # For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + # is `application`, which includes Custom accounts, the properties below are always + # returned. + # + # For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) + # is `stripe`, which includes Standard and Express accounts, some properties are only returned + # until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions) + # to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts). + class Account < APIResource + class BusinessProfile < Stripe::StripeObject + class AnnualRevenue < Stripe::StripeObject + # A non-negative integer representing the amount in the [smallest currency unit](/currencies#zero-decimal). + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # 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). + sig { returns(T.nilable(String)) } + attr_reader :currency + # The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. + sig { returns(T.nilable(String)) } + attr_reader :fiscal_year_end + end + class MonthlyEstimatedRevenue < Stripe::StripeObject + # A non-negative integer representing how much to charge in the [smallest currency unit](/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + end + class SupportAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # The applicant's gross annual revenue for its preceding fiscal year. + sig { returns(T.nilable(AnnualRevenue)) } + attr_reader :annual_revenue + # An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. + sig { returns(T.nilable(Integer)) } + attr_reader :estimated_worker_count + # [The merchant category code for the account](/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. + sig { returns(T.nilable(String)) } + attr_reader :mcc + # Attribute for field monthly_estimated_revenue + sig { returns(MonthlyEstimatedRevenue) } + attr_reader :monthly_estimated_revenue + # The customer-facing business name. + sig { returns(T.nilable(String)) } + attr_reader :name + # Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # A publicly available mailing address for sending support issues to. + sig { returns(T.nilable(SupportAddress)) } + attr_reader :support_address + # A publicly available email address for sending support issues to. + sig { returns(T.nilable(String)) } + attr_reader :support_email + # A publicly available phone number to call with support issues. + sig { returns(T.nilable(String)) } + attr_reader :support_phone + # A publicly available website for handling support issues. + sig { returns(T.nilable(String)) } + attr_reader :support_url + # The business's publicly available website. + sig { returns(T.nilable(String)) } + attr_reader :url + end + class Capabilities < Stripe::StripeObject + # The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. + sig { returns(String) } + attr_reader :acss_debit_payments + # The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. + sig { returns(String) } + attr_reader :affirm_payments + # The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. + sig { returns(String) } + attr_reader :afterpay_clearpay_payments + # The status of the Alma capability of the account, or whether the account can directly process Alma payments. + sig { returns(String) } + attr_reader :alma_payments + # The status of the AmazonPay capability of the account, or whether the account can directly process AmazonPay payments. + sig { returns(String) } + attr_reader :amazon_pay_payments + # The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. + sig { returns(String) } + attr_reader :au_becs_debit_payments + # The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. + sig { returns(String) } + attr_reader :bacs_debit_payments + # The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. + sig { returns(String) } + attr_reader :bancontact_payments + # The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. + sig { returns(String) } + attr_reader :bank_transfer_payments + # The status of the blik payments capability of the account, or whether the account can directly process blik charges. + sig { returns(String) } + attr_reader :blik_payments + # The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. + sig { returns(String) } + attr_reader :boleto_payments + # The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards + sig { returns(String) } + attr_reader :card_issuing + # The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. + sig { returns(String) } + attr_reader :card_payments + # The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. + sig { returns(String) } + attr_reader :cartes_bancaires_payments + # The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. + sig { returns(String) } + attr_reader :cashapp_payments + # The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. + sig { returns(String) } + attr_reader :eps_payments + # The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. + sig { returns(String) } + attr_reader :fpx_payments + # The status of the GB customer_balance payments (GBP currency) capability of the account, or whether the account can directly process GB customer_balance charges. + sig { returns(String) } + attr_reader :gb_bank_transfer_payments + # The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. + sig { returns(String) } + attr_reader :giropay_payments + # The status of the Gopay capability of the account, or whether the account can directly process Gopay payments. + sig { returns(String) } + attr_reader :gopay_payments + # The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. + sig { returns(String) } + attr_reader :grabpay_payments + # The status of the Indonesia Bank Transfer payments capability of the account, or whether the account can directly process Indonesia Bank Transfer charges. + sig { returns(String) } + attr_reader :id_bank_transfer_payments + # The status of Bank BCA onboarding of the account. + sig { returns(String) } + attr_reader :id_bank_transfer_payments_bca + # The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. + sig { returns(String) } + attr_reader :ideal_payments + # The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. + sig { returns(String) } + attr_reader :india_international_payments + # The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. + sig { returns(String) } + attr_reader :jcb_payments + # The status of the Japanese customer_balance payments (JPY currency) capability of the account, or whether the account can directly process Japanese customer_balance charges. + sig { returns(String) } + attr_reader :jp_bank_transfer_payments + # The status of the KakaoPay capability of the account, or whether the account can directly process KakaoPay payments. + sig { returns(String) } + attr_reader :kakao_pay_payments + # The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. + sig { returns(String) } + attr_reader :klarna_payments + # The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. + sig { returns(String) } + attr_reader :konbini_payments + # The status of the KrCard capability of the account, or whether the account can directly process KrCard payments. + sig { returns(String) } + attr_reader :kr_card_payments + # The status of the legacy payments capability of the account. + sig { returns(String) } + attr_reader :legacy_payments + # The status of the link_payments capability of the account, or whether the account can directly process Link charges. + sig { returns(String) } + attr_reader :link_payments + # The status of the MB WAY payments capability of the account, or whether the account can directly process MB WAY charges. + sig { returns(String) } + attr_reader :mb_way_payments + # The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. + sig { returns(String) } + attr_reader :mobilepay_payments + # The status of the Multibanco payments capability of the account, or whether the account can directly process Multibanco charges. + sig { returns(String) } + attr_reader :multibanco_payments + # The status of the Mexican customer_balance payments (MXN currency) capability of the account, or whether the account can directly process Mexican customer_balance charges. + sig { returns(String) } + attr_reader :mx_bank_transfer_payments + # The status of the NaverPay capability of the account, or whether the account can directly process NaverPay payments. + sig { returns(String) } + attr_reader :naver_pay_payments + # The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. + sig { returns(String) } + attr_reader :oxxo_payments + # The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. + sig { returns(String) } + attr_reader :p24_payments + # The status of the Payco capability of the account, or whether the account can directly process Payco payments. + sig { returns(String) } + attr_reader :payco_payments + # The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. + sig { returns(String) } + attr_reader :paynow_payments + # The status of the PayPal payments capability of the account, or whether the account can directly process PayPal charges. + sig { returns(String) } + attr_reader :paypal_payments + # The status of the PayTo capability of the account, or whether the account can directly process PayTo charges. + sig { returns(String) } + attr_reader :payto_payments + # The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. + sig { returns(String) } + attr_reader :promptpay_payments + # The status of the Qris capability of the account, or whether the account can directly process Qris payments. + sig { returns(String) } + attr_reader :qris_payments + # The status of the Rechnung capability of the account, or whether the account can directly process Rechnung payments. + sig { returns(String) } + attr_reader :rechnung_payments + # The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. + sig { returns(String) } + attr_reader :revolut_pay_payments + # The status of the SamsungPay capability of the account, or whether the account can directly process SamsungPay payments. + sig { returns(String) } + attr_reader :samsung_pay_payments + # The status of the SEPA customer_balance payments (EUR currency) capability of the account, or whether the account can directly process SEPA customer_balance charges. + sig { returns(String) } + attr_reader :sepa_bank_transfer_payments + # The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. + sig { returns(String) } + attr_reader :sepa_debit_payments + # The status of the ShopeePay capability of the account, or whether the account can directly process ShopeePay payments. + sig { returns(String) } + attr_reader :shopeepay_payments + # The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. + sig { returns(String) } + attr_reader :sofort_payments + # The status of the Swish capability of the account, or whether the account can directly process Swish payments. + sig { returns(String) } + attr_reader :swish_payments + # The status of the tax reporting 1099-K (US) capability of the account. + sig { returns(String) } + attr_reader :tax_reporting_us_1099_k + # The status of the tax reporting 1099-MISC (US) capability of the account. + sig { returns(String) } + attr_reader :tax_reporting_us_1099_misc + # The status of the transfers capability of the account, or whether your platform can transfer funds to the account. + sig { returns(String) } + attr_reader :transfers + # The status of the banking capability, or whether the account can have bank accounts. + sig { returns(String) } + attr_reader :treasury + # The status of the treasury_evolve capability of the account. + sig { returns(String) } + attr_reader :treasury_evolve + # The status of the treasury_fifth_third capability of the account. + sig { returns(String) } + attr_reader :treasury_fifth_third + # The status of the treasury_goldman_sachs capability of the account. + sig { returns(String) } + attr_reader :treasury_goldman_sachs + # The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. + sig { returns(String) } + attr_reader :twint_payments + # The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. + sig { returns(String) } + attr_reader :us_bank_account_ach_payments + # The status of the US customer_balance payments (USD currency) capability of the account, or whether the account can directly process US customer_balance charges. + sig { returns(String) } + attr_reader :us_bank_transfer_payments + # The status of the Zip capability of the account, or whether the account can directly process Zip charges. + sig { returns(String) } + attr_reader :zip_payments + end + class Company < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class AddressKana < Stripe::StripeObject + # City/Ward. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Block/Building number. + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Building details. + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # Prefecture. + sig { returns(T.nilable(String)) } + attr_reader :state + # Town/cho-me. + sig { returns(T.nilable(String)) } + attr_reader :town + end + class AddressKanji < Stripe::StripeObject + # City/Ward. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Block/Building number. + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Building details. + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # Prefecture. + sig { returns(T.nilable(String)) } + attr_reader :state + # Town/cho-me. + sig { returns(T.nilable(String)) } + attr_reader :town + end + class OwnershipDeclaration < Stripe::StripeObject + # The Unix timestamp marking when the beneficial owner attestation was made. + sig { returns(T.nilable(Integer)) } + attr_reader :date + # The IP address from which the beneficial owner attestation was made. + sig { returns(T.nilable(String)) } + attr_reader :ip + # The user-agent string from the browser where the beneficial owner attestation was made. + sig { returns(T.nilable(String)) } + attr_reader :user_agent + end + class Verification < Stripe::StripeObject + class Document < Stripe::StripeObject + # The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :back + # A user-displayable string describing the verification state of this document. + sig { returns(T.nilable(String)) } + attr_reader :details + # One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document. + sig { returns(T.nilable(String)) } + attr_reader :details_code + # The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :front + end + # Attribute for field document + sig { returns(Document) } + attr_reader :document + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The Kana variation of the company's primary address (Japan only). + sig { returns(T.nilable(AddressKana)) } + attr_reader :address_kana + # The Kanji variation of the company's primary address (Japan only). + sig { returns(T.nilable(AddressKanji)) } + attr_reader :address_kanji + # Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). + sig { returns(T::Boolean) } + attr_reader :directors_provided + # Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. + sig { returns(T::Boolean) } + attr_reader :executives_provided + # The export license ID number of the company, also referred as Import Export Code (India only). + sig { returns(String) } + attr_reader :export_license_id + # The purpose code to use for export transactions (India only). + sig { returns(String) } + attr_reader :export_purpose_code + # The company's legal name. + sig { returns(T.nilable(String)) } + attr_reader :name + # The Kana variation of the company's legal name (Japan only). + sig { returns(T.nilable(String)) } + attr_reader :name_kana + # The Kanji variation of the company's legal name (Japan only). + sig { returns(T.nilable(String)) } + attr_reader :name_kanji + # Whether the company's owners have been provided. This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). + sig { returns(T::Boolean) } + attr_reader :owners_provided + # This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. + sig { returns(T.nilable(OwnershipDeclaration)) } + attr_reader :ownership_declaration + # The company's phone number (used for verification). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. + sig { returns(String) } + attr_reader :structure + # Whether the company's business ID number was provided. + sig { returns(T::Boolean) } + attr_reader :tax_id_provided + # The jurisdiction in which the `tax_id` is registered (Germany-based companies only). + sig { returns(String) } + attr_reader :tax_id_registrar + # Whether the company's business VAT number was provided. + sig { returns(T::Boolean) } + attr_reader :vat_id_provided + # Information on the verification state of the company. + sig { returns(T.nilable(Verification)) } + attr_reader :verification + end + class Controller < Stripe::StripeObject + class Application < Stripe::StripeObject + # `true` if the Connect application is responsible for negative balances and should manage credit and fraud risk on the account. + sig { returns(T::Boolean) } + attr_reader :loss_liable + # `true` if the Connect application is responsible for onboarding the account. + sig { returns(T::Boolean) } + attr_reader :onboarding_owner + # `true` if the Connect application is responsible for paying Stripe fees on pricing-control eligible products. + sig { returns(T::Boolean) } + attr_reader :pricing_controls + end + class Dashboard < Stripe::StripeObject + # Whether this account has access to the full Stripe dashboard (`full`), to the Express dashboard (`express`), or to no dashboard (`none`). + sig { returns(String) } + attr_reader :type + end + class Fees < Stripe::StripeObject + # A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). + sig { returns(String) } + attr_reader :payer + end + class Losses < Stripe::StripeObject + # A value indicating who is liable when this account can't pay back negative balances from payments. + sig { returns(String) } + attr_reader :payments + end + class StripeDashboard < Stripe::StripeObject + # A value indicating the Stripe dashboard this account has access to independent of the Connect application. + sig { returns(String) } + attr_reader :type + end + # Attribute for field application + sig { returns(Application) } + attr_reader :application + # Attribute for field dashboard + sig { returns(Dashboard) } + attr_reader :dashboard + # Attribute for field fees + sig { returns(Fees) } + attr_reader :fees + # `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). Otherwise, this field is null. + sig { returns(T::Boolean) } + attr_reader :is_controller + # Attribute for field losses + sig { returns(Losses) } + attr_reader :losses + # A value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account. + sig { returns(String) } + attr_reader :requirement_collection + # Attribute for field stripe_dashboard + sig { returns(StripeDashboard) } + attr_reader :stripe_dashboard + # The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. + sig { returns(String) } + attr_reader :type + end + class FutureRequirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :original_fields_due + end + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + sig { returns(T.nilable(T::Array[Alternative])) } + attr_reader :alternatives + # Date on which `future_requirements` becomes the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. + sig { returns(T.nilable(Integer)) } + attr_reader :current_deadline + # Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :currently_due + # This is typed as an enum for consistency with `requirements.disabled_reason`. + sig { returns(T.nilable(String)) } + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T.nilable(T::Array[Error])) } + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :eventually_due + # Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pending_verification + end + class Groups < Stripe::StripeObject + # The group the account is in to determine their payments pricing, and null if the account is on customized pricing. [See the Platform pricing tool documentation](https://stripe.com/docs/connect/platform-pricing-tools) for details. + sig { returns(T.nilable(String)) } + attr_reader :payments_pricing + end + class Requirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :original_fields_due + end + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + sig { returns(T.nilable(T::Array[Alternative])) } + attr_reader :alternatives + # Date by which the fields in `currently_due` must be collected to keep the account enabled. These fields may disable the account sooner if the next threshold is reached before they are collected. + sig { returns(T.nilable(Integer)) } + attr_reader :current_deadline + # Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :currently_due + # If the account is disabled, this enum describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + sig { returns(T.nilable(String)) } + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T.nilable(T::Array[Error])) } + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :eventually_due + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the account. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pending_verification + end + class RiskControls < Stripe::StripeObject + class Charges < Stripe::StripeObject + # Whether a pause of the risk control has been requested. + sig { returns(T::Boolean) } + attr_reader :pause_requested + end + class Payouts < Stripe::StripeObject + # Whether a pause of the risk control has been requested. + sig { returns(T::Boolean) } + attr_reader :pause_requested + end + # Attribute for field charges + sig { returns(Charges) } + attr_reader :charges + # Attribute for field payouts + sig { returns(Payouts) } + attr_reader :payouts + end + class Settings < Stripe::StripeObject + class BacsDebitPayments < Stripe::StripeObject + # The Bacs Direct Debit display name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. + sig { returns(T.nilable(String)) } + attr_reader :display_name + # The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. + sig { returns(T.nilable(String)) } + attr_reader :service_user_number + end + class BankBcaOnboarding < Stripe::StripeObject + # Bank BCA business account holder name. + sig { returns(String) } + attr_reader :account_holder_name + # Bank BCA business account number. + sig { returns(String) } + attr_reader :business_account_number + end + class Branding < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :icon + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :logo + # A CSS hex color value representing the primary branding color for this account + sig { returns(T.nilable(String)) } + attr_reader :primary_color + # A CSS hex color value representing the secondary branding color for this account + sig { returns(T.nilable(String)) } + attr_reader :secondary_color + end + class Capital < Stripe::StripeObject + # Per-currency mapping of user-selected destination accounts used to pay out loans. + sig { returns(T::Hash[String, String]) } + attr_reader :payout_destination + # Per-currency mapping of all destination accounts eligible to receive loan payouts. + sig { returns(T::Hash[String, T::Array[String]]) } + attr_reader :payout_destination_selector + end + class CardIssuing < Stripe::StripeObject + class TosAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the account representative accepted the service agreement. + sig { returns(T.nilable(Integer)) } + attr_reader :date + # The IP address from which the account representative accepted the service agreement. + sig { returns(T.nilable(String)) } + attr_reader :ip + # The user agent of the browser from which the account representative accepted the service agreement. + sig { returns(String) } + attr_reader :user_agent + end + # Attribute for field tos_acceptance + sig { returns(TosAcceptance) } + attr_reader :tos_acceptance + end + class CardPayments < Stripe::StripeObject + class DeclineOn < Stripe::StripeObject + # Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. + sig { returns(T::Boolean) } + attr_reader :avs_failure + # Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. + sig { returns(T::Boolean) } + attr_reader :cvc_failure + end + # Attribute for field decline_on + sig { returns(DeclineOn) } + attr_reader :decline_on + # The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_prefix + # The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_prefix_kana + # The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_prefix_kanji + end + class Dashboard < Stripe::StripeObject + # The display name for this account. This is used on the Stripe Dashboard to differentiate between accounts. + sig { returns(T.nilable(String)) } + attr_reader :display_name + # The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). + sig { returns(T.nilable(String)) } + attr_reader :timezone + end + class Invoices < Stripe::StripeObject + # The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :default_account_tax_ids + end + class Payments < Stripe::StripeObject + # The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + # The Kana variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_kana + # The Kanji variation of `statement_descriptor` used for charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_kanji + # The Kana variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_prefix_kana + # The Kanji variation of `statement_descriptor_prefix` used for card charges in Japan. Japanese statement descriptors have [special requirements](https://docs.stripe.com/get-started/account/statement-descriptors#set-japanese-statement-descriptors). + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_prefix_kanji + end + class Payouts < Stripe::StripeObject + class Schedule < Stripe::StripeObject + # The number of days charges for the account will be held before being paid out. + sig { returns(Integer) } + attr_reader :delay_days + # How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. + sig { returns(String) } + attr_reader :interval + # The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. + sig { returns(Integer) } + attr_reader :monthly_anchor + # The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. + sig { returns(String) } + attr_reader :weekly_anchor + end + # A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. + sig { returns(T::Boolean) } + attr_reader :debit_negative_balances + # Attribute for field schedule + sig { returns(Schedule) } + attr_reader :schedule + # The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class SepaDebitPayments < Stripe::StripeObject + # SEPA creditor identifier that identifies the company making the payment. + sig { returns(String) } + attr_reader :creditor_id + end + class TaxForms < Stripe::StripeObject + # Whether the account opted out of receiving their tax forms by postal delivery. + sig { returns(T::Boolean) } + attr_reader :consented_to_paperless_delivery + end + class Treasury < Stripe::StripeObject + class TosAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the account representative accepted the service agreement. + sig { returns(T.nilable(Integer)) } + attr_reader :date + # The IP address from which the account representative accepted the service agreement. + sig { returns(T.nilable(String)) } + attr_reader :ip + # The user agent of the browser from which the account representative accepted the service agreement. + sig { returns(String) } + attr_reader :user_agent + end + # Attribute for field tos_acceptance + sig { returns(TosAcceptance) } + attr_reader :tos_acceptance + end + # Attribute for field bacs_debit_payments + sig { returns(BacsDebitPayments) } + attr_reader :bacs_debit_payments + # Attribute for field bank_bca_onboarding + sig { returns(BankBcaOnboarding) } + attr_reader :bank_bca_onboarding + # Attribute for field branding + sig { returns(Branding) } + attr_reader :branding + # Attribute for field capital + sig { returns(Capital) } + attr_reader :capital + # Attribute for field card_issuing + sig { returns(CardIssuing) } + attr_reader :card_issuing + # Attribute for field card_payments + sig { returns(CardPayments) } + attr_reader :card_payments + # Attribute for field dashboard + sig { returns(Dashboard) } + attr_reader :dashboard + # Attribute for field invoices + sig { returns(Invoices) } + attr_reader :invoices + # Attribute for field payments + sig { returns(Payments) } + attr_reader :payments + # Attribute for field payouts + sig { returns(Payouts) } + attr_reader :payouts + # Attribute for field sepa_debit_payments + sig { returns(SepaDebitPayments) } + attr_reader :sepa_debit_payments + # Attribute for field tax_forms + sig { returns(TaxForms) } + attr_reader :tax_forms + # Attribute for field treasury + sig { returns(Treasury) } + attr_reader :treasury + end + class TosAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the account representative accepted their service agreement + sig { returns(T.nilable(Integer)) } + attr_reader :date + # The IP address from which the account representative accepted their service agreement + sig { returns(T.nilable(String)) } + attr_reader :ip + # The user's service agreement type + sig { returns(String) } + attr_reader :service_agreement + # The user agent of the browser from which the account representative accepted their service agreement + sig { returns(T.nilable(String)) } + attr_reader :user_agent + end + # Business information about the account. + sig { returns(T.nilable(BusinessProfile)) } + attr_reader :business_profile + + # The business type. After you create an [Account Link](/api/account_links) or [Account Session](/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + sig { returns(T.nilable(String)) } + attr_reader :business_type + + # Attribute for field capabilities + sig { returns(Capabilities) } + attr_reader :capabilities + + # Whether the account can process charges. + sig { returns(T::Boolean) } + attr_reader :charges_enabled + + # Attribute for field company + sig { returns(Company) } + attr_reader :company + + # Attribute for field controller + sig { returns(Controller) } + attr_reader :controller + + # The account's country. + sig { returns(String) } + attr_reader :country + + # Time at which the account was connected. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). + sig { returns(String) } + attr_reader :default_currency + + # Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](/connect/onboarding) to finish submitting account details. + sig { returns(T::Boolean) } + attr_reader :details_submitted + + # An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. + sig { returns(T.nilable(String)) } + attr_reader :email + + # External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true. + sig { returns(Stripe::ListObject) } + attr_reader :external_accounts + + # Attribute for field future_requirements + sig { returns(FutureRequirements) } + attr_reader :future_requirements + + # The groups associated with the account. + sig { returns(T.nilable(Groups)) } + attr_reader :groups + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # This is an object representing a person associated with a Stripe account. + # + # A platform cannot access a person for an account where [account.controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. + # + # See the [Standard onboarding](/connect/standard-accounts) or [Express onboarding](/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](/connect/handling-api-verification#person-information). + sig { returns(Stripe::Person) } + attr_reader :individual + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Whether the funds in this account can be paid out. + sig { returns(T::Boolean) } + attr_reader :payouts_enabled + + # Attribute for field requirements + sig { returns(Requirements) } + attr_reader :requirements + + # Attribute for field risk_controls + sig { returns(RiskControls) } + attr_reader :risk_controls + + # Options for customizing how the account functions within Stripe. + sig { returns(T.nilable(Settings)) } + attr_reader :settings + + # Attribute for field tos_acceptance + sig { returns(TosAcceptance) } + attr_reader :tos_acceptance + + # The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. + sig { returns(String) } + attr_reader :type + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/account_link.rbi b/rbi/stripe/resources/account_link.rbi new file mode 100644 index 000000000..219338709 --- /dev/null +++ b/rbi/stripe/resources/account_link.rbi @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Account Links are the means by which a Connect platform grants a connected account permission to access + # Stripe-hosted applications, such as Connect Onboarding. + # + # Related guide: [Connect Onboarding](https://stripe.com/docs/connect/custom/hosted-onboarding) + class AccountLink < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The timestamp at which this account link will expire. + sig { returns(Integer) } + attr_reader :expires_at + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The URL for the account link. + sig { returns(String) } + attr_reader :url + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/account_notice.rbi b/rbi/stripe/resources/account_notice.rbi new file mode 100644 index 000000000..6b418ad8d --- /dev/null +++ b/rbi/stripe/resources/account_notice.rbi @@ -0,0 +1,72 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A notice to a Connected account. Notice can be sent by Stripe on your behalf or you can opt to send the notices yourself. + # + # See the [guide to send notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) to your connected accounts. + class AccountNotice < APIResource + class Email < Stripe::StripeObject + # Content of the email in plain text. The copy must match exactly the language that Stripe Compliance has approved for use. + sig { returns(String) } + attr_reader :plain_text + # Email address of the recipient. + sig { returns(String) } + attr_reader :recipient + # Subject of the email. + sig { returns(String) } + attr_reader :subject + end + class LinkedObjects < Stripe::StripeObject + # Associated [Capability](https://stripe.com/docs/api/capabilities) + sig { returns(T.nilable(String)) } + attr_reader :capability + # Associated [Credit Underwriting Record](https://stripe.com/docs/api/issuing/credit_underwriting_record) + sig { returns(T.nilable(String)) } + attr_reader :issuing_credit_underwriting_record + # Associated [Issuing Dispute](https://stripe.com/docs/api/issuing/disputes) + sig { returns(T.nilable(String)) } + attr_reader :issuing_dispute + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # When present, the deadline for sending the notice to meet the relevant regulations. + sig { returns(T.nilable(Integer)) } + attr_reader :deadline + + # Information about the email when sent. + sig { returns(T.nilable(Email)) } + attr_reader :email + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Information about objects related to the notice. + sig { returns(T.nilable(LinkedObjects)) } + attr_reader :linked_objects + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Reason the notice is being sent. The reason determines what copy the notice must contain. See the [regulated customer notices](https://stripe.com/docs/issuing/compliance-us/issuing-regulated-customer-notices) guide. All reasons might not apply to your integration, and Stripe might add new reasons in the future, so we recommend an internal warning when you receive an unknown reason. + sig { returns(String) } + attr_reader :reason + + # Date when the notice was sent. When absent, you must send the notice, update the content of the email and date when it was sent. + sig { returns(T.nilable(Integer)) } + attr_reader :sent_at + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/account_session.rbi b/rbi/stripe/resources/account_session.rbi new file mode 100644 index 000000000..ed8dd924f --- /dev/null +++ b/rbi/stripe/resources/account_session.rbi @@ -0,0 +1,291 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. + # + # We recommend that you create an AccountSession each time you need to display an embedded component + # to your user. Do not save AccountSessions to your database as they expire relatively + # quickly, and cannot be used more than once. + # + # Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) + class AccountSession < APIResource + class Components < Stripe::StripeObject + class AccountManagement < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + sig { returns(T::Boolean) } + attr_reader :disable_stripe_user_authentication + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + sig { returns(T::Boolean) } + attr_reader :external_account_collection + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class AccountOnboarding < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + sig { returns(T::Boolean) } + attr_reader :disable_stripe_user_authentication + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + sig { returns(T::Boolean) } + attr_reader :external_account_collection + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class Balances < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + sig { returns(T::Boolean) } + attr_reader :disable_stripe_user_authentication + # Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :edit_payout_schedule + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + sig { returns(T::Boolean) } + attr_reader :external_account_collection + # Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :instant_payouts + # Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :standard_payouts + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class CapitalFinancing < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class CapitalFinancingApplication < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class CapitalFinancingPromotion < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class Documents < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class NotificationBanner < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + sig { returns(T::Boolean) } + attr_reader :disable_stripe_user_authentication + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + sig { returns(T::Boolean) } + attr_reader :external_account_collection + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class PaymentDetails < Stripe::StripeObject + class Features < Stripe::StripeObject + # Whether to allow capturing and cancelling payment intents. This is `true` by default. + sig { returns(T::Boolean) } + attr_reader :capture_payments + # Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + sig { returns(T::Boolean) } + attr_reader :destination_on_behalf_of_charge_management + # Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + sig { returns(T::Boolean) } + attr_reader :dispute_management + # Whether to allow sending refunds. This is `true` by default. + sig { returns(T::Boolean) } + attr_reader :refund_management + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class Payments < Stripe::StripeObject + class Features < Stripe::StripeObject + # Whether to allow capturing and cancelling payment intents. This is `true` by default. + sig { returns(T::Boolean) } + attr_reader :capture_payments + # Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. + sig { returns(T::Boolean) } + attr_reader :destination_on_behalf_of_charge_management + # Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. + sig { returns(T::Boolean) } + attr_reader :dispute_management + # Whether to allow sending refunds. This is `true` by default. + sig { returns(T::Boolean) } + attr_reader :refund_management + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class Payouts < Stripe::StripeObject + class Features < Stripe::StripeObject + # Disables Stripe user authentication for this embedded component. This feature can only be `true` for accounts where you’re responsible for collecting updated information when requirements are due or change, like Custom accounts. The default value for this feature is `false` when `external_account_collection` is enabled and `true` otherwise. + sig { returns(T::Boolean) } + attr_reader :disable_stripe_user_authentication + # Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :edit_payout_schedule + # Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for accounts where you’re responsible for collecting updated information when requirements are due or change, like custom accounts. Otherwise, bank account collection is determined by compliance requirements. The default value for this feature is `true`. + sig { returns(T::Boolean) } + attr_reader :external_account_collection + # Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :instant_payouts + # Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :standard_payouts + end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class PayoutsList < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class TaxRegistrations < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + class TaxSettings < Stripe::StripeObject + class Features < Stripe::StripeObject; end + # Whether the embedded component is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field features + sig { returns(Features) } + attr_reader :features + end + # Attribute for field account_management + sig { returns(AccountManagement) } + attr_reader :account_management + # Attribute for field account_onboarding + sig { returns(AccountOnboarding) } + attr_reader :account_onboarding + # Attribute for field balances + sig { returns(Balances) } + attr_reader :balances + # Attribute for field capital_financing + sig { returns(T.nilable(CapitalFinancing)) } + attr_reader :capital_financing + # Attribute for field capital_financing_application + sig { returns(T.nilable(CapitalFinancingApplication)) } + attr_reader :capital_financing_application + # Attribute for field capital_financing_promotion + sig { returns(T.nilable(CapitalFinancingPromotion)) } + attr_reader :capital_financing_promotion + # Attribute for field documents + sig { returns(Documents) } + attr_reader :documents + # Attribute for field notification_banner + sig { returns(NotificationBanner) } + attr_reader :notification_banner + # Attribute for field payment_details + sig { returns(PaymentDetails) } + attr_reader :payment_details + # Attribute for field payments + sig { returns(Payments) } + attr_reader :payments + # Attribute for field payouts + sig { returns(Payouts) } + attr_reader :payouts + # Attribute for field payouts_list + sig { returns(PayoutsList) } + attr_reader :payouts_list + # Attribute for field tax_registrations + sig { returns(TaxRegistrations) } + attr_reader :tax_registrations + # Attribute for field tax_settings + sig { returns(TaxSettings) } + attr_reader :tax_settings + end + # The ID of the account the AccountSession was created for + sig { returns(String) } + attr_reader :account + + # The client secret of this AccountSession. Used on the client to set up secure access to the given `account`. + # + # The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret. + # + # Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. + sig { returns(String) } + attr_reader :client_secret + + # Attribute for field components + sig { returns(Components) } + attr_reader :components + + # The timestamp at which this AccountSession will expire. + sig { returns(Integer) } + attr_reader :expires_at + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/apple_pay_domain.rbi b/rbi/stripe/resources/apple_pay_domain.rbi new file mode 100644 index 000000000..3d0a10822 --- /dev/null +++ b/rbi/stripe/resources/apple_pay_domain.rbi @@ -0,0 +1,32 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Domains registered for Apple Pay on the Web + class ApplePayDomain < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Attribute for field domain_name + sig { returns(String) } + attr_reader :domain_name + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/application.rbi b/rbi/stripe/resources/application.rbi new file mode 100644 index 000000000..45d8431f8 --- /dev/null +++ b/rbi/stripe/resources/application.rbi @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class Application < APIResource + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The name of the application. + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/application_fee.rbi b/rbi/stripe/resources/application_fee.rbi new file mode 100644 index 000000000..c1a4414d9 --- /dev/null +++ b/rbi/stripe/resources/application_fee.rbi @@ -0,0 +1,78 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class ApplicationFee < APIResource + class FeeSource < Stripe::StripeObject + # Charge ID that created this application fee. + sig { returns(String) } + attr_reader :charge + # Payout ID that created this application fee. + sig { returns(String) } + attr_reader :payout + # Type of object that created the application fee, either `charge` or `payout`. + sig { returns(String) } + attr_reader :type + end + # ID of the Stripe account this fee was taken from. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + + # Amount earned, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued) + sig { returns(Integer) } + attr_reader :amount_refunded + + # ID of the Connect application that earned the fee. + sig { returns(T.any(String, Stripe::Application)) } + attr_reader :application + + # Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # ID of the charge that the application fee was taken from. + sig { returns(T.any(String, Stripe::Charge)) } + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. + sig { returns(T.nilable(FeeSource)) } + attr_reader :fee_source + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :originating_transaction + + # Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. + sig { returns(T::Boolean) } + attr_reader :refunded + + # A list of refunds that have been applied to the fee. + sig { returns(Stripe::ListObject) } + attr_reader :refunds + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/application_fee_refund.rbi b/rbi/stripe/resources/application_fee_refund.rbi new file mode 100644 index 000000000..f39f239a6 --- /dev/null +++ b/rbi/stripe/resources/application_fee_refund.rbi @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # `Application Fee Refund` objects allow you to refund an application fee that + # has previously been created but not yet refunded. Funds will be refunded to + # the Stripe account from which the fee was originally collected. + # + # Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee) + class ApplicationFeeRefund < APIResource + # Amount, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # Balance transaction that describes the impact on your account balance. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # ID of the application fee that was refunded. + sig { returns(T.any(String, Stripe::ApplicationFee)) } + attr_reader :fee + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/apps/secret.rbi b/rbi/stripe/resources/apps/secret.rbi new file mode 100644 index 000000000..ba2df56e8 --- /dev/null +++ b/rbi/stripe/resources/apps/secret.rbi @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Apps + # Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. + # + # The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control. + # + # All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key. + # + # A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions. + # + # Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects) + class Secret < APIResource + class Scope < Stripe::StripeObject + # The secret scope type. + sig { returns(String) } + attr_reader :type + # The user ID, if type is set to "user" + sig { returns(String) } + attr_reader :user + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # If true, indicates that this secret has been deleted + sig { returns(T::Boolean) } + attr_reader :deleted + + # The Unix timestamp for the expiry time of the secret, after which the secret deletes. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # A name for the secret that's unique within the scope. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The plaintext secret value to be stored. + sig { returns(T.nilable(String)) } + attr_reader :payload + + # Attribute for field scope + sig { returns(Scope) } + attr_reader :scope + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/balance.rbi b/rbi/stripe/resources/balance.rbi new file mode 100644 index 000000000..bf1a9390d --- /dev/null +++ b/rbi/stripe/resources/balance.rbi @@ -0,0 +1,186 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # This is an object representing your Stripe balance. You can retrieve it to see + # the balance currently on your Stripe account. + # + # You can also retrieve the balance history, which contains a list of + # [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance + # (charges, payouts, and so forth). + # + # The available and pending amounts for each currency are broken down further by + # payment source types. + # + # Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances) + class Balance < SingletonAPIResource + class Available < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + sig { returns(Integer) } + attr_reader :bank_account + # Amount for card. + sig { returns(Integer) } + attr_reader :card + # Amount for FPX. + sig { returns(Integer) } + attr_reader :fpx + end + # Balance amount. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Attribute for field source_types + sig { returns(SourceTypes) } + attr_reader :source_types + end + class ConnectReserved < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + sig { returns(Integer) } + attr_reader :bank_account + # Amount for card. + sig { returns(Integer) } + attr_reader :card + # Amount for FPX. + sig { returns(Integer) } + attr_reader :fpx + end + # Balance amount. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Attribute for field source_types + sig { returns(SourceTypes) } + attr_reader :source_types + end + class InstantAvailable < Stripe::StripeObject + class NetAvailable < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + sig { returns(Integer) } + attr_reader :bank_account + # Amount for card. + sig { returns(Integer) } + attr_reader :card + # Amount for FPX. + sig { returns(Integer) } + attr_reader :fpx + end + # Net balance amount, subtracting fees from platform-set pricing. + sig { returns(Integer) } + attr_reader :amount + # ID of the external account for this net balance (not expandable). + sig { returns(String) } + attr_reader :destination + # Attribute for field source_types + sig { returns(SourceTypes) } + attr_reader :source_types + end + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + sig { returns(Integer) } + attr_reader :bank_account + # Amount for card. + sig { returns(Integer) } + attr_reader :card + # Amount for FPX. + sig { returns(Integer) } + attr_reader :fpx + end + # Balance amount. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Breakdown of balance by destination. + sig { returns(T::Array[NetAvailable]) } + attr_reader :net_available + # Attribute for field source_types + sig { returns(SourceTypes) } + attr_reader :source_types + end + class Issuing < Stripe::StripeObject + class Available < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + sig { returns(Integer) } + attr_reader :bank_account + # Amount for card. + sig { returns(Integer) } + attr_reader :card + # Amount for FPX. + sig { returns(Integer) } + attr_reader :fpx + end + # Balance amount. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Attribute for field source_types + sig { returns(SourceTypes) } + attr_reader :source_types + end + # Funds that are available for use. + sig { returns(T::Array[Available]) } + attr_reader :available + end + class Pending < Stripe::StripeObject + class SourceTypes < Stripe::StripeObject + # Amount for bank account. + sig { returns(Integer) } + attr_reader :bank_account + # Amount for card. + sig { returns(Integer) } + attr_reader :card + # Amount for FPX. + sig { returns(Integer) } + attr_reader :fpx + end + # Balance amount. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Attribute for field source_types + sig { returns(SourceTypes) } + attr_reader :source_types + end + # Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. + sig { returns(T::Array[Available]) } + attr_reader :available + + # Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. + sig { returns(T::Array[ConnectReserved]) } + attr_reader :connect_reserved + + # Funds that you can pay out using Instant Payouts. + sig { returns(T::Array[InstantAvailable]) } + attr_reader :instant_available + + # Attribute for field issuing + sig { returns(Issuing) } + attr_reader :issuing + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property. + sig { returns(T::Array[Pending]) } + attr_reader :pending + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/balance_transaction.rbi b/rbi/stripe/resources/balance_transaction.rbi new file mode 100644 index 000000000..13894f289 --- /dev/null +++ b/rbi/stripe/resources/balance_transaction.rbi @@ -0,0 +1,90 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Balance transactions represent funds moving through your Stripe account. + # Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. + # + # Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) + class BalanceTransaction < APIResource + class FeeDetail < Stripe::StripeObject + # Amount of the fee, in cents. + sig { returns(Integer) } + attr_reader :amount + # ID of the Connect application that earned the fee. + sig { returns(T.nilable(String)) } + attr_reader :application + # 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). + sig { returns(String) } + attr_reader :currency + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + # Type of the fee, one of: `application_fee`, `payment_method_passthrough_fee`, `stripe_fee` or `tax`. + sig { returns(String) } + attr_reader :type + end + # Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party. + sig { returns(Integer) } + attr_reader :amount + + # The date that the transaction's net funds become available in the Stripe balance. + sig { returns(Integer) } + attr_reader :available_on + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. + sig { returns(T.nilable(Float)) } + attr_reader :exchange_rate + + # Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. + sig { returns(Integer) } + attr_reader :fee + + # Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. + sig { returns(T::Array[FeeDetail]) } + attr_reader :fee_details + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by `amount` - `fee` + sig { returns(Integer) } + attr_reader :net + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. + sig { returns(String) } + attr_reader :reporting_category + + # This transaction relates to the Stripe object. + sig { + returns(T.nilable(T.any(String, T.any(Stripe::ApplicationFee, Stripe::Charge, Stripe::ConnectCollectionTransfer, Stripe::CustomerCashBalanceTransaction, Stripe::Dispute, Stripe::ApplicationFeeRefund, Stripe::Issuing::Authorization, Stripe::Issuing::Dispute, Stripe::Issuing::Transaction, Stripe::Payout, Stripe::Refund, Stripe::ReserveTransaction, Stripe::TaxDeductedAtSource, Stripe::Topup, Stripe::Transfer, Stripe::Reversal)))) + } + attr_reader :source + + # The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. + sig { returns(String) } + attr_reader :status + + # Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `issuing_authorization_hold`, `issuing_authorization_release`, `issuing_dispute`, `issuing_transaction`, `obligation_outbound`, `obligation_reversal_inbound`, `payment`, `payment_failure_refund`, `payment_network_reserve_hold`, `payment_network_reserve_release`, `payment_refund`, `payment_reversal`, `payment_unreconciled`, `payout`, `payout_cancel`, `payout_failure`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/bank_account.rbi b/rbi/stripe/resources/bank_account.rbi new file mode 100644 index 000000000..2bab2b54a --- /dev/null +++ b/rbi/stripe/resources/bank_account.rbi @@ -0,0 +1,146 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # These bank accounts are payment methods on `Customer` objects. + # + # On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer + # destinations on `Account` objects for connected accounts. + # They can be bank accounts or debit cards as well, and are documented in the links above. + # + # Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) + class BankAccount < APIResource + class FutureRequirements < Stripe::StripeObject + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T.nilable(T::Array[Error])) } + attr_reader :errors + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pending_verification + end + class Requirements < Stripe::StripeObject + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T.nilable(T::Array[Error])) } + attr_reader :errors + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :pending_verification + end + # The ID of the account that the bank account is associated with. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :account + + # The name of the person or business that owns the bank account. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_name + + # The type of entity that holds the account. This can be either `individual` or `company`. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + + # The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. + sig { returns(T.nilable(String)) } + attr_reader :account_type + + # A set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :available_payout_methods + + # Name of the bank associated with the routing number (e.g., `WELLS FARGO`). + sig { returns(T.nilable(String)) } + attr_reader :bank_name + + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(String) } + attr_reader :country + + # Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. + sig { returns(String) } + attr_reader :currency + + # The ID of the customer that the bank account is associated with. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # Whether this bank account is the default external account for its currency. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :default_for_currency + + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + + # Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + sig { returns(T.nilable(FutureRequirements)) } + attr_reader :future_requirements + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The last four digits of the bank account number. + sig { returns(String) } + attr_reader :last4 + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Information about the requirements for the bank account, including what information needs to be collected. + sig { returns(T.nilable(Requirements)) } + attr_reader :requirements + + # The routing transit number for the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + + # For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. + # + # For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. + sig { returns(String) } + attr_reader :status + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/alert.rbi b/rbi/stripe/resources/billing/alert.rbi new file mode 100644 index 000000000..2d57f7eb5 --- /dev/null +++ b/rbi/stripe/resources/billing/alert.rbi @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. + class Alert < APIResource + class UsageThreshold < Stripe::StripeObject + class Filter < Stripe::StripeObject + # Limit the scope of the alert to this customer ID + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + # Attribute for field type + sig { returns(String) } + attr_reader :type + end + # The filters allow limiting the scope of this usage alert. You can only specify up to one filter at this time. + sig { returns(T.nilable(T::Array[Filter])) } + attr_reader :filters + # The value at which this alert will trigger. + sig { returns(Integer) } + attr_reader :gte + # The [Billing Meter](/api/billing/meter) ID whose usage is monitored. + sig { returns(T.any(String, Stripe::Billing::Meter)) } + attr_reader :meter + # Defines how the alert will behave. + sig { returns(String) } + attr_reader :recurrence + end + # Defines the type of the alert. + sig { returns(String) } + attr_reader :alert_type + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Status of the alert. This can be active, inactive or archived. + sig { returns(T.nilable(String)) } + attr_reader :status + + # Title of the alert. + sig { returns(String) } + attr_reader :title + + # Encapsulates configuration of the alert to monitor usage on a specific [Billing Meter](https://stripe.com/docs/api/billing/meter). + sig { returns(T.nilable(UsageThreshold)) } + attr_reader :usage_threshold + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/alert_triggered.rbi b/rbi/stripe/resources/billing/alert_triggered.rbi new file mode 100644 index 000000000..7b7001aeb --- /dev/null +++ b/rbi/stripe/resources/billing/alert_triggered.rbi @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + class AlertTriggered < APIResource + # A billing alert is a resource that notifies you when a certain usage threshold on a meter is crossed. For example, you might create a billing alert to notify you when a certain user made 100 API requests. + sig { returns(Stripe::Billing::Alert) } + attr_reader :alert + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # ID of customer for which the alert triggered + sig { returns(String) } + attr_reader :customer + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The value triggering the alert + sig { returns(Integer) } + attr_reader :value + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/credit_balance_summary.rbi b/rbi/stripe/resources/billing/credit_balance_summary.rbi new file mode 100644 index 000000000..aa725e4b7 --- /dev/null +++ b/rbi/stripe/resources/billing/credit_balance_summary.rbi @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # Indicates the billing credit balance for billing credits granted to a customer. + class CreditBalanceSummary < SingletonAPIResource + class Balance < Stripe::StripeObject + class AvailableBalance < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount. + sig { returns(Integer) } + attr_reader :value + end + # The monetary amount. + sig { returns(T.nilable(Monetary)) } + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + sig { returns(String) } + attr_reader :type + end + class LedgerBalance < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount. + sig { returns(Integer) } + attr_reader :value + end + # The monetary amount. + sig { returns(T.nilable(Monetary)) } + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + sig { returns(String) } + attr_reader :type + end + # Attribute for field available_balance + sig { returns(AvailableBalance) } + attr_reader :available_balance + # Attribute for field ledger_balance + sig { returns(LedgerBalance) } + attr_reader :ledger_balance + end + # The billing credit balances. One entry per credit grant currency. If a customer only has credit grants in a single currency, then this will have a single balance entry. + sig { returns(T::Array[Balance]) } + attr_reader :balances + + # The customer the balance is for. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/credit_balance_transaction.rbi b/rbi/stripe/resources/billing/credit_balance_transaction.rbi new file mode 100644 index 000000000..9ba46310a --- /dev/null +++ b/rbi/stripe/resources/billing/credit_balance_transaction.rbi @@ -0,0 +1,109 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A credit balance transaction is a resource representing a transaction (either a credit or a debit) against an existing credit grant. + class CreditBalanceTransaction < APIResource + class Credit < Stripe::StripeObject + class Amount < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount. + sig { returns(Integer) } + attr_reader :value + end + # The monetary amount. + sig { returns(T.nilable(Monetary)) } + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + sig { returns(String) } + attr_reader :type + end + # Attribute for field amount + sig { returns(Amount) } + attr_reader :amount + # The type of credit transaction. + sig { returns(String) } + attr_reader :type + end + class Debit < Stripe::StripeObject + class Amount < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount. + sig { returns(Integer) } + attr_reader :value + end + # The monetary amount. + sig { returns(T.nilable(Monetary)) } + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + sig { returns(String) } + attr_reader :type + end + class CreditsApplied < Stripe::StripeObject + # The invoice to which the billing credits were applied. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + # The invoice line item to which the billing credits were applied. + sig { returns(String) } + attr_reader :invoice_line_item + end + # Attribute for field amount + sig { returns(Amount) } + attr_reader :amount + # Details of how the billing credits were applied to an invoice. Only present if `type` is `credits_applied`. + sig { returns(T.nilable(CreditsApplied)) } + attr_reader :credits_applied + # The type of debit transaction. + sig { returns(String) } + attr_reader :type + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Credit details for this credit balance transaction. Only present if type is `credit`. + sig { returns(T.nilable(Credit)) } + attr_reader :credit + + # The credit grant associated with this credit balance transaction. + sig { returns(T.any(String, Stripe::Billing::CreditGrant)) } + attr_reader :credit_grant + + # Debit details for this credit balance transaction. Only present if type is `debit`. + sig { returns(T.nilable(Debit)) } + attr_reader :debit + + # The effective time of this credit balance transaction. + sig { returns(Integer) } + attr_reader :effective_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the test clock this credit balance transaction belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # The type of credit balance transaction (credit or debit). + sig { returns(T.nilable(String)) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/credit_grant.rbi b/rbi/stripe/resources/billing/credit_grant.rbi new file mode 100644 index 000000000..75b207599 --- /dev/null +++ b/rbi/stripe/resources/billing/credit_grant.rbi @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A credit grant is an API resource that documents the allocation of some billing credits to a customer. + # + # Related guide: [Billing credits](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits) + class CreditGrant < APIResource + class Amount < Stripe::StripeObject + class Monetary < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount. + sig { returns(Integer) } + attr_reader :value + end + # The monetary amount. + sig { returns(T.nilable(Monetary)) } + attr_reader :monetary + # The type of this amount. We currently only support `monetary` billing credits. + sig { returns(String) } + attr_reader :type + end + class ApplicabilityConfig < Stripe::StripeObject + class Scope < Stripe::StripeObject + # The price type for which credit grants can apply. We currently only support the `metered` price type. This refers to prices that have a [Billing Meter](https://docs.stripe.com/api/billing/meter) attached to them. + sig { returns(String) } + attr_reader :price_type + end + # Attribute for field scope + sig { returns(Scope) } + attr_reader :scope + end + # Attribute for field amount + sig { returns(Amount) } + attr_reader :amount + + # Attribute for field applicability_config + sig { returns(ApplicabilityConfig) } + attr_reader :applicability_config + + # The category of this credit grant. This is for tracking purposes and isn't displayed to the customer. + sig { returns(String) } + attr_reader :category + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # ID of the customer receiving the billing credits. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # The time when the billing credits become effective—when they're eligible for use. + sig { returns(T.nilable(Integer)) } + attr_reader :effective_at + + # The time when the billing credits expire. If not present, the billing credits don't expire. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # A descriptive name shown in dashboard. + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the test clock this credit grant belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + + # The time when this credit grant was voided. If not present, the credit grant hasn't been voided. + sig { returns(T.nilable(Integer)) } + attr_reader :voided_at + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/meter.rbi b/rbi/stripe/resources/billing/meter.rbi new file mode 100644 index 000000000..1541e2fef --- /dev/null +++ b/rbi/stripe/resources/billing/meter.rbi @@ -0,0 +1,87 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make. + # + # Related guide: [Usage based billing](https://docs.stripe.com/billing/subscriptions/usage-based) + class Meter < APIResource + class CustomerMapping < Stripe::StripeObject + # The key in the meter event payload to use for mapping the event to a customer. + sig { returns(String) } + attr_reader :event_payload_key + # The method for mapping a meter event to a customer. + sig { returns(String) } + attr_reader :type + end + class DefaultAggregation < Stripe::StripeObject + # Specifies how events are aggregated. + sig { returns(String) } + attr_reader :formula + end + class StatusTransitions < Stripe::StripeObject + # The time the meter was deactivated, if any. Measured in seconds since Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :deactivated_at + end + class ValueSettings < Stripe::StripeObject + # The key in the meter event payload to use as the value for this meter. + sig { returns(String) } + attr_reader :event_payload_key + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Attribute for field customer_mapping + sig { returns(CustomerMapping) } + attr_reader :customer_mapping + + # Attribute for field default_aggregation + sig { returns(DefaultAggregation) } + attr_reader :default_aggregation + + # The meter's name. + sig { returns(String) } + attr_reader :display_name + + # The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. + sig { returns(String) } + attr_reader :event_name + + # The time window to pre-aggregate meter events for, if any. + sig { returns(T.nilable(String)) } + attr_reader :event_time_window + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The meter's status. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + + # Attribute for field value_settings + sig { returns(ValueSettings) } + attr_reader :value_settings + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/meter_error_report.rbi b/rbi/stripe/resources/billing/meter_error_report.rbi new file mode 100644 index 000000000..e20386130 --- /dev/null +++ b/rbi/stripe/resources/billing/meter_error_report.rbi @@ -0,0 +1,77 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + class MeterErrorReport < APIResource + class Reason < Stripe::StripeObject + class ErrorType < Stripe::StripeObject + class SampleError < Stripe::StripeObject + class ApiRequest < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + # idempotency_key of the request + sig { returns(String) } + attr_reader :idempotency_key + end + # Attribute for field api_request + sig { returns(T.nilable(ApiRequest)) } + attr_reader :api_request + # message of the error + sig { returns(String) } + attr_reader :error_message + end + # Attribute for field sample_errors + sig { returns(T::Array[SampleError]) } + attr_reader :sample_errors + end + # The number of errors generated + sig { returns(Integer) } + attr_reader :error_count + # More information about errors + sig { returns(T::Array[ErrorType]) } + attr_reader :error_types + end + class RelatedObject < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + # The type of meter error related object. Should be 'meter' + sig { returns(String) } + attr_reader :object + # The url of the meter object + sig { returns(String) } + attr_reader :url + end + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field reason + sig { returns(Reason) } + attr_reader :reason + + # The related objects about the error + sig { returns(T.nilable(RelatedObject)) } + attr_reader :related_object + + # Summary of invalid events + sig { returns(String) } + attr_reader :summary + + # Time when validation ended. Measured in seconds since the Unix epoch + sig { returns(Integer) } + attr_reader :validation_end + + # Time when validation started. Measured in seconds since the Unix epoch + sig { returns(Integer) } + attr_reader :validation_start + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/meter_event.rbi b/rbi/stripe/resources/billing/meter_event.rbi new file mode 100644 index 000000000..cf08b8ee4 --- /dev/null +++ b/rbi/stripe/resources/billing/meter_event.rbi @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage. + # Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing. + class MeterEvent < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + sig { returns(String) } + attr_reader :event_name + + # A unique identifier for the event. + sig { returns(String) } + attr_reader :identifier + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). + sig { returns(T::Hash[String, String]) } + attr_reader :payload + + # The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :timestamp + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/meter_event_adjustment.rbi b/rbi/stripe/resources/billing/meter_event_adjustment.rbi new file mode 100644 index 000000000..0d161a986 --- /dev/null +++ b/rbi/stripe/resources/billing/meter_event_adjustment.rbi @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer. + class MeterEventAdjustment < APIResource + class Cancel < Stripe::StripeObject + # Unique identifier for the event. + sig { returns(T.nilable(String)) } + attr_reader :identifier + end + # Specifies which event to cancel. + sig { returns(T.nilable(Cancel)) } + attr_reader :cancel + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + sig { returns(String) } + attr_reader :event_name + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The meter event adjustment's status. + sig { returns(String) } + attr_reader :status + + # Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing/meter_event_summary.rbi b/rbi/stripe/resources/billing/meter_event_summary.rbi new file mode 100644 index 000000000..da5261089 --- /dev/null +++ b/rbi/stripe/resources/billing/meter_event_summary.rbi @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Billing + # A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much + # usage was accrued by a customer for that period. + class MeterEventSummary < APIResource + # Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. + sig { returns(Float) } + attr_reader :aggregated_value + + # End timestamp for this event summary (exclusive). Must be aligned with minute boundaries. + sig { returns(Integer) } + attr_reader :end_time + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The meter associated with this event summary. + sig { returns(String) } + attr_reader :meter + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Start timestamp for this event summary (inclusive). Must be aligned with minute boundaries. + sig { returns(Integer) } + attr_reader :start_time + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing_portal/configuration.rbi b/rbi/stripe/resources/billing_portal/configuration.rbi new file mode 100644 index 000000000..fe59b6d41 --- /dev/null +++ b/rbi/stripe/resources/billing_portal/configuration.rbi @@ -0,0 +1,175 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module BillingPortal + # A portal configuration describes the functionality and behavior of a portal session. + class Configuration < APIResource + class BusinessProfile < Stripe::StripeObject + # The messaging shown to customers in the portal. + sig { returns(T.nilable(String)) } + attr_reader :headline + # A link to the business’s publicly available privacy policy. + sig { returns(T.nilable(String)) } + attr_reader :privacy_policy_url + # A link to the business’s publicly available terms of service. + sig { returns(T.nilable(String)) } + attr_reader :terms_of_service_url + end + class Features < Stripe::StripeObject + class CustomerUpdate < Stripe::StripeObject + # The types of customer updates that are supported. When empty, customers are not updateable. + sig { returns(T::Array[String]) } + attr_reader :allowed_updates + # Whether the feature is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + end + class InvoiceHistory < Stripe::StripeObject + # Whether the feature is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + end + class PaymentMethodUpdate < Stripe::StripeObject + # Whether the feature is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + end + class SubscriptionCancel < Stripe::StripeObject + class CancellationReason < Stripe::StripeObject + # Whether the feature is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Which cancellation reasons will be given as options to the customer. + sig { returns(T::Array[String]) } + attr_reader :options + end + # Attribute for field cancellation_reason + sig { returns(CancellationReason) } + attr_reader :cancellation_reason + # Whether the feature is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # Whether to cancel subscriptions immediately or at the end of the billing period. + sig { returns(String) } + attr_reader :mode + # Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`. + sig { returns(String) } + attr_reader :proration_behavior + end + class SubscriptionUpdate < Stripe::StripeObject + class Product < Stripe::StripeObject + # The list of price IDs which, when subscribed to, a subscription can be updated. + sig { returns(T::Array[String]) } + attr_reader :prices + # The product ID. + sig { returns(String) } + attr_reader :product + end + class ScheduleAtPeriodEnd < Stripe::StripeObject + class Condition < Stripe::StripeObject + # The type of condition. + sig { returns(String) } + attr_reader :type + end + # List of conditions. When any condition is true, an update will be scheduled at the end of the current period. + sig { returns(T::Array[Condition]) } + attr_reader :conditions + end + # The types of subscription updates that are supported for items listed in the `products` attribute. When empty, subscriptions are not updateable. + sig { returns(T::Array[String]) } + attr_reader :default_allowed_updates + # Whether the feature is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # The list of up to 10 products that support subscription updates. + sig { returns(T.nilable(T::Array[Product])) } + attr_reader :products + # Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. + sig { returns(String) } + attr_reader :proration_behavior + # Attribute for field schedule_at_period_end + sig { returns(ScheduleAtPeriodEnd) } + attr_reader :schedule_at_period_end + end + # Attribute for field customer_update + sig { returns(CustomerUpdate) } + attr_reader :customer_update + # Attribute for field invoice_history + sig { returns(InvoiceHistory) } + attr_reader :invoice_history + # Attribute for field payment_method_update + sig { returns(PaymentMethodUpdate) } + attr_reader :payment_method_update + # Attribute for field subscription_cancel + sig { returns(SubscriptionCancel) } + attr_reader :subscription_cancel + # Attribute for field subscription_update + sig { returns(SubscriptionUpdate) } + attr_reader :subscription_update + end + class LoginPage < Stripe::StripeObject + # If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. + # + # If `false`, the previously generated `url`, if any, will be deactivated. + sig { returns(T::Boolean) } + attr_reader :enabled + # A shareable URL to the hosted portal login page. Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. + sig { returns(T.nilable(String)) } + attr_reader :url + end + # Whether the configuration is active and can be used to create portal sessions. + sig { returns(T::Boolean) } + attr_reader :active + + # ID of the Connect Application that created the configuration. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # Attribute for field business_profile + sig { returns(BusinessProfile) } + attr_reader :business_profile + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. + sig { returns(T.nilable(String)) } + attr_reader :default_return_url + + # Attribute for field features + sig { returns(Features) } + attr_reader :features + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Whether the configuration is the default. If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + sig { returns(T::Boolean) } + attr_reader :is_default + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Attribute for field login_page + sig { returns(LoginPage) } + attr_reader :login_page + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/billing_portal/session.rbi b/rbi/stripe/resources/billing_portal/session.rbi new file mode 100644 index 000000000..814823afa --- /dev/null +++ b/rbi/stripe/resources/billing_portal/session.rbi @@ -0,0 +1,161 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module BillingPortal + # The Billing customer portal is a Stripe-hosted UI for subscription and + # billing management. + # + # A portal configuration describes the functionality and features that you + # want to provide to your customers through the portal. + # + # A portal session describes the instantiation of the customer portal for + # a particular customer. By visiting the session's URL, the customer + # can manage their subscriptions and billing details. For security reasons, + # sessions are short-lived and will expire if the customer does not visit the URL. + # Create sessions on-demand when customers intend to manage their subscriptions + # and billing details. + # + # Related guide: [Customer management](https://stripe.com/customer-management) + class Session < APIResource + class Flow < Stripe::StripeObject + class AfterCompletion < Stripe::StripeObject + class HostedConfirmation < Stripe::StripeObject + # A custom message to display to the customer after the flow is completed. + sig { returns(T.nilable(String)) } + attr_reader :custom_message + end + class Redirect < Stripe::StripeObject + # The URL the customer will be redirected to after the flow is completed. + sig { returns(String) } + attr_reader :return_url + end + # Configuration when `after_completion.type=hosted_confirmation`. + sig { returns(T.nilable(HostedConfirmation)) } + attr_reader :hosted_confirmation + # Configuration when `after_completion.type=redirect`. + sig { returns(T.nilable(Redirect)) } + attr_reader :redirect + # The specified type of behavior after the flow is completed. + sig { returns(String) } + attr_reader :type + end + class SubscriptionCancel < Stripe::StripeObject + class Retention < Stripe::StripeObject + class CouponOffer < Stripe::StripeObject + # The ID of the coupon to be offered. + sig { returns(String) } + attr_reader :coupon + end + # Configuration when `retention.type=coupon_offer`. + sig { returns(T.nilable(CouponOffer)) } + attr_reader :coupon_offer + # Type of retention strategy that will be used. + sig { returns(String) } + attr_reader :type + end + # Specify a retention strategy to be used in the cancellation flow. + sig { returns(T.nilable(Retention)) } + attr_reader :retention + # The ID of the subscription to be canceled. + sig { returns(String) } + attr_reader :subscription + end + class SubscriptionUpdate < Stripe::StripeObject + # The ID of the subscription to be updated. + sig { returns(String) } + attr_reader :subscription + end + class SubscriptionUpdateConfirm < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The ID of the coupon to apply to this subscription update. + sig { returns(T.nilable(String)) } + attr_reader :coupon + # The ID of a promotion code to apply to this subscription update. + sig { returns(T.nilable(String)) } + attr_reader :promotion_code + end + class Item < Stripe::StripeObject + # The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. + sig { returns(T.nilable(String)) } + attr_reader :id + # The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). + sig { returns(T.nilable(String)) } + attr_reader :price + # [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. + sig { returns(Integer) } + attr_reader :quantity + end + # The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. + sig { returns(T.nilable(T::Array[Discount])) } + attr_reader :discounts + # The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. Currently, only up to one may be specified and subscriptions with multiple items are not updatable. + sig { returns(T::Array[Item]) } + attr_reader :items + # The ID of the subscription to be updated. + sig { returns(String) } + attr_reader :subscription + end + # Attribute for field after_completion + sig { returns(AfterCompletion) } + attr_reader :after_completion + # Configuration when `flow.type=subscription_cancel`. + sig { returns(T.nilable(SubscriptionCancel)) } + attr_reader :subscription_cancel + # Configuration when `flow.type=subscription_update`. + sig { returns(T.nilable(SubscriptionUpdate)) } + attr_reader :subscription_update + # Configuration when `flow.type=subscription_update_confirm`. + sig { returns(T.nilable(SubscriptionUpdateConfirm)) } + attr_reader :subscription_update_confirm + # Type of flow that the customer will go through. + sig { returns(String) } + attr_reader :type + end + # The configuration used by this session, describing the features available. + sig { returns(T.any(String, Stripe::BillingPortal::Configuration)) } + attr_reader :configuration + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The ID of the customer for this session. + sig { returns(String) } + attr_reader :customer + + # Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. + sig { returns(T.nilable(Flow)) } + attr_reader :flow + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer’s `preferred_locales` or browser’s locale is used. + sig { returns(T.nilable(String)) } + attr_reader :locale + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. + sig { returns(T.nilable(String)) } + attr_reader :on_behalf_of + + # The URL to redirect customers to when they click on the portal's link to return to your website. + sig { returns(T.nilable(String)) } + attr_reader :return_url + + # The short-lived URL of the session that gives customers access to the customer portal. + sig { returns(String) } + attr_reader :url + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/capability.rbi b/rbi/stripe/resources/capability.rbi new file mode 100644 index 000000000..8c0dd5e0c --- /dev/null +++ b/rbi/stripe/resources/capability.rbi @@ -0,0 +1,132 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # This is an object representing a capability for a Stripe account. + # + # Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities) + class Capability < APIResource + class FutureRequirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :original_fields_due + end + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + sig { returns(T.nilable(T::Array[Alternative])) } + attr_reader :alternatives + # Date on which `future_requirements` becomes the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. + sig { returns(T.nilable(Integer)) } + attr_reader :current_deadline + # Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. + sig { returns(T::Array[String]) } + attr_reader :currently_due + # This is typed as an enum for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is null because fields in `future_requirements` will never disable the account. + sig { returns(T.nilable(String)) } + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T::Array[Error]) } + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. + sig { returns(T::Array[String]) } + attr_reader :eventually_due + # Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + sig { returns(T::Array[String]) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T::Array[String]) } + attr_reader :pending_verification + end + class Requirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :original_fields_due + end + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + sig { returns(T.nilable(T::Array[Alternative])) } + attr_reader :alternatives + # Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. These fields may disable the capability sooner if the next threshold is reached before they are collected. + sig { returns(T.nilable(Integer)) } + attr_reader :current_deadline + # Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. + sig { returns(T::Array[String]) } + attr_reader :currently_due + # Description of why the capability is disabled. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). + sig { returns(T.nilable(String)) } + attr_reader :disabled_reason + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T::Array[Error]) } + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. + sig { returns(T::Array[String]) } + attr_reader :eventually_due + # Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the capability on the account. + sig { returns(T::Array[String]) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T::Array[String]) } + attr_reader :pending_verification + end + # The account for which the capability enables functionality. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + + # Attribute for field future_requirements + sig { returns(FutureRequirements) } + attr_reader :future_requirements + + # The identifier for the capability. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Whether the capability has been requested. + sig { returns(T::Boolean) } + attr_reader :requested + + # Time at which the capability was requested. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :requested_at + + # Attribute for field requirements + sig { returns(Requirements) } + attr_reader :requirements + + # The status of the capability. + sig { returns(String) } + attr_reader :status + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/capital/financing_offer.rbi b/rbi/stripe/resources/capital/financing_offer.rbi new file mode 100644 index 000000000..632e79db3 --- /dev/null +++ b/rbi/stripe/resources/capital/financing_offer.rbi @@ -0,0 +1,121 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Capital + # This is an object representing an offer of financing from + # Stripe Capital to a Connect subaccount. + class FinancingOffer < APIResource + class AcceptedTerms < Stripe::StripeObject + # Amount of financing offered, in minor units. + sig { returns(Integer) } + attr_reader :advance_amount + # Currency that the financing offer is transacted in. For example, `usd`. + sig { returns(String) } + attr_reader :currency + # Fixed fee amount, in minor units. + sig { returns(Integer) } + attr_reader :fee_amount + # Populated when the `product_type` of the `financingoffer` is `refill`. + # Represents the discount amount on remaining premium for the existing loan at payout time. + sig { returns(T.nilable(Integer)) } + attr_reader :previous_financing_fee_discount_amount + # Per-transaction rate at which Stripe will withhold funds to repay the financing. + sig { returns(Float) } + attr_reader :withhold_rate + end + class OfferedTerms < Stripe::StripeObject + # Amount of financing offered, in minor units. + sig { returns(Integer) } + attr_reader :advance_amount + # Describes the type of user the offer is being extended to. + sig { returns(String) } + attr_reader :campaign_type + # Currency that the financing offer is transacted in. For example, `usd`. + sig { returns(String) } + attr_reader :currency + # Fixed fee amount, in minor units. + sig { returns(Integer) } + attr_reader :fee_amount + # Populated when the `product_type` of the `financingoffer` is `refill`. + # Represents the discount rate percentage on remaining fee on the existing loan. When the `financing_offer` + # is paid out, the `previous_financing_fee_discount_amount` will be computed as the multiple of this rate + # and the remaining fee. + sig { returns(T.nilable(Float)) } + attr_reader :previous_financing_fee_discount_rate + # Per-transaction rate at which Stripe will withhold funds to repay the financing. + sig { returns(Float) } + attr_reader :withhold_rate + end + # This is an object representing the terms of an offer of financing from + # Stripe Capital to a Connected account. This resource represents + # the terms accepted by the Connected account, which may differ from those + # offered. + sig { returns(AcceptedTerms) } + attr_reader :accepted_terms + + # The ID of the merchant associated with this financing object. + sig { returns(String) } + attr_reader :account + + # The time at which this financing offer was charged off, if applicable. Given in seconds since unix epoch. + sig { returns(Integer) } + attr_reader :charged_off_at + + # Time at which the offer was created. Given in seconds since unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Time at which the offer expires. Given in seconds since unix epoch. + sig { returns(Float) } + attr_reader :expires_after + + # The type of financing being offered. + sig { returns(String) } + attr_reader :financing_type + + # A unique identifier for the financing object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The object type: financing_offer. + sig { returns(String) } + attr_reader :object + + # This is an object representing the terms of an offer of financing from + # Stripe Capital to a Connected account. This resource represents + # both the terms offered to the Connected account. + sig { returns(OfferedTerms) } + attr_reader :offered_terms + + # Financing product identifier. + sig { returns(String) } + attr_reader :product_type + + # The ID of the financing offer that replaced this offer. + sig { returns(String) } + attr_reader :replacement + + # The ID of the financing offer that this offer is a replacement for. + sig { returns(String) } + attr_reader :replacement_for + + # The current status of the offer. + sig { returns(String) } + attr_reader :status + + # See [financing_type](https://stripe.com/docs/api/capital/connect_financing_object#financing_offer_object-financing_type). + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/capital/financing_summary.rbi b/rbi/stripe/resources/capital/financing_summary.rbi new file mode 100644 index 000000000..e4bf1301c --- /dev/null +++ b/rbi/stripe/resources/capital/financing_summary.rbi @@ -0,0 +1,70 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Capital + # A financing object describes an account's current financing state. Used by Connect + # platforms to read the state of Capital offered to their connected accounts. + class FinancingSummary < SingletonAPIResource + class Details < Stripe::StripeObject + class CurrentRepaymentInterval < Stripe::StripeObject + # The time at which the minimum payment amount will be due. If not met through withholding, the Connected account's linked bank account or account balance will be debited. + # Given in seconds since unix epoch. + sig { returns(Integer) } + attr_reader :due_at + # The amount that has already been paid in the current repayment interval. + sig { returns(T.nilable(Integer)) } + attr_reader :paid_amount + # The amount that is yet to be paid in the current repayment interval. + sig { returns(Integer) } + attr_reader :remaining_amount + end + # Amount of financing offered, in minor units. + sig { returns(Integer) } + attr_reader :advance_amount + # The time at which the funds were paid out to the connected account's Stripe balance. Given in milliseconds since unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :advance_paid_out_at + # Currency that the financing offer is transacted in. For example, `usd`. + sig { returns(String) } + attr_reader :currency + # The chronologically current repayment interval for the financing offer. + sig { returns(T.nilable(CurrentRepaymentInterval)) } + attr_reader :current_repayment_interval + # Fixed fee amount, in minor units. + sig { returns(Integer) } + attr_reader :fee_amount + # The amount the Connected account has paid toward the financing debt so far. + sig { returns(Integer) } + attr_reader :paid_amount + # The balance remaining to be paid on the financing, in minor units. + sig { returns(Integer) } + attr_reader :remaining_amount + # The time at which Capital will begin withholding from payments. Given in seconds since unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :repayments_begin_at + # Per-transaction rate at which Stripe will withhold funds to repay the financing. + sig { returns(Float) } + attr_reader :withhold_rate + end + # Additional information about the financing summary. Describes currency, advance amount, + # fee amount, withhold rate, remaining amount, paid amount, current repayment interval, + # repayment start date, and advance payout date. + sig { returns(T.nilable(Details)) } + attr_reader :details + + # The Financing Offer ID this Financing Summary corresponds to + sig { returns(T.nilable(String)) } + attr_reader :financing_offer + + # The object type: financing_summary + sig { returns(String) } + attr_reader :object + + # Status of the Connected Account's financing. [/v1/capital/financing_summary](https://stripe.com/docs/api/capital/financing_summary) will only return `details` for `paid_out` financing. + sig { returns(T.nilable(String)) } + attr_reader :status + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/capital/financing_transaction.rbi b/rbi/stripe/resources/capital/financing_transaction.rbi new file mode 100644 index 000000000..befe2657d --- /dev/null +++ b/rbi/stripe/resources/capital/financing_transaction.rbi @@ -0,0 +1,87 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Capital + # This is an object representing the details of a transaction on a Capital financing object. + class FinancingTransaction < APIResource + class Details < Stripe::StripeObject + class Transaction < Stripe::StripeObject + # The linked payment ID. + sig { returns(String) } + attr_reader :charge + # The linked Treasury Financing Transaction ID. + sig { returns(String) } + attr_reader :treasury_transaction + end + # The advance amount being repaid, paid out, or reversed in minor units. + sig { returns(Integer) } + attr_reader :advance_amount + # The currency of the financing transaction. + sig { returns(String) } + attr_reader :currency + # The fee amount being repaid, paid out, or reversed in minor units. + sig { returns(Integer) } + attr_reader :fee_amount + # The linked payment for the transaction. This field only applies to financing transactions of type `paydown` and reason `automatic_withholding`. + sig { returns(String) } + attr_reader :linked_payment + # The reason for the financing transaction (if applicable). + sig { returns(String) } + attr_reader :reason + # The reversed transaction. This field only applies to financing + # transactions of type `reversal`. + sig { returns(String) } + attr_reader :reversed_transaction + # The advance and fee amount being repaid, paid out, or reversed in minor units. + sig { returns(Integer) } + attr_reader :total_amount + # This is an object representing a linked transaction on a Capital Financing Transaction. + sig { returns(Transaction) } + attr_reader :transaction + end + # The ID of the merchant associated with this financing transaction. + sig { returns(String) } + attr_reader :account + + # Time at which the financing transaction was created. Given in seconds since unix epoch. + sig { returns(Integer) } + attr_reader :created_at + + # This is an object representing a transaction on a Capital financing offer. + sig { returns(Details) } + attr_reader :details + + # The Capital financing offer for this financing transaction. + sig { returns(T.nilable(String)) } + attr_reader :financing_offer + + # A unique identifier for the financing transaction object. + sig { returns(String) } + attr_reader :id + + # The Capital transaction object that predates the Financing Transactions API and + # corresponds with the balance transaction that was created as a result of this + # financing transaction. + sig { returns(String) } + attr_reader :legacy_balance_transaction_source + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The object type: financing_transaction + sig { returns(String) } + attr_reader :object + + # The type of the financing transaction. + sig { returns(String) } + attr_reader :type + + # A human-friendly description of the financing transaction. + sig { returns(T.nilable(String)) } + attr_reader :user_facing_description + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/card.rbi b/rbi/stripe/resources/card.rbi new file mode 100644 index 000000000..184537225 --- /dev/null +++ b/rbi/stripe/resources/card.rbi @@ -0,0 +1,151 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # You can store multiple cards on a customer in order to charge the customer + # later. You can also store multiple debit cards on a recipient in order to + # transfer to those cards later. + # + # Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) + class Card < APIResource + class Networks < Stripe::StripeObject + # The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + # The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :account + + # City/District/Suburb/Town/Village. + sig { returns(T.nilable(String)) } + attr_reader :address_city + + # Billing address country, if provided when creating card. + sig { returns(T.nilable(String)) } + attr_reader :address_country + + # Address line 1 (Street address/PO Box/Company name). + sig { returns(T.nilable(String)) } + attr_reader :address_line1 + + # If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + + # Address line 2 (Apartment/Suite/Unit/Building). + sig { returns(T.nilable(String)) } + attr_reader :address_line2 + + # State/County/Province/Region. + sig { returns(T.nilable(String)) } + attr_reader :address_state + + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :address_zip + + # If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_zip_check + + # A set of available payout methods for this card. Only values from this set should be passed as the `method` when creating a payout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :available_payout_methods + + # Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `Girocard`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. + sig { returns(String) } + attr_reader :brand + + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + + # Three-letter [ISO code for currency](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. Must be a [supported currency](https://docs.stripe.com/currencies). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + sig { returns(T.nilable(String)) } + attr_reader :currency + + # The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + + # Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :default_for_currency + + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(String) } + attr_reader :description + + # (For tokenized numbers only.) The last four digits of the device account number. + sig { returns(T.nilable(String)) } + attr_reader :dynamic_last4 + + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(String) } + attr_reader :funding + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(String) } + attr_reader :iin + + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(String) } + attr_reader :issuer + + # The last four digits of the card. + sig { returns(String) } + attr_reader :last4 + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Cardholder name. + sig { returns(T.nilable(String)) } + attr_reader :name + + # Attribute for field networks + sig { returns(Networks) } + attr_reader :networks + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # For external accounts that are cards, possible values are `new` and `errored`. If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated. + sig { returns(T.nilable(String)) } + attr_reader :status + + # If the card number is tokenized, this is the method that was used. Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. + sig { returns(T.nilable(String)) } + attr_reader :tokenization_method + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/cash_balance.rbi b/rbi/stripe/resources/cash_balance.rbi new file mode 100644 index 000000000..a1d7e8170 --- /dev/null +++ b/rbi/stripe/resources/cash_balance.rbi @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. + class CashBalance < APIResource + class Settings < Stripe::StripeObject + # The configuration for how funds that land in the customer cash balance are reconciled. + sig { returns(String) } + attr_reader :reconciliation_mode + # A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance + sig { returns(T::Boolean) } + attr_reader :using_merchant_default + end + # A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(T.nilable(T::Hash[String, Integer])) } + attr_reader :available + + # The ID of the customer whose cash balance this object represents. + sig { returns(String) } + attr_reader :customer + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field settings + sig { returns(Settings) } + attr_reader :settings + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/charge.rbi b/rbi/stripe/resources/charge.rbi new file mode 100644 index 000000000..02e0e3af1 --- /dev/null +++ b/rbi/stripe/resources/charge.rbi @@ -0,0 +1,1742 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # The `Charge` object represents a single attempt to move money into your Stripe account. + # PaymentIntent confirmation is the most common way to create Charges, but transferring + # money to a different Stripe account through Connect also creates Charges. + # Some legacy payment flows create Charges directly, which is not recommended for new integrations. + class Charge < APIResource + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Billing address. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + # Billing phone number (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class FraudDetails < Stripe::StripeObject + # Assessments from Stripe. If set, the value is `fraudulent`. + sig { returns(String) } + attr_reader :stripe_report + # Assessments reported by you. If set, possible values of are `safe` and `fraudulent`. + sig { returns(String) } + attr_reader :user_report + end + class Level3 < Stripe::StripeObject + class LineItem < Stripe::StripeObject + # Attribute for field discount_amount + sig { returns(T.nilable(Integer)) } + attr_reader :discount_amount + # Attribute for field product_code + sig { returns(String) } + attr_reader :product_code + # Attribute for field product_description + sig { returns(String) } + attr_reader :product_description + # Attribute for field quantity + sig { returns(T.nilable(Integer)) } + attr_reader :quantity + # Attribute for field tax_amount + sig { returns(T.nilable(Integer)) } + attr_reader :tax_amount + # Attribute for field unit_cost + sig { returns(T.nilable(Integer)) } + attr_reader :unit_cost + end + # Attribute for field customer_reference + sig { returns(String) } + attr_reader :customer_reference + # Attribute for field line_items + sig { returns(T::Array[LineItem]) } + attr_reader :line_items + # Attribute for field merchant_reference + sig { returns(String) } + attr_reader :merchant_reference + # Attribute for field shipping_address_zip + sig { returns(String) } + attr_reader :shipping_address_zip + # Attribute for field shipping_amount + sig { returns(Integer) } + attr_reader :shipping_amount + # Attribute for field shipping_from_zip + sig { returns(String) } + attr_reader :shipping_from_zip + end + class Outcome < Stripe::StripeObject + class Rule < Stripe::StripeObject + # The action taken on the payment. + sig { returns(String) } + attr_reader :action + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + # The predicate to evaluate the payment against. + sig { returns(String) } + attr_reader :predicate + end + # For charges declined by the network, a 2 digit code which indicates the advice returned by the network on how to proceed with an error. + sig { returns(T.nilable(String)) } + attr_reader :network_advice_code + # For charges declined by the network, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + sig { returns(T.nilable(String)) } + attr_reader :network_decline_code + # Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. + sig { returns(T.nilable(String)) } + attr_reader :network_status + # An enumerated value providing a more detailed explanation of the outcome's `type`. Charges blocked by Radar's default block rule have the value `highest_risk_level`. Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. Charges authorized, blocked, or placed in review by custom rules have the value `rule`. See [understanding declines](https://stripe.com/docs/declines) for more details. + sig { returns(T.nilable(String)) } + attr_reader :reason + # Stripe Radar's evaluation of the riskiness of the payment. Possible values for evaluated payments are `normal`, `elevated`, `highest`. For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. In the event of an error in the evaluation, this field will have the value `unknown`. This field is only available with Radar. + sig { returns(String) } + attr_reader :risk_level + # Stripe Radar's evaluation of the riskiness of the payment. Possible values for evaluated payments are between 0 and 100. For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. This field is only available with Radar for Fraud Teams. + sig { returns(Integer) } + attr_reader :risk_score + # The ID of the Radar rule that matched the payment, if applicable. + sig { returns(T.any(String, Rule)) } + attr_reader :rule + # A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. + sig { returns(T.nilable(String)) } + attr_reader :seller_message + # Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. + sig { returns(String) } + attr_reader :type + end + class PaymentMethodDetails < Stripe::StripeObject + class AchCreditTransfer < Stripe::StripeObject + # Account number to transfer funds to. + sig { returns(T.nilable(String)) } + attr_reader :account_number + # Name of the bank associated with the routing number. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Routing transit number for the bank account to transfer funds to. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + # SWIFT code of the bank associated with the routing number. + sig { returns(T.nilable(String)) } + attr_reader :swift_code + end + class AchDebit < Stripe::StripeObject + # Type of entity that holds the account. This can be either `individual` or `company`. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Routing transit number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + class AcssDebit < Stripe::StripeObject + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Institution number of the bank account + sig { returns(T.nilable(String)) } + attr_reader :institution_number + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(String) } + attr_reader :mandate + # Transit number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :transit_number + end + class Affirm < Stripe::StripeObject + # The Affirm transaction ID associated with this payment. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class AfterpayClearpay < Stripe::StripeObject + # The Afterpay order ID associated with this payment intent. + sig { returns(T.nilable(String)) } + attr_reader :order_id + # Order identifier shown to the merchant in Afterpay’s online portal. + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class Alipay < Stripe::StripeObject + # Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + sig { returns(String) } + attr_reader :buyer_id + # Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Transaction ID of this particular Alipay transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject + class Funding < Stripe::StripeObject + class Card < Stripe::StripeObject + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # Two-digit number representing the card's expiration month. + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # funding type of the underlying payment method. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field funding + sig { returns(Funding) } + attr_reader :funding + end + class AuBecsDebit < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(String) } + attr_reader :mandate + end + class BacsDebit < Stripe::StripeObject + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(T.nilable(String)) } + attr_reader :mandate + # Sort code of the bank account. (e.g., `10-20-30`) + sig { returns(T.nilable(String)) } + attr_reader :sort_code + end + class Bancontact < Stripe::StripeObject + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Preferred language of the Bancontact authorization page that the customer is redirected to. + # Can be one of `en`, `de`, `fr`, or `nl` + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by Bancontact directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class Blik < Stripe::StripeObject + # A unique and immutable identifier assigned by BLIK to every buyer. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + end + class Boleto < Stripe::StripeObject + # The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) + sig { returns(String) } + attr_reader :tax_id + end + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + end + class DecrementalAuthorization < Stripe::StripeObject + # Indicates whether or not the decremental authorization feature is supported. + sig { returns(String) } + attr_reader :status + end + class ExtendedAuthorization < Stripe::StripeObject + # Indicates whether or not the capture window is extended beyond the standard authorization. + sig { returns(String) } + attr_reader :status + end + class IncrementalAuthorization < Stripe::StripeObject + # Indicates whether or not the incremental authorization feature is supported. + sig { returns(String) } + attr_reader :status + end + class Installments < Stripe::StripeObject + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_reader :type + end + # Installment plan selected for the payment. + sig { returns(T.nilable(Plan)) } + attr_reader :plan + end + class Multicapture < Stripe::StripeObject + # Indicates whether or not multiple captures are supported. + sig { returns(String) } + attr_reader :status + end + class NetworkToken < Stripe::StripeObject + # Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. + sig { returns(T::Boolean) } + attr_reader :used + end + class Overcapture < Stripe::StripeObject + # The maximum amount that can be captured. + sig { returns(Integer) } + attr_reader :maximum_amount_capturable + # Indicates whether or not the authorized amount can be over-captured. + sig { returns(String) } + attr_reader :status + end + class PartialAuthorization < Stripe::StripeObject + # Indicates whether the transaction requested for partial authorization feature and the authorization outcome. + sig { returns(String) } + attr_reader :status + end + class ThreeDSecure < Stripe::StripeObject + # For authenticated transactions: how the customer was authenticated by + # the issuing bank. + sig { returns(T.nilable(String)) } + attr_reader :authentication_flow + # The Electronic Commerce Indicator (ECI). A protocol-level field + # indicating what degree of authentication was performed. + sig { returns(T.nilable(String)) } + attr_reader :electronic_commerce_indicator + # The exemption requested via 3DS and accepted by the issuer at authentication time. + sig { returns(T.nilable(String)) } + attr_reader :exemption_indicator + # Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on + # the outcome of Stripe's internal risk assessment. + sig { returns(T::Boolean) } + attr_reader :exemption_indicator_applied + # Indicates the outcome of 3D Secure authentication. + sig { returns(T.nilable(String)) } + attr_reader :result + # Additional information about why 3D Secure succeeded or failed based + # on the `result`. + sig { returns(T.nilable(String)) } + attr_reader :result_reason + # The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + # (dsTransId) for this payment. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + # The version of 3D Secure that was used. + sig { returns(T.nilable(String)) } + attr_reader :version + end + class Wallet < Stripe::StripeObject + class AmexExpressCheckout < Stripe::StripeObject; end + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + class Masterpass < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(BillingAddress)) } + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + class SamsungPay < Stripe::StripeObject; end + class VisaCheckout < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(BillingAddress)) } + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + # Attribute for field amex_express_checkout + sig { returns(AmexExpressCheckout) } + attr_reader :amex_express_checkout + # Attribute for field apple_pay + sig { returns(ApplePay) } + attr_reader :apple_pay + # (For tokenized numbers only.) The last four digits of the device account number. + sig { returns(T.nilable(String)) } + attr_reader :dynamic_last4 + # Attribute for field google_pay + sig { returns(GooglePay) } + attr_reader :google_pay + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field masterpass + sig { returns(Masterpass) } + attr_reader :masterpass + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + sig { returns(String) } + attr_reader :type + # Attribute for field visa_checkout + sig { returns(VisaCheckout) } + attr_reader :visa_checkout + end + # The authorized amount. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_authorized + # The latest amount intended to be authorized by this charge. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_requested + # Authorization code on the charge. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. + sig { returns(Integer) } + attr_reader :capture_before + # Check results by Card networks on Card address and CVC at time of payment. + sig { returns(T.nilable(Checks)) } + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field decremental_authorization + sig { returns(DecrementalAuthorization) } + attr_reader :decremental_authorization + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Attribute for field extended_authorization + sig { returns(ExtendedAuthorization) } + attr_reader :extended_authorization + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # Attribute for field incremental_authorization + sig { returns(IncrementalAuthorization) } + attr_reader :incremental_authorization + # Installment details for this payment (Mexico only). + # + # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + sig { returns(T.nilable(Installments)) } + attr_reader :installments + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment or created by it. + sig { returns(T.nilable(String)) } + attr_reader :mandate + # True if this payment was marked as MOTO and out of scope for SCA. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :moto + # Attribute for field multicapture + sig { returns(Multicapture) } + attr_reader :multicapture + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :network + # If this card has network token credentials, this contains the details of the network token credentials. + sig { returns(T.nilable(NetworkToken)) } + attr_reader :network_token + # Attribute for field overcapture + sig { returns(Overcapture) } + attr_reader :overcapture + # Attribute for field partial_authorization + sig { returns(PartialAuthorization) } + attr_reader :partial_authorization + # Populated if this transaction used 3D Secure authentication. + sig { returns(T.nilable(ThreeDSecure)) } + attr_reader :three_d_secure + # If this Card is part of a card wallet, this contains the details of the card wallet. + sig { returns(T.nilable(Wallet)) } + attr_reader :wallet + end + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + sig { returns(T.nilable(Integer)) } + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + sig { returns(String) } + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + sig { returns(T.nilable(String)) } + attr_reader :application_preferred_name + # Identifier for this transaction. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + sig { returns(T.nilable(String)) } + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + sig { returns(T.nilable(String)) } + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_status_information + end + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + sig { returns(String) } + attr_reader :type + end + # The authorized amount + sig { returns(T.nilable(Integer)) } + attr_reader :amount_authorized + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + sig { returns(T.nilable(String)) } + attr_reader :brand_product + # When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + sig { returns(Integer) } + attr_reader :capture_before + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Authorization response cryptogram. + sig { returns(T.nilable(String)) } + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + sig { returns(T.nilable(String)) } + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + sig { returns(T::Boolean) } + attr_reader :incremental_authorization_supported + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + sig { returns(T.nilable(String)) } + attr_reader :network_transaction_id + # Details about payments collected offline. + sig { returns(T.nilable(Offline)) } + attr_reader :offline + # Defines whether the authorized amount can be over-captured or not + sig { returns(T::Boolean) } + attr_reader :overcapture_supported + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + sig { returns(T.nilable(Receipt)) } + attr_reader :receipt + # Attribute for field wallet + sig { returns(Wallet) } + attr_reader :wallet + end + class Cashapp < Stripe::StripeObject + # A unique and immutable identifier assigned by Cash App to every buyer. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + # A public identifier for buyers using Cash App. + sig { returns(T.nilable(String)) } + attr_reader :cashtag + end + class CustomerBalance < Stripe::StripeObject; end + class Eps < Stripe::StripeObject + # The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + sig { returns(T.nilable(String)) } + attr_reader :bank + # Owner's verified full name. Values are verified or provided by EPS directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + # EPS rarely provides this information so the attribute is usually empty. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class Fpx < Stripe::StripeObject + # Account holder type, if provided. Can be one of `individual` or `company`. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + sig { returns(String) } + attr_reader :bank + # Unique transaction id generated by FPX for every request from the merchant + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class Giropay < Stripe::StripeObject + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bic + # Owner's verified full name. Values are verified or provided by Giropay directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + # Giropay rarely provides this information so the attribute is usually empty. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class Gopay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject + # Unique transaction id generated by GrabPay + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class IdBankTransfer < Stripe::StripeObject + # Account number of the bank account to transfer funds to. + sig { returns(String) } + attr_reader :account_number + # Bank where the account is located. + sig { returns(String) } + attr_reader :bank + # Local bank code of the bank. + sig { returns(String) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(String) } + attr_reader :bank_name + # Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + sig { returns(String) } + attr_reader :display_name + end + class Ideal < Stripe::StripeObject + # The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + sig { returns(T.nilable(String)) } + attr_reader :bank + # The Bank Identifier Code of the customer's bank. + sig { returns(T.nilable(String)) } + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Owner's verified full name. Values are verified or provided by iDEAL directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class InteracPresent < Stripe::StripeObject + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + sig { returns(String) } + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + sig { returns(T.nilable(String)) } + attr_reader :application_preferred_name + # Identifier for this transaction. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + sig { returns(T.nilable(String)) } + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + sig { returns(T.nilable(String)) } + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_status_information + end + # Card brand. Can be `interac`, `mastercard` or `visa`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Authorization response cryptogram. + sig { returns(T.nilable(String)) } + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + sig { returns(T.nilable(String)) } + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + sig { returns(T.nilable(String)) } + attr_reader :network_transaction_id + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + sig { returns(T.nilable(Receipt)) } + attr_reader :receipt + end + class KakaoPay < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + end + class Klarna < Stripe::StripeObject + class PayerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # The payer address country + sig { returns(T.nilable(String)) } + attr_reader :country + end + # The payer's address + sig { returns(T.nilable(Address)) } + attr_reader :address + end + # The payer details for this transaction. + sig { returns(T.nilable(PayerDetails)) } + attr_reader :payer_details + # The Klarna payment method used for this transaction. + # Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` + sig { returns(T.nilable(String)) } + attr_reader :payment_method_category + # Preferred language of the Klarna authorization page that the customer is redirected to. + # Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` + sig { returns(T.nilable(String)) } + attr_reader :preferred_locale + end + class Konbini < Stripe::StripeObject + class Store < Stripe::StripeObject + # The name of the convenience store chain where the payment was completed. + sig { returns(T.nilable(String)) } + attr_reader :chain + end + # If the payment succeeded, this contains the details of the convenience store where the payment was completed. + sig { returns(T.nilable(Store)) } + attr_reader :store + end + class KrCard < Stripe::StripeObject + # The local credit or debit card brand. + sig { returns(T.nilable(String)) } + attr_reader :brand + # A unique identifier for the buyer as determined by the local payment processor. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + # The last four digits of the card. This may not be present for American Express cards. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class Link < Stripe::StripeObject + # Two-letter ISO code representing the funding source country beneath the Link payment. + # You could use this attribute to get a sense of international fees. + sig { returns(T.nilable(String)) } + attr_reader :country + end + class MbWay < Stripe::StripeObject; end + class Mobilepay < Stripe::StripeObject + class Card < Stripe::StripeObject + # Brand of the card used in the transaction + sig { returns(T.nilable(String)) } + attr_reader :brand + # Two-letter ISO code representing the country of the card + sig { returns(T.nilable(String)) } + attr_reader :country + # Two digit number representing the card's expiration month + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Two digit number representing the card's expiration year + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # The last 4 digits of the card + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + # Internal card details + sig { returns(T.nilable(Card)) } + attr_reader :card + end + class Multibanco < Stripe::StripeObject + # Entity number associated with this Multibanco payment. + sig { returns(T.nilable(String)) } + attr_reader :entity + # Reference number associated with this Multibanco payment. + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class NaverPay < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + end + class Oxxo < Stripe::StripeObject + # OXXO reference number + sig { returns(T.nilable(String)) } + attr_reader :number + end + class P24 < Stripe::StripeObject + # The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. + sig { returns(T.nilable(String)) } + attr_reader :bank + # Unique reference for this Przelewy24 payment. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Owner's verified full name. Values are verified or provided by Przelewy24 directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + # Przelewy24 rarely provides this information so the attribute is usually empty. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class Payco < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + end + class Paynow < Stripe::StripeObject + # Reference number associated with this PayNow payment + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class Paypal < Stripe::StripeObject + class SellerProtection < Stripe::StripeObject + # An array of conditions that are covered for the transaction, if applicable. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :dispute_categories + # Indicates whether the transaction is eligible for PayPal's seller protection. + sig { returns(String) } + attr_reader :status + end + class Shipping < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class VerifiedAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's email. Values are provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :payer_email + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + sig { returns(T.nilable(String)) } + attr_reader :payer_id + # Owner's full name. Values provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :payer_name + # The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. + sig { returns(T.nilable(SellerProtection)) } + attr_reader :seller_protection + # The shipping address for the customer, as supplied by the merchant at the point of payment + # execution. This shipping address will not be updated if the merchant updates the shipping + # address on the PaymentIntent after the PaymentIntent was successfully confirmed. + sig { returns(T.nilable(Shipping)) } + attr_reader :shipping + # A unique ID generated by PayPal for this transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + # The shipping address for the customer, as supplied by the merchant at the point of payment + # execution. This shipping address will not be updated if the merchant updates the shipping + # address on the PaymentIntent after the PaymentIntent was successfully confirmed. + sig { returns(T.nilable(VerifiedAddress)) } + attr_reader :verified_address + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_email + # Owner's verified full name. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class Payto < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(String) } + attr_reader :mandate + # The PayID alias for the bank account. + sig { returns(T.nilable(String)) } + attr_reader :pay_id + end + class Pix < Stripe::StripeObject + # Unique transaction id generated by BCB + sig { returns(T.nilable(String)) } + attr_reader :bank_transaction_id + end + class Promptpay < Stripe::StripeObject + # Bill reference generated by PromptPay + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class Qris < Stripe::StripeObject; end + class Rechnung < Stripe::StripeObject; end + class RevolutPay < Stripe::StripeObject + class Funding < Stripe::StripeObject + class Card < Stripe::StripeObject + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # Two-digit number representing the card's expiration month. + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # funding type of the underlying payment method. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field funding + sig { returns(Funding) } + attr_reader :funding + end + class SamsungPay < Stripe::StripeObject + # A unique identifier for the buyer as determined by the local payment processor. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + end + class SepaCreditTransfer < Stripe::StripeObject + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bic + # IBAN of the bank account to transfer funds to. + sig { returns(T.nilable(String)) } + attr_reader :iban + end + class SepaDebit < Stripe::StripeObject + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Branch code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :branch_code + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). + sig { returns(T.nilable(String)) } + attr_reader :mandate + end + class Shopeepay < Stripe::StripeObject; end + class Sofort < Stripe::StripeObject + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bic + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Preferred language of the SOFORT authorization page that the customer is redirected to. + # Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by SOFORT directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class StripeAccount < Stripe::StripeObject; end + class Swish < Stripe::StripeObject + # Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Payer bank reference number for the payment + sig { returns(T.nilable(String)) } + attr_reader :payment_reference + # The last four digits of the Swish account phone number + sig { returns(T.nilable(String)) } + attr_reader :verified_phone_last4 + end + class Twint < Stripe::StripeObject; end + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(T.any(String, Stripe::Mandate)) } + attr_reader :mandate + # Reference number to locate ACH payments with customer's bank. + sig { returns(T.nilable(String)) } + attr_reader :payment_reference + # Routing number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + class Wechat < Stripe::StripeObject; end + class WechatPay < Stripe::StripeObject + # Uniquely identifies this particular WeChat Pay account. You can use this attribute to check whether two WeChat accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Transaction ID of this particular WeChat Pay transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class Zip < Stripe::StripeObject; end + # Attribute for field ach_credit_transfer + sig { returns(AchCreditTransfer) } + attr_reader :ach_credit_transfer + # Attribute for field ach_debit + sig { returns(AchDebit) } + attr_reader :ach_debit + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + # Attribute for field alma + sig { returns(Alma) } + attr_reader :alma + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + # Attribute for field blik + sig { returns(Blik) } + attr_reader :blik + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + # Attribute for field fpx + sig { returns(Fpx) } + attr_reader :fpx + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + # Attribute for field gopay + sig { returns(Gopay) } + attr_reader :gopay + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + # Attribute for field interac_present + sig { returns(InteracPresent) } + attr_reader :interac_present + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field konbini + sig { returns(Konbini) } + attr_reader :konbini + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field mb_way + sig { returns(MbWay) } + attr_reader :mb_way + # Attribute for field mobilepay + sig { returns(Mobilepay) } + attr_reader :mobilepay + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + # Attribute for field naver_pay + sig { returns(NaverPay) } + attr_reader :naver_pay + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + # Attribute for field payco + sig { returns(Payco) } + attr_reader :payco + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field pix + sig { returns(Pix) } + attr_reader :pix + # Attribute for field promptpay + sig { returns(Promptpay) } + attr_reader :promptpay + # Attribute for field qris + sig { returns(Qris) } + attr_reader :qris + # Attribute for field rechnung + sig { returns(Rechnung) } + attr_reader :rechnung + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # Attribute for field sepa_credit_transfer + sig { returns(SepaCreditTransfer) } + attr_reader :sepa_credit_transfer + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field shopeepay + sig { returns(Shopeepay) } + attr_reader :shopeepay + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # Attribute for field stripe_account + sig { returns(StripeAccount) } + attr_reader :stripe_account + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + # Attribute for field twint + sig { returns(Twint) } + attr_reader :twint + # The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. + # An additional hash is included on `payment_method_details` with a name matching this value. + # It contains information specific to the payment method. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + # Attribute for field wechat + sig { returns(Wechat) } + attr_reader :wechat + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + # Attribute for field zip + sig { returns(Zip) } + attr_reader :zip + end + class RadarOptions < Stripe::StripeObject + # A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + sig { returns(String) } + attr_reader :session + end + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class TransferData < Stripe::StripeObject + # The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + sig { returns(Integer) } + attr_reader :amount + + # Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). + sig { returns(Integer) } + attr_reader :amount_captured + + # Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). + sig { returns(Integer) } + attr_reader :amount_refunded + + # ID of the Connect application that created the charge. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # The application fee (if any) for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. + sig { returns(T.nilable(T.any(String, Stripe::ApplicationFee))) } + attr_reader :application_fee + + # The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # Authorization code on the charge. + sig { returns(String) } + attr_reader :authorization_code + + # ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + + # The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. This value only exists for card payments. + sig { returns(T.nilable(String)) } + attr_reader :calculated_statement_descriptor + + # If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + sig { returns(T::Boolean) } + attr_reader :captured + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # ID of the customer this charge is for if one exists. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Whether the charge has been disputed. + sig { returns(T::Boolean) } + attr_reader :disputed + + # ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :failure_balance_transaction + + # Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). + sig { returns(T.nilable(String)) } + attr_reader :failure_code + + # Message to user further explaining reason for charge failure if available. + sig { returns(T.nilable(String)) } + attr_reader :failure_message + + # Information on fraud assessments for the charge. + sig { returns(T.nilable(FraudDetails)) } + attr_reader :fraud_details + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # ID of the invoice this charge is for if one exists. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :invoice + + # Attribute for field level3 + sig { returns(Level3) } + attr_reader :level3 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # Details about whether the payment was accepted, and why. See [understanding declines](https://stripe.com/docs/declines) for details. + sig { returns(T.nilable(Outcome)) } + attr_reader :outcome + + # `true` if the charge succeeded, or was successfully authorized for later capture. + sig { returns(T::Boolean) } + attr_reader :paid + + # ID of the PaymentIntent associated with this charge, if one exists. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + + # ID of the payment method used in this charge. + sig { returns(T.nilable(String)) } + attr_reader :payment_method + + # Details about the payment method at the time of the transaction. + sig { returns(T.nilable(PaymentMethodDetails)) } + attr_reader :payment_method_details + + # Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + sig { returns(RadarOptions) } + attr_reader :radar_options + + # This is the email address that the receipt for this charge was sent to. + sig { returns(T.nilable(String)) } + attr_reader :receipt_email + + # This is the transaction number that appears on email receipts sent for this charge. This attribute will be `null` until a receipt has been sent. + sig { returns(T.nilable(String)) } + attr_reader :receipt_number + + # This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + sig { returns(T.nilable(String)) } + attr_reader :receipt_url + + # Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. + sig { returns(T::Boolean) } + attr_reader :refunded + + # A list of refunds that have been applied to the charge. + sig { returns(T.nilable(Stripe::ListObject)) } + attr_reader :refunds + + # ID of the review associated with this charge if one exists. + sig { returns(T.nilable(T.any(String, Stripe::Review))) } + attr_reader :review + + # Shipping information for the charge. + sig { returns(T.nilable(Shipping)) } + attr_reader :shipping + + # This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. + sig { + returns(T.nilable(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source))) + } + attr_reader :source + + # The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https://docs.stripe.com/connect/destination-charges) for details. + sig { returns(T.nilable(T.any(String, Stripe::Transfer))) } + attr_reader :source_transfer + + # For a non-card charge, text that appears on the customer's statement as the statement descriptor. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + # + # For a card charge, this value is ignored unless you don't specify a `statement_descriptor_suffix`, in which case this value is used as the suffix. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. If the account has no prefix value, the suffix is concatenated to the account's statement descriptor. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_suffix + + # The status of the payment is either `succeeded`, `pending`, or `failed`. + sig { returns(String) } + attr_reader :status + + # ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). + sig { returns(T.any(String, Stripe::Transfer)) } + attr_reader :transfer + + # An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + + # A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + sig { returns(T.nilable(String)) } + attr_reader :transfer_group + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/checkout/session.rbi b/rbi/stripe/resources/checkout/session.rbi new file mode 100644 index 000000000..e90f75931 --- /dev/null +++ b/rbi/stripe/resources/checkout/session.rbi @@ -0,0 +1,1505 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Checkout + # A Checkout Session represents your customer's session as they pay for + # one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) + # or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a + # new Session each time your customer attempts to pay. + # + # Once payment is successful, the Checkout Session will contain a reference + # to the [Customer](https://stripe.com/docs/api/customers), and either the successful + # [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active + # [Subscription](https://stripe.com/docs/api/subscriptions). + # + # You can create a Checkout Session on your server and redirect to its URL + # to begin Checkout. + # + # Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart) + class Session < APIResource + class AdaptivePricing < Stripe::StripeObject + # Whether Adaptive Pricing is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + end + class AfterExpiration < Stripe::StripeObject + class Recovery < Stripe::StripeObject + # Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` + sig { returns(T::Boolean) } + attr_reader :allow_promotion_codes + # If `true`, a recovery url will be generated to recover this Checkout Session if it + # expires before a transaction is completed. It will be attached to the + # Checkout Session object upon expiration. + sig { returns(T::Boolean) } + attr_reader :enabled + # The timestamp at which the recovery URL will expire. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session + sig { returns(T.nilable(String)) } + attr_reader :url + end + # When set, configuration used to recover the Checkout Session on expiry. + sig { returns(T.nilable(Recovery)) } + attr_reader :recovery + end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Indicates whether automatic tax is enabled for the session + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + # The status of the most recent automated tax calculation for this session. + sig { returns(T.nilable(String)) } + attr_reader :status + end + class CollectedInformation < Stripe::StripeObject + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(T.nilable(String)) } + attr_reader :value + end + # Customer’s business name for this Checkout Session + sig { returns(T.nilable(String)) } + attr_reader :business_name + # Customer’s email for this Checkout Session + sig { returns(T.nilable(String)) } + attr_reader :email + # Customer’s phone number for this Checkout Session + sig { returns(T.nilable(String)) } + attr_reader :phone + # Shipping information for this Checkout Session. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + # Customer’s tax ids for this Checkout Session. + sig { returns(T.nilable(T::Array[TaxId])) } + attr_reader :tax_ids + end + class Consent < Stripe::StripeObject + # If `opt_in`, the customer consents to receiving promotional communications + # from the merchant about this Checkout Session. + sig { returns(T.nilable(String)) } + attr_reader :promotions + # If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. + sig { returns(T.nilable(String)) } + attr_reader :terms_of_service + end + class ConsentCollection < Stripe::StripeObject + class PaymentMethodReuseAgreement < Stripe::StripeObject + # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. + # + # When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + sig { returns(String) } + attr_reader :position + end + # If set to `hidden`, it will hide legal text related to the reuse of a payment method. + sig { returns(T.nilable(PaymentMethodReuseAgreement)) } + attr_reader :payment_method_reuse_agreement + # If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout + # Session will determine whether to display an option to opt into promotional communication + # from the merchant depending on the customer's locale. Only available to US merchants. + sig { returns(T.nilable(String)) } + attr_reader :promotions + # If set to `required`, it requires customers to accept the terms of service before being able to pay. + sig { returns(T.nilable(String)) } + attr_reader :terms_of_service + end + class CurrencyConversion < Stripe::StripeObject + # Total of all items in source currency before discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total of all items in source currency after discounts and taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # Exchange rate used to convert source currency amounts to customer currency amounts + sig { returns(String) } + attr_reader :fx_rate + # Creation currency of the CheckoutSession before localization + sig { returns(String) } + attr_reader :source_currency + end + class CustomField < Stripe::StripeObject + class Dropdown < Stripe::StripeObject + class Option < Stripe::StripeObject + # The label for the option, displayed to the customer. Up to 100 characters. + sig { returns(String) } + attr_reader :label + # The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. + sig { returns(String) } + attr_reader :value + end + # The value that will pre-fill on the payment page. + sig { returns(T.nilable(String)) } + attr_reader :default_value + # The options available for the customer to select. Up to 200 options allowed. + sig { returns(T::Array[Option]) } + attr_reader :options + # The option selected by the customer. This will be the `value` for the option. + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Label < Stripe::StripeObject + # Custom text for the label, displayed to the customer. Up to 50 characters. + sig { returns(T.nilable(String)) } + attr_reader :custom + # The type of the label. + sig { returns(String) } + attr_reader :type + end + class Numeric < Stripe::StripeObject + # The value that will pre-fill the field on the payment page. + sig { returns(T.nilable(String)) } + attr_reader :default_value + # The maximum character length constraint for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :minimum_length + # The value entered by the customer, containing only digits. + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Text < Stripe::StripeObject + # The value that will pre-fill the field on the payment page. + sig { returns(T.nilable(String)) } + attr_reader :default_value + # The maximum character length constraint for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :minimum_length + # The value entered by the customer. + sig { returns(T.nilable(String)) } + attr_reader :value + end + # Attribute for field dropdown + sig { returns(Dropdown) } + attr_reader :dropdown + # String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. + sig { returns(String) } + attr_reader :key + # Attribute for field label + sig { returns(Label) } + attr_reader :label + # Attribute for field numeric + sig { returns(Numeric) } + attr_reader :numeric + # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. + sig { returns(T::Boolean) } + attr_reader :optional + # Attribute for field text + sig { returns(Text) } + attr_reader :text + # The type of the field. + sig { returns(String) } + attr_reader :type + end + class CustomText < Stripe::StripeObject + class AfterSubmit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + class ShippingAddress < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + class Submit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + class TermsOfServiceAcceptance < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + # Custom text that should be displayed after the payment confirmation button. + sig { returns(T.nilable(AfterSubmit)) } + attr_reader :after_submit + # Custom text that should be displayed alongside shipping address collection. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + # Custom text that should be displayed alongside the payment confirmation button. + sig { returns(T.nilable(Submit)) } + attr_reader :submit + # Custom text that should be displayed in place of the default terms of service agreement text. + sig { returns(T.nilable(TermsOfServiceAcceptance)) } + attr_reader :terms_of_service_acceptance + end + class CustomerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(T.nilable(String)) } + attr_reader :value + end + # The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. + sig { returns(T.nilable(Address)) } + attr_reader :address + # The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. + # Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. + sig { returns(T.nilable(String)) } + attr_reader :email + # The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. + sig { returns(T.nilable(String)) } + attr_reader :name + # The customer's phone number after a completed Checkout Session. + sig { returns(T.nilable(String)) } + attr_reader :phone + # The customer’s tax exempt status after a completed Checkout Session. + sig { returns(T.nilable(String)) } + attr_reader :tax_exempt + # The customer’s tax IDs after a completed Checkout Session. + sig { returns(T.nilable(T::Array[TaxId])) } + attr_reader :tax_ids + end + class InvoiceCreation < Stripe::StripeObject + class InvoiceData < Stripe::StripeObject + class CustomField < Stripe::StripeObject + # The name of the custom field. + sig { returns(String) } + attr_reader :name + # The value of the custom field. + sig { returns(String) } + attr_reader :value + end + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + class RenderingOptions < Stripe::StripeObject + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + sig { returns(T.nilable(String)) } + attr_reader :amount_tax_display + end + # The account tax IDs associated with the invoice. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # Custom fields displayed on the invoice. + sig { returns(T.nilable(T::Array[CustomField])) } + attr_reader :custom_fields + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + # Footer displayed on the invoice. + sig { returns(T.nilable(String)) } + attr_reader :footer + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + sig { returns(T.nilable(Issuer)) } + attr_reader :issuer + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # Options for invoice PDF rendering. + sig { returns(T.nilable(RenderingOptions)) } + attr_reader :rendering_options + end + # Indicates whether invoice creation is enabled for the Checkout Session. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field invoice_data + sig { returns(InvoiceData) } + attr_reader :invoice_data + end + class PaymentMethodConfigurationDetails < Stripe::StripeObject + # ID of the payment method configuration used. + sig { returns(String) } + attr_reader :id + # ID of the parent payment method configuration used. + sig { returns(T.nilable(String)) } + attr_reader :parent + end + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + sig { returns(String) } + attr_reader :custom_mandate_url + # List of Stripe products where this mandate can be selected automatically. Returned when the Session is in `setup` mode. + sig { returns(T::Array[String]) } + attr_reader :default_for + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + sig { returns(T.nilable(String)) } + attr_reader :interval_description + # Payment schedule for the mandate. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Currency supported by the bank account. Returned when the Session is in `setup` mode. + sig { returns(String) } + attr_reader :currency + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class Affirm < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class AfterpayClearpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Alipay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class AmazonPay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class AuBecsDebit < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class BacsDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Bancontact < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Boleto < Stripe::StripeObject + # 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. + sig { returns(Integer) } + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + # Indicates if installments are enabled + sig { returns(T::Boolean) } + attr_reader :enabled + end + # Attribute for field installments + sig { returns(Installments) } + attr_reader :installments + # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession. + sig { returns(String) } + attr_reader :request_decremental_authorization + # Request ability to [capture beyond the standard authorization validity window](/payments/extended-authorization) for this CheckoutSession. + sig { returns(String) } + attr_reader :request_extended_authorization + # Request ability to [increment the authorization](/payments/incremental-authorization) for this CheckoutSession. + sig { returns(String) } + attr_reader :request_incremental_authorization + # Request ability to make [multiple captures](/payments/multicapture) for this CheckoutSession. + sig { returns(String) } + attr_reader :request_multicapture + # Request ability to [overcapture](/payments/overcapture) for this CheckoutSession. + sig { returns(String) } + attr_reader :request_overcapture + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + sig { returns(String) } + attr_reader :request_three_d_secure + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + sig { returns(String) } + attr_reader :statement_descriptor_suffix_kana + # Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + sig { returns(String) } + attr_reader :statement_descriptor_suffix_kanji + end + class Cashapp < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + sig { returns(String) } + attr_reader :country + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + # + # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + sig { returns(T::Array[String]) } + attr_reader :requested_address_types + # The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :funding_type + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Eps < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Fpx < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Giropay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Grabpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Ideal < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class KakaoPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Klarna < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Konbini < Stripe::StripeObject + # The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class KrCard < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Link < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Mobilepay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Multibanco < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class NaverPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class Oxxo < Stripe::StripeObject + # The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + sig { returns(Integer) } + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class P24 < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Payco < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class Paynow < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Paypal < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Preferred locale of the PayPal checkout page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_locale + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + sig { returns(T::Array[String]) } + attr_reader :subsellers + end + class Payto < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + sig { returns(T.nilable(String)) } + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + sig { returns(T.nilable(String)) } + attr_reader :end_date + # The periodicity at which payments will be collected. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + sig { returns(T.nilable(Integer)) } + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + sig { returns(T.nilable(String)) } + attr_reader :purpose + # Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + sig { returns(T.nilable(String)) } + attr_reader :start_date + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Pix < Stripe::StripeObject + # The number of seconds after which Pix payment will expire. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_after_seconds + end + class RevolutPay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class SamsungPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Sofort < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Swish < Stripe::StripeObject + # The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + sig { returns(T::Array[String]) } + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + sig { returns(String) } + attr_reader :institution + end + class ManualEntry < Stripe::StripeObject + # Settings for configuring manual entry of account details. + sig { returns(String) } + attr_reader :mode + end + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + # Attribute for field manual_entry + sig { returns(ManualEntry) } + attr_reader :manual_entry + # The list of permissions to request. The `payment_method` permission must be included. + sig { returns(T::Array[String]) } + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + sig { returns(String) } + attr_reader :return_url + end + # Attribute for field financial_connections + sig { returns(FinancialConnections) } + attr_reader :financial_connections + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + # Attribute for field fpx + sig { returns(Fpx) } + attr_reader :fpx + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field konbini + sig { returns(Konbini) } + attr_reader :konbini + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field mobilepay + sig { returns(Mobilepay) } + attr_reader :mobilepay + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + # Attribute for field naver_pay + sig { returns(NaverPay) } + attr_reader :naver_pay + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + # Attribute for field payco + sig { returns(Payco) } + attr_reader :payco + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field pix + sig { returns(Pix) } + attr_reader :pix + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class Permissions < Stripe::StripeObject + class Update < Stripe::StripeObject + # Determines which entity is allowed to update the line items. + # + # Default is `client_only`. Stripe Checkout client will automatically update the line items. If set to `server_only`, only your server is allowed to update the line items. + # + # When set to `server_only`, you must add the onLineItemsChange event handler when initializing the Stripe Checkout client and manually update the line items from your server using the Stripe API. + sig { returns(T.nilable(String)) } + attr_reader :line_items + # Determines which entity is allowed to update the shipping details. + # + # Default is `client_only`. Stripe Checkout client will automatically update the shipping details. If set to `server_only`, only your server is allowed to update the shipping details. + # + # When set to `server_only`, you must add the onShippingDetailsChange event handler when initializing the Stripe Checkout client and manually update the shipping details from your server using the Stripe API. + sig { returns(T.nilable(String)) } + attr_reader :shipping_details + end + # Permissions for updating the Checkout Session. + sig { returns(T.nilable(Update)) } + attr_reader :update + end + class PhoneNumberCollection < Stripe::StripeObject + # Indicates whether phone number collection is enabled for the session + sig { returns(T::Boolean) } + attr_reader :enabled + end + class SavedPaymentMethodOptions < Stripe::StripeObject + # Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with ’allow_redisplay: ‘always’ are shown in Checkout. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allow_redisplay_filters + # Enable customers to choose if they wish to remove their saved payment methods. Disabled by default. + sig { returns(T.nilable(String)) } + attr_reader :payment_method_remove + # Enable customers to choose if they wish to save their payment method for future use. Disabled by default. + sig { returns(T.nilable(String)) } + attr_reader :payment_method_save + end + class ShippingAddressCollection < Stripe::StripeObject + # An array of two-letter ISO country codes representing which countries Checkout should provide as options for + # shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + sig { returns(T::Array[String]) } + attr_reader :allowed_countries + end + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # Total shipping cost before any discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_tax + # Total shipping cost after discounts and taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The ID of the ShippingRate for this order. + sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) } + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class ShippingOption < Stripe::StripeObject + # A non-negative integer in cents representing how much to charge. + sig { returns(Integer) } + attr_reader :shipping_amount + # The shipping rate. + sig { returns(T.any(String, Stripe::ShippingRate)) } + attr_reader :shipping_rate + end + class TaxIdCollection < Stripe::StripeObject + # Indicates whether tax ID collection is enabled for the session + sig { returns(T::Boolean) } + attr_reader :enabled + # Indicates whether a tax ID is required on the payment page + sig { returns(String) } + attr_reader :required + end + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + sig { returns(Integer) } + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + sig { returns(Stripe::Discount) } + attr_reader :discount + end + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The aggregated discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The aggregated tax amounts by rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + # This is the sum of all the discounts. + sig { returns(Integer) } + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + sig { returns(Integer) } + attr_reader :amount_tax + # Attribute for field breakdown + sig { returns(Breakdown) } + attr_reader :breakdown + end + # Settings for price localization with [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing). + sig { returns(T.nilable(AdaptivePricing)) } + attr_reader :adaptive_pricing + + # When set, provides configuration for actions to take if this Checkout Session expires. + sig { returns(T.nilable(AfterExpiration)) } + attr_reader :after_expiration + + # Enables user redeemable promotion codes. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :allow_promotion_codes + + # Total of all items before discounts or taxes are applied. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_subtotal + + # Total of all items after discounts and taxes are applied. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_total + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # Describes whether Checkout should collect the customer's billing address. Defaults to `auto`. + sig { returns(T.nilable(String)) } + attr_reader :billing_address_collection + + # If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. + sig { returns(T.nilable(String)) } + attr_reader :cancel_url + + # A unique string to reference the Checkout Session. This can be a + # customer ID, a cart ID, or similar, and can be used to reconcile the + # Session with your internal systems. + sig { returns(T.nilable(String)) } + attr_reader :client_reference_id + + # The client secret of the Session. Use this with [initCustomCheckout](https://stripe.com/docs/js/custom_checkout/init) on your front end. + sig { returns(T.nilable(String)) } + attr_reader :client_secret + + # Information about the customer collected within the Checkout Session. + sig { returns(T.nilable(CollectedInformation)) } + attr_reader :collected_information + + # Results of `consent_collection` for this session. + sig { returns(T.nilable(Consent)) } + attr_reader :consent + + # When set, provides configuration for the Checkout Session to gather active consent from customers. + sig { returns(T.nilable(ConsentCollection)) } + attr_reader :consent_collection + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(T.nilable(String)) } + attr_reader :currency + + # Currency conversion details for [Adaptive Pricing](https://docs.stripe.com/payments/checkout/adaptive-pricing) sessions + sig { returns(T.nilable(CurrencyConversion)) } + attr_reader :currency_conversion + + # Collect additional information from your customer using custom fields. Up to 3 fields are supported. + sig { returns(T::Array[CustomField]) } + attr_reader :custom_fields + + # Attribute for field custom_text + sig { returns(CustomText) } + attr_reader :custom_text + + # The ID of the customer for this Session. + # For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout + # will create a new customer object based on information provided + # during the payment flow unless an existing customer was provided when + # the Session was created. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # Configure whether a Checkout Session creates a Customer when the Checkout Session completes. + sig { returns(T.nilable(String)) } + attr_reader :customer_creation + + # The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode. + sig { returns(T.nilable(CustomerDetails)) } + attr_reader :customer_details + + # If provided, this value will be used when the Customer object is created. + # If not provided, customers will be asked to enter their email address. + # Use this parameter to prefill customer data if you already have an email + # on file. To access information about the customer once the payment flow is + # complete, use the `customer` attribute. + sig { returns(T.nilable(String)) } + attr_reader :customer_email + + # The timestamp at which the Checkout Session will expire. + sig { returns(Integer) } + attr_reader :expires_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # ID of the invoice created by the Checkout Session, if it exists. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :invoice + + # Details on the state of invoice creation for the Checkout Session. + sig { returns(T.nilable(InvoiceCreation)) } + attr_reader :invoice_creation + + # The line items purchased by the customer. + sig { returns(Stripe::ListObject) } + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. + sig { returns(T.nilable(String)) } + attr_reader :locale + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # The mode of the Checkout Session. + sig { returns(String) } + attr_reader :mode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ID of the PaymentIntent for Checkout Sessions in `payment` mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + + # The ID of the Payment Link that created this Session. + sig { returns(T.nilable(T.any(String, Stripe::PaymentLink))) } + attr_reader :payment_link + + # Configure whether a Checkout Session should collect a payment method. Defaults to `always`. + sig { returns(T.nilable(String)) } + attr_reader :payment_method_collection + + # Information about the payment method configuration used for this Checkout session if using dynamic payment methods. + sig { returns(T.nilable(PaymentMethodConfigurationDetails)) } + attr_reader :payment_method_configuration_details + + # Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + + # A list of the types of payment methods (e.g. card) this Checkout + # Session is allowed to accept. + sig { returns(T::Array[String]) } + attr_reader :payment_method_types + + # The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. + # You can use this value to decide when to fulfill your customer's order. + sig { returns(String) } + attr_reader :payment_status + + # This property is used to set up permissions for various actions (e.g., update) on the CheckoutSession object. + # + # For specific permissions, please refer to their dedicated subsections, such as `permissions.update.shipping_details`. + sig { returns(T.nilable(Permissions)) } + attr_reader :permissions + + # Attribute for field phone_number_collection + sig { returns(PhoneNumberCollection) } + attr_reader :phone_number_collection + + # The ID of the original expired Checkout Session that triggered the recovery flow. + sig { returns(T.nilable(String)) } + attr_reader :recovered_from + + # This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-success-page?payment-ui=embedded-form) of embedded sessions. Defaults to `always`. + sig { returns(String) } + attr_reader :redirect_on_completion + + # Applies to Checkout Sessions with `ui_mode: embedded` or `ui_mode: custom`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. + sig { returns(String) } + attr_reader :return_url + + # Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. + sig { returns(T.nilable(SavedPaymentMethodOptions)) } + attr_reader :saved_payment_method_options + + # The ID of the SetupIntent for Checkout Sessions in `setup` mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. + sig { returns(T.nilable(T.any(String, Stripe::SetupIntent))) } + attr_reader :setup_intent + + # When set, provides configuration for Checkout to collect a shipping address from a customer. + sig { returns(T.nilable(ShippingAddressCollection)) } + attr_reader :shipping_address_collection + + # The details of the customer cost of shipping, including the customer chosen ShippingRate. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # Shipping information for this Checkout Session. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + + # The shipping rate options applied to this Session. + sig { returns(T::Array[ShippingOption]) } + attr_reader :shipping_options + + # The status of the Checkout Session, one of `open`, `complete`, or `expired`. + sig { returns(T.nilable(String)) } + attr_reader :status + + # Describes the type of transaction being performed by Checkout in order to customize + # relevant text on the page, such as the submit button. `submit_type` can only be + # specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. + sig { returns(T.nilable(String)) } + attr_reader :submit_type + + # The ID of the subscription for Checkout Sessions in `subscription` mode. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # The URL the customer will be directed to after the payment or + # subscription creation is successful. + sig { returns(T.nilable(String)) } + attr_reader :success_url + + # Attribute for field tax_id_collection + sig { returns(TaxIdCollection) } + attr_reader :tax_id_collection + + # Tax and discount details for the computed total amount. + sig { returns(T.nilable(TotalDetails)) } + attr_reader :total_details + + # The UI mode of the Session. Defaults to `hosted`. + sig { returns(T.nilable(String)) } + attr_reader :ui_mode + + # The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you’re using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it’ll use `checkout.stripe.com.` + # This value is only present when the session is active. + sig { returns(T.nilable(String)) } + attr_reader :url + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/climate/order.rbi b/rbi/stripe/resources/climate/order.rbi new file mode 100644 index 000000000..fbe6c3b25 --- /dev/null +++ b/rbi/stripe/resources/climate/order.rbi @@ -0,0 +1,138 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Climate + # Orders represent your intent to purchase a particular Climate product. When you create an order, the + # payment is deducted from your merchant balance. + class Order < APIResource + class Beneficiary < Stripe::StripeObject + # Publicly displayable name for the end beneficiary of carbon removal. + sig { returns(String) } + attr_reader :public_name + end + class DeliveryDetail < Stripe::StripeObject + class Location < Stripe::StripeObject + # The city where the supplier is located. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter ISO code representing the country where the supplier is located. + sig { returns(String) } + attr_reader :country + # The geographic latitude where the supplier is located. + sig { returns(T.nilable(Float)) } + attr_reader :latitude + # The geographic longitude where the supplier is located. + sig { returns(T.nilable(Float)) } + attr_reader :longitude + # The state/county/province/region where the supplier is located. + sig { returns(T.nilable(String)) } + attr_reader :region + end + # Time at which the delivery occurred. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :delivered_at + # Specific location of this delivery. + sig { returns(T.nilable(Location)) } + attr_reader :location + # Quantity of carbon removal supplied by this delivery. + sig { returns(String) } + attr_reader :metric_tons + # Once retired, a URL to the registry entry for the tons from this delivery. + sig { returns(T.nilable(String)) } + attr_reader :registry_url + # A supplier of carbon removal. + sig { returns(Stripe::Climate::Supplier) } + attr_reader :supplier + end + # Total amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit. + sig { returns(Integer) } + attr_reader :amount_fees + + # Total amount of the carbon removal in the currency's smallest unit. + sig { returns(Integer) } + attr_reader :amount_subtotal + + # Total amount of the order including fees in the currency's smallest unit. + sig { returns(Integer) } + attr_reader :amount_total + + # Attribute for field beneficiary + sig { returns(Beneficiary) } + attr_reader :beneficiary + + # Time at which the order was canceled. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + + # Reason for the cancellation of this order. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_reason + + # For delivered orders, a URL to a delivery certificate for the order. + sig { returns(T.nilable(String)) } + attr_reader :certificate + + # Time at which the order was confirmed. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :confirmed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order. + sig { returns(String) } + attr_reader :currency + + # Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :delayed_at + + # Time at which the order was delivered. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :delivered_at + + # Details about the delivery of carbon removal for this order. + sig { returns(T::Array[DeliveryDetail]) } + attr_reader :delivery_details + + # The year this order is expected to be delivered. + sig { returns(Integer) } + attr_reader :expected_delivery_year + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Quantity of carbon removal that is included in this order. + sig { returns(String) } + attr_reader :metric_tons + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Unique ID for the Climate `Product` this order is purchasing. + sig { returns(T.any(String, Stripe::Climate::Product)) } + attr_reader :product + + # Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :product_substituted_at + + # The current status of this order. + sig { returns(String) } + attr_reader :status + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/climate/product.rbi b/rbi/stripe/resources/climate/product.rbi new file mode 100644 index 000000000..e56a4895f --- /dev/null +++ b/rbi/stripe/resources/climate/product.rbi @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Climate + # A Climate product represents a type of carbon removal unit available for reservation. + # You can retrieve it to see the current price and availability. + class Product < APIResource + class CurrentPricesPerMetricTon < Stripe::StripeObject + # Fees for one metric ton of carbon removal in the currency's smallest unit. + sig { returns(Integer) } + attr_reader :amount_fees + # Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest unit. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. + sig { returns(Integer) } + attr_reader :amount_total + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Current prices for a metric ton of carbon removal in a currency's smallest unit. + sig { returns(T::Hash[String, CurrentPricesPerMetricTon]) } + attr_reader :current_prices_per_metric_ton + + # The year in which the carbon removal is expected to be delivered. + sig { returns(T.nilable(Integer)) } + attr_reader :delivery_year + + # Unique identifier for the object. For convenience, Climate product IDs are human-readable strings + # that start with `climsku_`. See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory) + # for a list of available carbon removal products. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The quantity of metric tons available for reservation. + sig { returns(String) } + attr_reader :metric_tons_available + + # The Climate product's name. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The carbon removal suppliers that fulfill orders for this Climate product. + sig { returns(T::Array[Stripe::Climate::Supplier]) } + attr_reader :suppliers + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/climate/supplier.rbi b/rbi/stripe/resources/climate/supplier.rbi new file mode 100644 index 000000000..7c5e6c71a --- /dev/null +++ b/rbi/stripe/resources/climate/supplier.rbi @@ -0,0 +1,55 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Climate + # A supplier of carbon removal. + class Supplier < APIResource + class Location < Stripe::StripeObject + # The city where the supplier is located. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter ISO code representing the country where the supplier is located. + sig { returns(String) } + attr_reader :country + # The geographic latitude where the supplier is located. + sig { returns(T.nilable(Float)) } + attr_reader :latitude + # The geographic longitude where the supplier is located. + sig { returns(T.nilable(Float)) } + attr_reader :longitude + # The state/county/province/region where the supplier is located. + sig { returns(T.nilable(String)) } + attr_reader :region + end + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Link to a webpage to learn more about the supplier. + sig { returns(String) } + attr_reader :info_url + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The locations in which this supplier operates. + sig { returns(T::Array[Location]) } + attr_reader :locations + + # Name of this carbon removal supplier. + sig { returns(String) } + attr_reader :name + + # String representing the object’s type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The scientific pathway used for carbon removal. + sig { returns(String) } + attr_reader :removal_pathway + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/confirmation_token.rbi b/rbi/stripe/resources/confirmation_token.rbi new file mode 100644 index 000000000..06667ebc4 --- /dev/null +++ b/rbi/stripe/resources/confirmation_token.rbi @@ -0,0 +1,1113 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # ConfirmationTokens help transport client side data collected by Stripe JS over + # to your server for confirming a PaymentIntent or SetupIntent. If the confirmation + # is successful, values present on the ConfirmationToken are written onto the Intent. + # + # To learn more about how to use ConfirmationToken, visit the related guides: + # - [Finalize payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) + # - [Build two-step confirmation](https://stripe.com/docs/payments/build-a-two-step-confirmation). + class ConfirmationToken < APIResource + class MandateData < Stripe::StripeObject + class CustomerAcceptance < Stripe::StripeObject + class Online < Stripe::StripeObject + # The IP address from which the Mandate was accepted by the customer. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + # The user agent of the browser from which the Mandate was accepted by the customer. + sig { returns(T.nilable(String)) } + attr_reader :user_agent + end + # If this is a Mandate accepted online, this hash contains details about the online acceptance. + sig { returns(T.nilable(Online)) } + attr_reader :online + # The type of customer acceptance information included with the Mandate. + sig { returns(String) } + attr_reader :type + end + # This hash contains details about the customer acceptance of the Mandate. + sig { returns(CustomerAcceptance) } + attr_reader :customer_acceptance + end + class PaymentMethodOptions < Stripe::StripeObject + class Card < Stripe::StripeObject + # The `cvc_update` Token collected from the Payment Element. + sig { returns(T.nilable(String)) } + attr_reader :cvc_token + end + # This hash contains the card payment method options. + sig { returns(T.nilable(Card)) } + attr_reader :card + end + class PaymentMethodPreview < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Institution number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :institution_number + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Transit number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :transit_number + end + class Affirm < Stripe::StripeObject; end + class AfterpayClearpay < Stripe::StripeObject; end + class Alipay < Stripe::StripeObject; end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + class AuBecsDebit < Stripe::StripeObject + # Six-digit number identifying bank and branch associated with this bank account. + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class BacsDebit < Stripe::StripeObject + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Sort code of the bank account. (e.g., `10-20-30`) + sig { returns(T.nilable(String)) } + attr_reader :sort_code + end + class Bancontact < Stripe::StripeObject; end + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Billing address. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + # Billing phone number (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class Blik < Stripe::StripeObject; end + class Boleto < Stripe::StripeObject + # Uniquely identifies the customer tax id (CNPJ or CPF) + sig { returns(String) } + attr_reader :tax_id + end + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + end + class GeneratedFrom < Stripe::StripeObject + class PaymentMethodDetails < Stripe::StripeObject + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + sig { returns(T.nilable(Integer)) } + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + sig { returns(String) } + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + sig { returns(T.nilable(String)) } + attr_reader :application_preferred_name + # Identifier for this transaction. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + sig { returns(T.nilable(String)) } + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + sig { returns(T.nilable(String)) } + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_status_information + end + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + sig { returns(String) } + attr_reader :type + end + # The authorized amount + sig { returns(T.nilable(Integer)) } + attr_reader :amount_authorized + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + sig { returns(T.nilable(String)) } + attr_reader :brand_product + # When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + sig { returns(Integer) } + attr_reader :capture_before + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Authorization response cryptogram. + sig { returns(T.nilable(String)) } + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + sig { returns(T.nilable(String)) } + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + sig { returns(T::Boolean) } + attr_reader :incremental_authorization_supported + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + sig { returns(T.nilable(String)) } + attr_reader :network_transaction_id + # Details about payments collected offline. + sig { returns(T.nilable(Offline)) } + attr_reader :offline + # Defines whether the authorized amount can be over-captured or not + sig { returns(T::Boolean) } + attr_reader :overcapture_supported + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + sig { returns(T.nilable(Receipt)) } + attr_reader :receipt + # Attribute for field wallet + sig { returns(Wallet) } + attr_reader :wallet + end + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. + sig { returns(String) } + attr_reader :type + end + # The charge that created this object. + sig { returns(T.nilable(String)) } + attr_reader :charge + # Transaction-specific details of the payment method used in the payment. + sig { returns(T.nilable(PaymentMethodDetails)) } + attr_reader :payment_method_details + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + sig { returns(T.nilable(T.any(String, Stripe::SetupAttempt))) } + attr_reader :setup_attempt + end + class Networks < Stripe::StripeObject + # All available networks for the card. + sig { returns(T::Array[String]) } + attr_reader :available + # The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + class ThreeDSecureUsage < Stripe::StripeObject + # Whether 3D Secure is supported on this card. + sig { returns(T::Boolean) } + attr_reader :supported + end + class Wallet < Stripe::StripeObject + class AmexExpressCheckout < Stripe::StripeObject; end + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + class Masterpass < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(BillingAddress)) } + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + class SamsungPay < Stripe::StripeObject; end + class VisaCheckout < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(BillingAddress)) } + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + # Attribute for field amex_express_checkout + sig { returns(AmexExpressCheckout) } + attr_reader :amex_express_checkout + # Attribute for field apple_pay + sig { returns(ApplePay) } + attr_reader :apple_pay + # (For tokenized numbers only.) The last four digits of the device account number. + sig { returns(T.nilable(String)) } + attr_reader :dynamic_last4 + # Attribute for field google_pay + sig { returns(GooglePay) } + attr_reader :google_pay + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field masterpass + sig { returns(Masterpass) } + attr_reader :masterpass + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + sig { returns(String) } + attr_reader :type + # Attribute for field visa_checkout + sig { returns(VisaCheckout) } + attr_reader :visa_checkout + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(String) } + attr_reader :brand + # Checks on Card address and CVC if provided. + sig { returns(T.nilable(Checks)) } + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + sig { returns(T.nilable(String)) } + attr_reader :display_brand + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(String) } + attr_reader :funding + # Details of the original PaymentMethod that created this object. + sig { returns(T.nilable(GeneratedFrom)) } + attr_reader :generated_from + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(String) } + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # Contains details on how this Card may be used for 3D Secure authentication. + sig { returns(T.nilable(ThreeDSecureUsage)) } + attr_reader :three_d_secure_usage + # If this Card is part of a card wallet, this contains the details of the card wallet. + sig { returns(T.nilable(Wallet)) } + attr_reader :wallet + end + class CardPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + sig { returns(T::Array[String]) } + attr_reader :available + # The preferred network for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + sig { returns(T.nilable(Integer)) } + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + sig { returns(String) } + attr_reader :type + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + sig { returns(T.nilable(String)) } + attr_reader :brand_product + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # Details about payment methods collected offline. + sig { returns(T.nilable(Offline)) } + attr_reader :offline + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + # Attribute for field wallet + sig { returns(Wallet) } + attr_reader :wallet + end + class Cashapp < Stripe::StripeObject + # A unique and immutable identifier assigned by Cash App to every buyer. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + # A public identifier for buyers using Cash App. + sig { returns(T.nilable(String)) } + attr_reader :cashtag + end + class CustomerBalance < Stripe::StripeObject; end + class Eps < Stripe::StripeObject + # The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + sig { returns(T.nilable(String)) } + attr_reader :bank + end + class Fpx < Stripe::StripeObject + # Account holder type, if provided. Can be one of `individual` or `company`. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + sig { returns(String) } + attr_reader :bank + end + class Giropay < Stripe::StripeObject; end + class Gopay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject; end + class IdBankTransfer < Stripe::StripeObject + # Attribute for field bank + sig { returns(T.nilable(String)) } + attr_reader :bank + # Attribute for field bank_code + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field display_name + sig { returns(T.nilable(String)) } + attr_reader :display_name + end + class Ideal < Stripe::StripeObject + # The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + sig { returns(T.nilable(String)) } + attr_reader :bank + # The Bank Identifier Code of the customer's bank, if the bank was provided. + sig { returns(T.nilable(String)) } + attr_reader :bic + end + class InteracPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + sig { returns(T::Array[String]) } + attr_reader :available + # The preferred network for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + # Card brand. Can be `interac`, `mastercard` or `visa`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + end + class KakaoPay < Stripe::StripeObject; end + class Klarna < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # The month of birth, between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year of birth. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + # The customer's date of birth, if provided. + sig { returns(T.nilable(Dob)) } + attr_reader :dob + end + class Konbini < Stripe::StripeObject; end + class KrCard < Stripe::StripeObject + # The local credit or debit card brand. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The last four digits of the card. This may not be present for American Express cards. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class Link < Stripe::StripeObject + # Account owner's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # [Deprecated] This is a legacy parameter that no longer has any function. + sig { returns(String) } + attr_reader :persistent_token + end + class MbWay < Stripe::StripeObject; end + class Mobilepay < Stripe::StripeObject; end + class Multibanco < Stripe::StripeObject; end + class NaverPay < Stripe::StripeObject + # Whether to fund this transaction with Naver Pay points or a card. + sig { returns(String) } + attr_reader :funding + end + class Oxxo < Stripe::StripeObject; end + class P24 < Stripe::StripeObject + # The customer's bank, if provided. + sig { returns(T.nilable(String)) } + attr_reader :bank + end + class Payco < Stripe::StripeObject; end + class Paynow < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject + # Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Owner's email. Values are provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :payer_email + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + sig { returns(T.nilable(String)) } + attr_reader :payer_id + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_email + end + class Payto < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # The PayID alias for the bank account. + sig { returns(T.nilable(String)) } + attr_reader :pay_id + end + class Pix < Stripe::StripeObject; end + class Promptpay < Stripe::StripeObject; end + class Qris < Stripe::StripeObject; end + class Rechnung < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + sig { returns(Integer) } + attr_reader :day + # The month of birth, between 1 and 12. + sig { returns(Integer) } + attr_reader :month + # The four-digit year of birth. + sig { returns(Integer) } + attr_reader :year + end + # Attribute for field dob + sig { returns(Dob) } + attr_reader :dob + end + class RevolutPay < Stripe::StripeObject; end + class SamsungPay < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject + class GeneratedFrom < Stripe::StripeObject + # The ID of the Charge that generated this PaymentMethod, if any. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :charge + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + sig { returns(T.nilable(T.any(String, Stripe::SetupAttempt))) } + attr_reader :setup_attempt + end + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Branch code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :branch_code + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Information about the object that generated this PaymentMethod. + sig { returns(T.nilable(GeneratedFrom)) } + attr_reader :generated_from + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class Shopeepay < Stripe::StripeObject; end + class Sofort < Stripe::StripeObject + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + end + class Swish < Stripe::StripeObject; end + class Twint < Stripe::StripeObject; end + class UsBankAccount < Stripe::StripeObject + class Networks < Stripe::StripeObject + # The preferred network. + sig { returns(T.nilable(String)) } + attr_reader :preferred + # All supported networks. + sig { returns(T::Array[String]) } + attr_reader :supported + end + class StatusDetails < Stripe::StripeObject + class Blocked < Stripe::StripeObject + # The ACH network code that resulted in this block. + sig { returns(T.nilable(String)) } + attr_reader :network_code + # The reason why this PaymentMethod's fingerprint has been blocked + sig { returns(T.nilable(String)) } + attr_reader :reason + end + # Attribute for field blocked + sig { returns(Blocked) } + attr_reader :blocked + end + # Account holder type: individual or company. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Account number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :account_number + # Account type: checkings or savings. Defaults to checking if omitted. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # The name of the bank. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # The ID of the Financial Connections Account used to create the payment method. + sig { returns(T.nilable(String)) } + attr_reader :financial_connections_account + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Contains information about US bank account networks that can be used. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # Routing number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + # Contains information about the future reusability of this PaymentMethod. + sig { returns(T.nilable(StatusDetails)) } + attr_reader :status_details + end + class WechatPay < Stripe::StripeObject; end + class Zip < Stripe::StripeObject; end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + # This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + sig { returns(String) } + attr_reader :allow_redisplay + # Attribute for field alma + sig { returns(Alma) } + attr_reader :alma + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + # Attribute for field blik + sig { returns(Blik) } + attr_reader :blik + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + # Attribute for field fpx + sig { returns(Fpx) } + attr_reader :fpx + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + # Attribute for field gopay + sig { returns(Gopay) } + attr_reader :gopay + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + # Attribute for field interac_present + sig { returns(InteracPresent) } + attr_reader :interac_present + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field konbini + sig { returns(Konbini) } + attr_reader :konbini + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field mb_way + sig { returns(MbWay) } + attr_reader :mb_way + # Attribute for field mobilepay + sig { returns(Mobilepay) } + attr_reader :mobilepay + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + # Attribute for field naver_pay + sig { returns(NaverPay) } + attr_reader :naver_pay + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + # Attribute for field payco + sig { returns(Payco) } + attr_reader :payco + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field pix + sig { returns(Pix) } + attr_reader :pix + # Attribute for field promptpay + sig { returns(Promptpay) } + attr_reader :promptpay + # Attribute for field qris + sig { returns(Qris) } + attr_reader :qris + # Attribute for field rechnung + sig { returns(Rechnung) } + attr_reader :rechnung + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field shopeepay + sig { returns(Shopeepay) } + attr_reader :shopeepay + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + # Attribute for field twint + sig { returns(Twint) } + attr_reader :twint + # The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + # Attribute for field zip + sig { returns(Zip) } + attr_reader :zip + end + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Data used for generating a Mandate. + sig { returns(T.nilable(MandateData)) } + attr_reader :mandate_data + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + sig { returns(T.nilable(String)) } + attr_reader :payment_intent + + # Payment-method-specific configuration for this ConfirmationToken. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + + # Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. + sig { returns(T.nilable(PaymentMethodPreview)) } + attr_reader :payment_method_preview + + # Return URL used to confirm the Intent. + sig { returns(T.nilable(String)) } + attr_reader :return_url + + # Indicates that you intend to make future payments with this ConfirmationToken's payment method. + # + # The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. + sig { returns(T.nilable(String)) } + attr_reader :setup_future_usage + + # ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. + sig { returns(T.nilable(String)) } + attr_reader :setup_intent + + # Shipping information collected on this ConfirmationToken. + sig { returns(T.nilable(Shipping)) } + attr_reader :shipping + + # Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to `true` on ConfirmationToken. + sig { returns(T::Boolean) } + attr_reader :use_stripe_sdk + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/connect_collection_transfer.rbi b/rbi/stripe/resources/connect_collection_transfer.rbi new file mode 100644 index 000000000..3aecb1eb1 --- /dev/null +++ b/rbi/stripe/resources/connect_collection_transfer.rbi @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class ConnectCollectionTransfer < APIResource + # Amount transferred, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # 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). + sig { returns(String) } + attr_reader :currency + + # ID of the account that funds are being collected for. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/country_spec.rbi b/rbi/stripe/resources/country_spec.rbi new file mode 100644 index 000000000..62bad5b38 --- /dev/null +++ b/rbi/stripe/resources/country_spec.rbi @@ -0,0 +1,69 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Stripe needs to collect certain pieces of information about each account + # created. These requirements can differ depending on the account's country. The + # Country Specs API makes these rules available to your integration. + # + # You can also view the information from this API call as [an online + # guide](https://stripe.com/docs/connect/required-verification-information). + class CountrySpec < APIResource + class VerificationFields < Stripe::StripeObject + class Company < Stripe::StripeObject + # Additional fields which are only required for some users. + sig { returns(T::Array[String]) } + attr_reader :additional + # Fields which every account must eventually provide. + sig { returns(T::Array[String]) } + attr_reader :minimum + end + class Individual < Stripe::StripeObject + # Additional fields which are only required for some users. + sig { returns(T::Array[String]) } + attr_reader :additional + # Fields which every account must eventually provide. + sig { returns(T::Array[String]) } + attr_reader :minimum + end + # Attribute for field company + sig { returns(Company) } + attr_reader :company + # Attribute for field individual + sig { returns(Individual) } + attr_reader :individual + end + # The default currency for this country. This applies to both payment methods and bank accounts. + sig { returns(String) } + attr_reader :default_currency + + # Unique identifier for the object. Represented as the ISO country code for this country. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Currencies that can be accepted in the specific country (for transfers). + sig { returns(T::Hash[String, T::Array[String]]) } + attr_reader :supported_bank_account_currencies + + # Currencies that can be accepted in the specified country (for payments). + sig { returns(T::Array[String]) } + attr_reader :supported_payment_currencies + + # Payment methods available in the specified country. You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). + sig { returns(T::Array[String]) } + attr_reader :supported_payment_methods + + # Countries that can accept transfers from the specified country. + sig { returns(T::Array[String]) } + attr_reader :supported_transfer_countries + + # Attribute for field verification_fields + sig { returns(VerificationFields) } + attr_reader :verification_fields + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/coupon.rbi b/rbi/stripe/resources/coupon.rbi new file mode 100644 index 000000000..a78aa22ec --- /dev/null +++ b/rbi/stripe/resources/coupon.rbi @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A coupon contains information about a percent-off or amount-off discount you + # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). + class Coupon < APIResource + class AppliesTo < Stripe::StripeObject + # A list of product IDs this coupon applies to + sig { returns(T::Array[String]) } + attr_reader :products + end + class CurrencyOptions < Stripe::StripeObject + # Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + sig { returns(Integer) } + attr_reader :amount_off + end + # Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_off + + # Attribute for field applies_to + sig { returns(AppliesTo) } + attr_reader :applies_to + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. + sig { returns(T.nilable(String)) } + attr_reader :currency + + # Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + sig { returns(T::Hash[String, CurrencyOptions]) } + attr_reader :currency_options + + # One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. + sig { returns(String) } + attr_reader :duration + + # If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. + sig { returns(T.nilable(Integer)) } + attr_reader :duration_in_months + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + sig { returns(T.nilable(Integer)) } + attr_reader :max_redemptions + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Name of the coupon displayed to customers on for instance invoices or receipts. + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. + sig { returns(T.nilable(Float)) } + attr_reader :percent_off + + # Date after which the coupon can no longer be redeemed. + sig { returns(T.nilable(Integer)) } + attr_reader :redeem_by + + # Number of times this coupon has been applied to a customer. + sig { returns(Integer) } + attr_reader :times_redeemed + + # Taking account of the above properties, whether this coupon can still be applied to a customer. + sig { returns(T::Boolean) } + attr_reader :valid + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/credit_note.rbi b/rbi/stripe/resources/credit_note.rbi new file mode 100644 index 000000000..d21ff6895 --- /dev/null +++ b/rbi/stripe/resources/credit_note.rbi @@ -0,0 +1,226 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Issue a credit note to adjust an invoice's amount after the invoice is finalized. + # + # Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes) + class CreditNote < APIResource + class DiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + sig { returns(Integer) } + attr_reader :amount + # The discount that was applied to get this discount amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + end + class PretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + sig { returns(Integer) } + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Billing::CreditBalanceTransaction)) } + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + # Type of the pretax credit amount referenced. + sig { returns(String) } + attr_reader :type + end + class Refund < Stripe::StripeObject + # Amount of the refund that applies to this credit note, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount_refunded + # ID of the refund. + sig { returns(T.any(String, Stripe::Refund)) } + attr_reader :refund + end + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # Total shipping cost before any taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_tax + # Total shipping cost after taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The ID of the ShippingRate for this invoice. + sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) } + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + class TaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + sig { returns(Integer) } + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + sig { returns(T::Boolean) } + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + sig { returns(T.any(String, Stripe::TaxRate)) } + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. + sig { returns(Integer) } + attr_reader :amount + + # This is the sum of all the shipping amounts. + sig { returns(Integer) } + attr_reader :amount_shipping + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # ID of the customer. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # Customer balance transaction related to this credit note. + sig { returns(T.nilable(T.any(String, Stripe::CustomerBalanceTransaction))) } + attr_reader :customer_balance_transaction + + # The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. + sig { returns(Integer) } + attr_reader :discount_amount + + # The aggregate amounts calculated per discount for all line items. + sig { returns(T::Array[DiscountAmount]) } + attr_reader :discount_amounts + + # The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. + sig { returns(T.nilable(Integer)) } + attr_reader :effective_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # ID of the invoice. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + + # Line items that make up the credit note + sig { returns(Stripe::ListObject) } + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Customer-facing text that appears on the credit note PDF. + sig { returns(T.nilable(String)) } + attr_reader :memo + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + sig { returns(String) } + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Amount that was credited outside of Stripe. + sig { returns(T.nilable(Integer)) } + attr_reader :out_of_band_amount + + # The link to download the PDF of the credit note. + sig { returns(String) } + attr_reader :pdf + + # Attribute for field post_payment_amount + sig { returns(Integer) } + attr_reader :post_payment_amount + + # Attribute for field pre_payment_amount + sig { returns(Integer) } + attr_reader :pre_payment_amount + + # The pretax credit amounts (ex: discount, credit grants, etc) for all line items. + sig { returns(T::Array[PretaxCreditAmount]) } + attr_reader :pretax_credit_amounts + + # Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` + sig { returns(T.nilable(String)) } + attr_reader :reason + + # Refund related to this credit note. + sig { returns(T.nilable(T.any(String, Stripe::Refund))) } + attr_reader :refund + + # Refunds related to this credit note. + sig { returns(T::Array[Refund]) } + attr_reader :refunds + + # The details of the cost of shipping, including the ShippingRate applied to the invoice. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). + sig { returns(String) } + attr_reader :status + + # The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. + sig { returns(Integer) } + attr_reader :subtotal + + # The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. + sig { returns(T.nilable(Integer)) } + attr_reader :subtotal_excluding_tax + + # The aggregate amounts calculated per tax rate for all line items. + sig { returns(T::Array[TaxAmount]) } + attr_reader :tax_amounts + + # The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. + sig { returns(Integer) } + attr_reader :total + + # The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. + sig { returns(T.nilable(Integer)) } + attr_reader :total_excluding_tax + + # Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. + sig { returns(String) } + attr_reader :type + + # The time that the credit note was voided. + sig { returns(T.nilable(Integer)) } + attr_reader :voided_at + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/credit_note_line_item.rbi b/rbi/stripe/resources/credit_note_line_item.rbi new file mode 100644 index 000000000..a33492b4b --- /dev/null +++ b/rbi/stripe/resources/credit_note_line_item.rbi @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # The credit note line item object + class CreditNoteLineItem < StripeObject + class DiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + sig { returns(Integer) } + attr_reader :amount + # The discount that was applied to get this discount amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + end + class PretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + sig { returns(Integer) } + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Billing::CreditBalanceTransaction)) } + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + # Type of the pretax credit amount referenced. + sig { returns(String) } + attr_reader :type + end + class TaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + sig { returns(Integer) } + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + sig { returns(T::Boolean) } + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + sig { returns(T.any(String, Stripe::TaxRate)) } + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. + sig { returns(Integer) } + attr_reader :amount + + # The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_excluding_tax + + # Description of the item being credited. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The integer amount in cents (or local equivalent) representing the discount being credited for this line item. + sig { returns(Integer) } + attr_reader :discount_amount + + # The amount of discount calculated per discount for this line item + sig { returns(T::Array[DiscountAmount]) } + attr_reader :discount_amounts + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # ID of the invoice line item being credited + sig { returns(String) } + attr_reader :invoice_line_item + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The pretax credit amounts (ex: discount, credit grants, etc) for this line item. + sig { returns(T::Array[PretaxCreditAmount]) } + attr_reader :pretax_credit_amounts + + # The number of units of product being credited. + sig { returns(T.nilable(Integer)) } + attr_reader :quantity + + # The amount of tax calculated per tax rate for this line item + sig { returns(T::Array[TaxAmount]) } + attr_reader :tax_amounts + + # The tax rates which apply to the line item. + sig { returns(T::Array[Stripe::TaxRate]) } + attr_reader :tax_rates + + # The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. + sig { returns(String) } + attr_reader :type + + # The cost of each unit of product being credited. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + + # The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_excluding_tax + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/customer.rbi b/rbi/stripe/resources/customer.rbi new file mode 100644 index 000000000..62ac8710a --- /dev/null +++ b/rbi/stripe/resources/customer.rbi @@ -0,0 +1,242 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # This object represents a customer of your business. Use it to [create recurring charges](https://stripe.com/docs/invoicing/customer), [save payment](https://stripe.com/docs/payments/save-during-payment) and contact information, + # and track payments that belong to the same customer. + class Customer < APIResource + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class InvoiceSettings < Stripe::StripeObject + class CustomField < Stripe::StripeObject + # The name of the custom field. + sig { returns(String) } + attr_reader :name + # The value of the custom field. + sig { returns(String) } + attr_reader :value + end + class RenderingOptions < Stripe::StripeObject + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + sig { returns(T.nilable(String)) } + attr_reader :amount_tax_display + # ID of the invoice rendering template to be used for this customer's invoices. If set, the template will be used on all invoices for this customer unless a template is set directly on the invoice. + sig { returns(T.nilable(String)) } + attr_reader :template + end + # Default custom fields to be displayed on invoices for this customer. + sig { returns(T.nilable(T::Array[CustomField])) } + attr_reader :custom_fields + # ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + # Default footer to be displayed on invoices for this customer. + sig { returns(T.nilable(String)) } + attr_reader :footer + # Default options for invoice PDF rendering for this customer. + sig { returns(T.nilable(RenderingOptions)) } + attr_reader :rendering_options + end + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class Tax < Stripe::StripeObject + class Location < Stripe::StripeObject + # The customer's country as identified by Stripe Tax. + sig { returns(String) } + attr_reader :country + # The data source used to infer the customer's location. + sig { returns(String) } + attr_reader :source + # The customer's state, county, province, or region as identified by Stripe Tax. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Surfaces if automatic tax computation is possible given the current customer location information. + sig { returns(String) } + attr_reader :automatic_tax + # A recent IP address of the customer used for tax reporting and tax location inference. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + # The customer's location as identified by Stripe Tax. + sig { returns(T.nilable(Location)) } + attr_reader :location + end + # The customer's address. + sig { returns(T.nilable(Address)) } + attr_reader :address + + # The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. + sig { returns(Integer) } + attr_reader :balance + + # The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. + sig { returns(T.nilable(Stripe::CashBalance)) } + attr_reader :cash_balance + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. + sig { returns(T.nilable(String)) } + attr_reader :currency + + # ID of the default payment source for the customer. + # + # If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. + sig { + returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)))) + } + attr_reader :default_source + + # Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. + # + # If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. + # + # If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :delinquent + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Describes the current discount active on the customer, if there is one. + sig { returns(T.nilable(Stripe::Discount)) } + attr_reader :discount + + # The customer's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. + sig { returns(T::Hash[String, Integer]) } + attr_reader :invoice_credit_balance + + # The prefix for the customer used to generate unique invoice numbers. + sig { returns(T.nilable(String)) } + attr_reader :invoice_prefix + + # Attribute for field invoice_settings + sig { returns(InvoiceSettings) } + attr_reader :invoice_settings + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The customer's full name or business name. + sig { returns(T.nilable(String)) } + attr_reader :name + + # The suffix of the customer's next invoice number (for example, 0001). When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses. + sig { returns(Integer) } + attr_reader :next_invoice_sequence + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The customer's phone number. + sig { returns(T.nilable(String)) } + attr_reader :phone + + # The customer's preferred locales (languages), ordered by preference. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + + # Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + sig { returns(T.nilable(Shipping)) } + attr_reader :shipping + + # The customer's payment sources, if any. + sig { returns(Stripe::ListObject) } + attr_reader :sources + + # The customer's current subscriptions, if any. + sig { returns(Stripe::ListObject) } + attr_reader :subscriptions + + # Attribute for field tax + sig { returns(Tax) } + attr_reader :tax + + # Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. + sig { returns(T.nilable(String)) } + attr_reader :tax_exempt + + # The customer's tax IDs. + sig { returns(Stripe::ListObject) } + attr_reader :tax_ids + + # ID of the test clock that this customer belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/customer_balance_transaction.rbi b/rbi/stripe/resources/customer_balance_transaction.rbi new file mode 100644 index 000000000..270d5942a --- /dev/null +++ b/rbi/stripe/resources/customer_balance_transaction.rbi @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value, + # which denotes a debit or credit that's automatically applied to their next invoice upon finalization. + # You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update), + # or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`. + # + # Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance) + class CustomerBalanceTransaction < APIResource + # The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. + sig { returns(Integer) } + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The ID of the credit note (if any) related to the transaction. + sig { returns(T.nilable(T.any(String, Stripe::CreditNote))) } + attr_reader :credit_note + + # 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). + sig { returns(String) } + attr_reader :currency + + # The ID of the customer the transaction belongs to. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The customer's `balance` after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. + sig { returns(Integer) } + attr_reader :ending_balance + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The ID of the invoice (if any) related to the transaction. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/customer_cash_balance_transaction.rbi b/rbi/stripe/resources/customer_cash_balance_transaction.rbi new file mode 100644 index 000000000..23eb765b4 --- /dev/null +++ b/rbi/stripe/resources/customer_cash_balance_transaction.rbi @@ -0,0 +1,165 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Customers with certain payments enabled have a cash balance, representing funds that were paid + # by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions + # represent when funds are moved into or out of this balance. This includes funding by the customer, allocation + # to payments, and refunds to the customer. + class CustomerCashBalanceTransaction < APIResource + class AdjustedForOverdraft < Stripe::StripeObject + # The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. + sig { returns(T.any(String, Stripe::BalanceTransaction)) } + attr_reader :balance_transaction + # The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. + sig { returns(T.any(String, Stripe::CustomerCashBalanceTransaction)) } + attr_reader :linked_transaction + end + class AppliedToPayment < Stripe::StripeObject + # The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + end + class Funded < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The BIC of the bank of the sender of the funding. + sig { returns(T.nilable(String)) } + attr_reader :bic + # The last 4 digits of the IBAN of the sender of the funding. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # The full name of the sender, as supplied by the sending bank. + sig { returns(T.nilable(String)) } + attr_reader :sender_name + end + class GbBankTransfer < Stripe::StripeObject + # The last 4 digits of the account number of the sender of the funding. + sig { returns(T.nilable(String)) } + attr_reader :account_number_last4 + # The full name of the sender, as supplied by the sending bank. + sig { returns(T.nilable(String)) } + attr_reader :sender_name + # The sort code of the bank of the sender of the funding + sig { returns(T.nilable(String)) } + attr_reader :sort_code + end + class JpBankTransfer < Stripe::StripeObject + # The name of the bank of the sender of the funding. + sig { returns(T.nilable(String)) } + attr_reader :sender_bank + # The name of the bank branch of the sender of the funding. + sig { returns(T.nilable(String)) } + attr_reader :sender_branch + # The full name of the sender, as supplied by the sending bank. + sig { returns(T.nilable(String)) } + attr_reader :sender_name + end + class UsBankTransfer < Stripe::StripeObject + # The banking network used for this funding. + sig { returns(String) } + attr_reader :network + # The full name of the sender, as supplied by the sending bank. + sig { returns(T.nilable(String)) } + attr_reader :sender_name + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # Attribute for field gb_bank_transfer + sig { returns(GbBankTransfer) } + attr_reader :gb_bank_transfer + # Attribute for field jp_bank_transfer + sig { returns(JpBankTransfer) } + attr_reader :jp_bank_transfer + # The user-supplied reference field on the bank transfer. + sig { returns(T.nilable(String)) } + attr_reader :reference + # The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_transfer + sig { returns(UsBankTransfer) } + attr_reader :us_bank_transfer + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + end + class RefundedFromPayment < Stripe::StripeObject + # The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. + sig { returns(T.any(String, Stripe::Refund)) } + attr_reader :refund + end + class TransferredToBalance < Stripe::StripeObject + # The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. + sig { returns(T.any(String, Stripe::BalanceTransaction)) } + attr_reader :balance_transaction + end + class UnappliedFromPayment < Stripe::StripeObject + # The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + end + # Attribute for field adjusted_for_overdraft + sig { returns(AdjustedForOverdraft) } + attr_reader :adjusted_for_overdraft + + # Attribute for field applied_to_payment + sig { returns(AppliedToPayment) } + attr_reader :applied_to_payment + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # The customer whose available cash balance changed as a result of this transaction. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # The total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :ending_balance + + # Attribute for field funded + sig { returns(Funded) } + attr_reader :funded + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. + sig { returns(Integer) } + attr_reader :net_amount + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field refunded_from_payment + sig { returns(RefundedFromPayment) } + attr_reader :refunded_from_payment + + # Attribute for field transferred_to_balance + sig { returns(TransferredToBalance) } + attr_reader :transferred_to_balance + + # The type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. + sig { returns(String) } + attr_reader :type + + # Attribute for field unapplied_from_payment + sig { returns(UnappliedFromPayment) } + attr_reader :unapplied_from_payment + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/customer_session.rbi b/rbi/stripe/resources/customer_session.rbi new file mode 100644 index 000000000..a1a5f6900 --- /dev/null +++ b/rbi/stripe/resources/customer_session.rbi @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A Customer Session allows you to grant Stripe's frontend SDKs (like Stripe.js) client-side access + # control over a Customer. + # + # Related guides: [Customer Session with the Payment Element](https://stripe.com/payments/accept-a-payment-deferred?platform=web&type=payment#save-payment-methods), + # [Customer Session with the Pricing Table](https://stripe.com/payments/checkout/pricing-table#customer-session), + # [Customer Session with the Buy Button](https://stripe.com/payment-links/buy-button#pass-an-existing-customer). + class CustomerSession < APIResource + class Components < Stripe::StripeObject + class BuyButton < Stripe::StripeObject + # Whether the buy button is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + end + class PaymentElement < Stripe::StripeObject + class Features < Stripe::StripeObject + # A list of [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) values that controls which saved payment methods the Payment Element displays by filtering to only show payment methods with an `allow_redisplay` value that is present in this list. + # + # If not specified, defaults to ["always"]. In order to display all saved payment methods, specify ["always", "limited", "unspecified"]. + sig { returns(T::Array[String]) } + attr_reader :payment_method_allow_redisplay_filters + # Controls whether or not the Payment Element shows saved payment methods. This parameter defaults to `disabled`. + sig { returns(String) } + attr_reader :payment_method_redisplay + # Determines the max number of saved payment methods for the Payment Element to display. This parameter defaults to `3`. + sig { returns(T.nilable(Integer)) } + attr_reader :payment_method_redisplay_limit + # Controls whether the Payment Element displays the option to remove a saved payment method. This parameter defaults to `disabled`. + # + # Allowing buyers to remove their saved payment methods impacts subscriptions that depend on that payment method. Removing the payment method detaches the [`customer` object](https://docs.stripe.com/api/payment_methods/object#payment_method_object-customer) from that [PaymentMethod](https://docs.stripe.com/api/payment_methods). + sig { returns(String) } + attr_reader :payment_method_remove + # Controls whether the Payment Element displays a checkbox offering to save a new payment method. This parameter defaults to `disabled`. + # + # If a customer checks the box, the [`allow_redisplay`](https://docs.stripe.com/api/payment_methods/object#payment_method_object-allow_redisplay) value on the PaymentMethod is set to `'always'` at confirmation time. For PaymentIntents, the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value is also set to the value defined in `payment_method_save_usage`. + sig { returns(String) } + attr_reader :payment_method_save + # When using PaymentIntents and the customer checks the save checkbox, this field determines the [`setup_future_usage`](https://docs.stripe.com/api/payment_intents/object#payment_intent_object-setup_future_usage) value used to confirm the PaymentIntent. + # + # When using SetupIntents, directly configure the [`usage`](https://docs.stripe.com/api/setup_intents/object#setup_intent_object-usage) value on SetupIntent creation. + sig { returns(T.nilable(String)) } + attr_reader :payment_method_save_usage + end + # Whether the Payment Element is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + # This hash defines whether the Payment Element supports certain features. + sig { returns(T.nilable(Features)) } + attr_reader :features + end + class PricingTable < Stripe::StripeObject + # Whether the pricing table is enabled. + sig { returns(T::Boolean) } + attr_reader :enabled + end + # This hash contains whether the buy button is enabled. + sig { returns(BuyButton) } + attr_reader :buy_button + # This hash contains whether the Payment Element is enabled and the features it supports. + sig { returns(PaymentElement) } + attr_reader :payment_element + # This hash contains whether the pricing table is enabled. + sig { returns(PricingTable) } + attr_reader :pricing_table + end + # The client secret of this Customer Session. Used on the client to set up secure access to the given `customer`. + # + # The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. + sig { returns(String) } + attr_reader :client_secret + + # Configuration for the components supported by this Customer Session. + sig { returns(Components) } + attr_reader :components + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The Customer the Customer Session was created for. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # The timestamp at which this Customer Session will expire. + sig { returns(Integer) } + attr_reader :expires_at + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/discount.rbi b/rbi/stripe/resources/discount.rbi new file mode 100644 index 000000000..6d06f1a41 --- /dev/null +++ b/rbi/stripe/resources/discount.rbi @@ -0,0 +1,65 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + class Discount < StripeObject + # The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode. + sig { returns(T.nilable(String)) } + attr_reader :checkout_session + + # A coupon contains information about a percent-off or amount-off discount you + # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). + sig { returns(Stripe::Coupon) } + attr_reader :coupon + + # The ID of the customer associated with this discount. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. + sig { returns(T.nilable(Integer)) } + attr_reader :end + + # The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array. + sig { returns(String) } + attr_reader :id + + # The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. + sig { returns(T.nilable(String)) } + attr_reader :invoice + + # The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. + sig { returns(T.nilable(String)) } + attr_reader :invoice_item + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The promotion code applied to create this discount. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + + # Date that the coupon was applied. + sig { returns(Integer) } + attr_reader :start + + # The subscription that this coupon is applied to, if it is applied to a particular subscription. + sig { returns(T.nilable(String)) } + attr_reader :subscription + + # The subscription item that this coupon is applied to, if it is applied to a particular subscription item. + sig { returns(T.nilable(String)) } + attr_reader :subscription_item + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/dispute.rbi b/rbi/stripe/resources/dispute.rbi new file mode 100644 index 000000000..46c672c1c --- /dev/null +++ b/rbi/stripe/resources/dispute.rbi @@ -0,0 +1,351 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A dispute occurs when a customer questions your charge with their card issuer. + # When this happens, you have the opportunity to respond to the dispute with + # evidence that shows that the charge is legitimate. + # + # Related guide: [Disputes and fraud](https://stripe.com/docs/disputes) + class Dispute < APIResource + class Evidence < Stripe::StripeObject + class EnhancedEvidence < Stripe::StripeObject + class VisaCompellingEvidence3 < Stripe::StripeObject + class DisputedTransaction < Stripe::StripeObject + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # User Account ID used to log into business platform. Must be recognizable by the user. + sig { returns(T.nilable(String)) } + attr_reader :customer_account_id + # Unique identifier of the cardholder’s device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + sig { returns(T.nilable(String)) } + attr_reader :customer_device_fingerprint + # Unique identifier of the cardholder’s device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + sig { returns(T.nilable(String)) } + attr_reader :customer_device_id + # The email address of the customer. + sig { returns(T.nilable(String)) } + attr_reader :customer_email_address + # The IP address that the customer used when making the purchase. + sig { returns(T.nilable(String)) } + attr_reader :customer_purchase_ip + # Categorization of disputed payment. + sig { returns(T.nilable(String)) } + attr_reader :merchandise_or_services + # A description of the product or service that was sold. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + class PriorUndisputedTransaction < Stripe::StripeObject + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Stripe charge ID for the Visa Compelling Evidence 3.0 eligible prior charge. + sig { returns(String) } + attr_reader :charge + # User Account ID used to log into business platform. Must be recognizable by the user. + sig { returns(T.nilable(String)) } + attr_reader :customer_account_id + # Unique identifier of the cardholder’s device derived from a combination of at least two hardware and software attributes. Must be at least 20 characters. + sig { returns(T.nilable(String)) } + attr_reader :customer_device_fingerprint + # Unique identifier of the cardholder’s device such as a device serial number (e.g., International Mobile Equipment Identity [IMEI]). Must be at least 15 characters. + sig { returns(T.nilable(String)) } + attr_reader :customer_device_id + # The email address of the customer. + sig { returns(T.nilable(String)) } + attr_reader :customer_email_address + # The IP address that the customer used when making the purchase. + sig { returns(T.nilable(String)) } + attr_reader :customer_purchase_ip + # A description of the product or service that was sold. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # The address to which a physical product was shipped. All fields are required for Visa Compelling Evidence 3.0 evidence submission. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + # Disputed transaction details for Visa Compelling Evidence 3.0 evidence submission. + sig { returns(T.nilable(DisputedTransaction)) } + attr_reader :disputed_transaction + # List of exactly two prior undisputed transaction objects for Visa Compelling Evidence 3.0 evidence submission. + sig { returns(T::Array[PriorUndisputedTransaction]) } + attr_reader :prior_undisputed_transactions + end + # Attribute for field visa_compelling_evidence_3 + sig { returns(VisaCompellingEvidence3) } + attr_reader :visa_compelling_evidence_3 + end + # Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. + sig { returns(T.nilable(String)) } + attr_reader :access_activity_log + # The billing address provided by the customer. + sig { returns(T.nilable(String)) } + attr_reader :billing_address + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :cancellation_policy + # An explanation of how and when the customer was shown your refund policy prior to purchase. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_policy_disclosure + # A justification for why the customer's subscription was not canceled. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_rebuttal + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :customer_communication + # The email address of the customer. + sig { returns(T.nilable(String)) } + attr_reader :customer_email_address + # The name of the customer. + sig { returns(T.nilable(String)) } + attr_reader :customer_name + # The IP address that the customer used when making the purchase. + sig { returns(T.nilable(String)) } + attr_reader :customer_purchase_ip + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :customer_signature + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :duplicate_charge_documentation + # An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. + sig { returns(T.nilable(String)) } + attr_reader :duplicate_charge_explanation + # The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. + sig { returns(T.nilable(String)) } + attr_reader :duplicate_charge_id + # Attribute for field enhanced_evidence + sig { returns(EnhancedEvidence) } + attr_reader :enhanced_evidence + # A description of the product or service that was sold. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :receipt + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :refund_policy + # Documentation demonstrating that the customer was shown your refund policy prior to purchase. + sig { returns(T.nilable(String)) } + attr_reader :refund_policy_disclosure + # A justification for why the customer is not entitled to a refund. + sig { returns(T.nilable(String)) } + attr_reader :refund_refusal_explanation + # The date on which the customer received or began receiving the purchased service, in a clear human-readable format. + sig { returns(T.nilable(String)) } + attr_reader :service_date + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :service_documentation + # The address to which a physical product was shipped. You should try to include as complete address information as possible. + sig { returns(T.nilable(String)) } + attr_reader :shipping_address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :shipping_carrier + # The date on which a physical product began its route to the shipping address, in a clear human-readable format. + sig { returns(T.nilable(String)) } + attr_reader :shipping_date + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :shipping_documentation + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :shipping_tracking_number + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :uncategorized_file + # Any additional evidence or statements. + sig { returns(T.nilable(String)) } + attr_reader :uncategorized_text + end + class EvidenceDetails < Stripe::StripeObject + class EnhancedEligibility < Stripe::StripeObject + class VisaCompellingEvidence3 < Stripe::StripeObject + # List of actions required to qualify dispute for Visa Compelling Evidence 3.0 evidence submission. + sig { returns(T::Array[String]) } + attr_reader :required_actions + # Visa Compelling Evidence 3.0 eligibility status. + sig { returns(String) } + attr_reader :status + end + # Attribute for field visa_compelling_evidence_3 + sig { returns(VisaCompellingEvidence3) } + attr_reader :visa_compelling_evidence_3 + end + # Date by which evidence must be submitted in order to successfully challenge dispute. Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. + sig { returns(T.nilable(Integer)) } + attr_reader :due_by + # Attribute for field enhanced_eligibility + sig { returns(EnhancedEligibility) } + attr_reader :enhanced_eligibility + # Whether evidence has been staged for this dispute. + sig { returns(T::Boolean) } + attr_reader :has_evidence + # Whether the last evidence submission was submitted past the due date. Defaults to `false` if no evidence submissions have occurred. If `true`, then delivery of the latest evidence is *not* guaranteed. + sig { returns(T::Boolean) } + attr_reader :past_due + # The number of times evidence has been submitted. Typically, you may only submit evidence once. + sig { returns(Integer) } + attr_reader :submission_count + end + class PaymentMethodDetails < Stripe::StripeObject + class AmazonPay < Stripe::StripeObject + # The AmazonPay dispute type, chargeback or claim + sig { returns(T.nilable(String)) } + attr_reader :dispute_type + end + class Card < Stripe::StripeObject + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(String) } + attr_reader :brand + # The type of dispute opened. Different case types may have varying fees and financial impact. + sig { returns(String) } + attr_reader :case_type + # The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. + sig { returns(T.nilable(String)) } + attr_reader :network_reason_code + end + class Klarna < Stripe::StripeObject + # The reason for the dispute as defined by Klarna + sig { returns(T.nilable(String)) } + attr_reader :reason_code + end + class Paypal < Stripe::StripeObject + # The ID of the dispute in PayPal. + sig { returns(T.nilable(String)) } + attr_reader :case_id + # The reason for the dispute as defined by PayPal + sig { returns(T.nilable(String)) } + attr_reader :reason_code + end + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Payment method type. + sig { returns(String) } + attr_reader :type + end + # Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). + sig { returns(Integer) } + attr_reader :amount + + # List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + sig { returns(T::Array[Stripe::BalanceTransaction]) } + attr_reader :balance_transactions + + # ID of the charge that's disputed. + sig { returns(T.any(String, Stripe::Charge)) } + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # List of eligibility types that are included in `enhanced_evidence`. + sig { returns(T::Array[String]) } + attr_reader :enhanced_eligibility_types + + # Attribute for field evidence + sig { returns(Evidence) } + attr_reader :evidence + + # Attribute for field evidence_details + sig { returns(EvidenceDetails) } + attr_reader :evidence_details + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. + sig { returns(T::Boolean) } + attr_reader :is_charge_refundable + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Network-dependent reason code for the dispute. + sig { returns(T.nilable(String)) } + attr_reader :network_reason_code + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the PaymentIntent that's disputed. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + + # Attribute for field payment_method_details + sig { returns(PaymentMethodDetails) } + attr_reader :payment_method_details + + # Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). + sig { returns(String) } + attr_reader :reason + + # Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. + sig { returns(String) } + attr_reader :status + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/entitlements/active_entitlement.rbi b/rbi/stripe/resources/entitlements/active_entitlement.rbi new file mode 100644 index 000000000..a63821be4 --- /dev/null +++ b/rbi/stripe/resources/entitlements/active_entitlement.rbi @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Entitlements + # An active entitlement describes access to a feature for a customer. + class ActiveEntitlement < APIResource + # The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. + sig { returns(T.any(String, Stripe::Entitlements::Feature)) } + attr_reader :feature + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # A unique key you provide as your own system identifier. This may be up to 80 characters. + sig { returns(String) } + attr_reader :lookup_key + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi b/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi new file mode 100644 index 000000000..7db89193f --- /dev/null +++ b/rbi/stripe/resources/entitlements/active_entitlement_summary.rbi @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Entitlements + # A summary of a customer's active entitlements. + class ActiveEntitlementSummary < APIResource + # The customer that is entitled to this feature. + sig { returns(String) } + attr_reader :customer + + # The list of entitlements this customer has. + sig { returns(Stripe::ListObject) } + attr_reader :entitlements + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/entitlements/feature.rbi b/rbi/stripe/resources/entitlements/feature.rbi new file mode 100644 index 000000000..38a2c8da6 --- /dev/null +++ b/rbi/stripe/resources/entitlements/feature.rbi @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Entitlements + # A feature represents a monetizable ability or functionality in your system. + # Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. + class Feature < APIResource + # Inactive features cannot be attached to new products and will not be returned from the features list endpoint. + sig { returns(T::Boolean) } + attr_reader :active + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # A unique key you provide as your own system identifier. This may be up to 80 characters. + sig { returns(String) } + attr_reader :lookup_key + + # Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The feature's name, for your own purpose, not meant to be displayable to the customer. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/ephemeral_key.rbi b/rbi/stripe/resources/ephemeral_key.rbi new file mode 100644 index 000000000..49a40d4d4 --- /dev/null +++ b/rbi/stripe/resources/ephemeral_key.rbi @@ -0,0 +1,31 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class EphemeralKey < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Time at which the key will expire. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :expires + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The key's secret. You can use this value to make authorized requests to the Stripe API. + sig { returns(String) } + attr_reader :secret + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/event.rbi b/rbi/stripe/resources/event.rbi new file mode 100644 index 000000000..7cd1e0ee3 --- /dev/null +++ b/rbi/stripe/resources/event.rbi @@ -0,0 +1,133 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Events are our way of letting you know when something interesting happens in + # your account. When an interesting event occurs, we create a new `Event` + # object. For example, when a charge succeeds, we create a `charge.succeeded` + # event, and when an invoice payment attempt fails, we create an + # `invoice.payment_failed` event. Certain API requests might create multiple + # events. For example, if you create a new subscription for a + # customer, you receive both a `customer.subscription.created` event and a + # `charge.succeeded` event. + # + # Events occur when the state of another API resource changes. The event's data + # field embeds the resource's state at the time of the change. For + # example, a `charge.succeeded` event contains a charge, and an + # `invoice.payment_failed` event contains an invoice. + # + # As with other API resources, you can use endpoints to retrieve an + # [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) + # from the API. We also have a separate + # [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the + # `Event` objects directly to an endpoint on your server. You can manage + # webhooks in your + # [account settings](https://dashboard.stripe.com/account/webhooks). Learn how + # to [listen for events](https://docs.stripe.com/webhooks) + # so that your integration can automatically trigger reactions. + # + # When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications + # that occur in connected accounts. For these events, there's an + # additional `account` attribute in the received `Event` object. + # + # We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) + # for 30 days. + class Event < APIResource + class Data < Stripe::StripeObject + # Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. + sig { returns(T::Hash[String, T.untyped]) } + attr_reader :object + # Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). If an array attribute has any updated elements, this object contains the entire array. In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. + sig { returns(T::Hash[String, T.untyped]) } + attr_reader :previous_attributes + end + class Reason < Stripe::StripeObject + class AutomationAction < Stripe::StripeObject + class StripeSendWebhookCustomEvent < Stripe::StripeObject + # Set of key-value pairs attached to the action when creating an Automation. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :custom_data + end + # Attribute for field stripe_send_webhook_custom_event + sig { returns(StripeSendWebhookCustomEvent) } + attr_reader :stripe_send_webhook_custom_event + # The trigger name of the automation that triggered this action. + # Please visit [Revenue and retention automations](https://docs.stripe.com/billing/automations#choose-a-trigger) for all possible trigger names. + sig { returns(String) } + attr_reader :trigger + # The type of the `automation_action`. + sig { returns(String) } + attr_reader :type + end + class Request < Stripe::StripeObject + # ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + sig { returns(T.nilable(String)) } + attr_reader :id + # The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*. + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + end + # Attribute for field automation_action + sig { returns(AutomationAction) } + attr_reader :automation_action + # Attribute for field request + sig { returns(Request) } + attr_reader :request + # The type of the reason for the event. + sig { returns(String) } + attr_reader :type + end + class Request < Stripe::StripeObject + # ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. + sig { returns(T.nilable(String)) } + attr_reader :id + # The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*. + sig { returns(T.nilable(String)) } + attr_reader :idempotency_key + end + # The connected account that originates the event. + sig { returns(String) } + attr_reader :account + + # The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014. + sig { returns(T.nilable(String)) } + attr_reader :api_version + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Attribute for field data + sig { returns(Data) } + attr_reader :data + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. + sig { returns(Integer) } + attr_reader :pending_webhooks + + # Information about the action that causes the event. Only present when the event is triggered by an API request or an [Automation](https://docs.stripe.com/billing/automations) action. + sig { returns(T.nilable(Reason)) } + attr_reader :reason + + # Information on the API request that triggers the event. + sig { returns(T.nilable(Request)) } + attr_reader :request + + # Description of the event (for example, `invoice.created` or `charge.refunded`). + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/exchange_rate.rbi b/rbi/stripe/resources/exchange_rate.rbi new file mode 100644 index 000000000..10eccf63f --- /dev/null +++ b/rbi/stripe/resources/exchange_rate.rbi @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # `ExchangeRate` objects allow you to determine the rates that Stripe is currently + # using to convert from one currency to another. Since this number is variable + # throughout the day, there are various reasons why you might want to know the current + # rate (for example, to dynamically price an item for a user with a default + # payment in a foreign currency). + # + # Please refer to our [Exchange Rates API](https://stripe.com/docs/fx-rates) guide for more details. + # + # *[Note: this integration path is supported but no longer recommended]* Additionally, + # you can guarantee that a charge is made with an exchange rate that you expect is + # current. To do so, you must pass in the exchange_rate to charges endpoints. If the + # value is no longer up to date, the charge won't go through. Please refer to our + # [Using with charges](https://stripe.com/docs/exchange-rates) guide for more details. + # + # ----- + # + #   + # + # *This Exchange Rates API is a Beta Service and is subject to Stripe's terms of service. You may use the API solely for the purpose of transacting on Stripe. For example, the API may be queried in order to:* + # + # - *localize prices for processing payments on Stripe* + # - *reconcile Stripe transactions* + # - *determine how much money to send to a connected account* + # - *determine app fees to charge a connected account* + # + # *Using this Exchange Rates API beta for any purpose other than to transact on Stripe is strictly prohibited and constitutes a violation of Stripe's terms of service.* + class ExchangeRate < APIResource + # Unique identifier for the object. Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + sig { returns(T::Hash[String, Float]) } + attr_reader :rates + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/file.rbi b/rbi/stripe/resources/file.rbi new file mode 100644 index 000000000..d386a998a --- /dev/null +++ b/rbi/stripe/resources/file.rbi @@ -0,0 +1,58 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # This object represents files hosted on Stripe's servers. You can upload + # files with the [create file](https://stripe.com/docs/api#create_file) request + # (for example, when uploading dispute evidence). Stripe also + # creates files independently (for example, the results of a [Sigma scheduled + # query](https://stripe.com/docs/api#scheduled_queries)). + # + # Related guide: [File upload guide](https://stripe.com/docs/file-upload) + class File < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The file expires and isn't available at this time in epoch seconds. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # The suitable name for saving the file to a filesystem. + sig { returns(T.nilable(String)) } + attr_reader :filename + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. + sig { returns(T.nilable(Stripe::ListObject)) } + attr_reader :links + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. + sig { returns(String) } + attr_reader :purpose + + # The size of the file object in bytes. + sig { returns(Integer) } + attr_reader :size + + # A suitable title for the document. + sig { returns(T.nilable(String)) } + attr_reader :title + + # The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). + sig { returns(T.nilable(String)) } + attr_reader :type + + # Use your live secret API key to download the file from this URL. + sig { returns(T.nilable(String)) } + attr_reader :url + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/file_link.rbi b/rbi/stripe/resources/file_link.rbi new file mode 100644 index 000000000..1b77787d0 --- /dev/null +++ b/rbi/stripe/resources/file_link.rbi @@ -0,0 +1,46 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # To share the contents of a `File` object with non-Stripe users, you can + # create a `FileLink`. `FileLink`s contain a URL that you can use to + # retrieve the contents of the file without authentication. + class FileLink < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Returns if the link is already expired. + sig { returns(T::Boolean) } + attr_reader :expired + + # Time that the link expires. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # The file object this link points to. + sig { returns(T.any(String, Stripe::File)) } + attr_reader :file + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The publicly accessible URL to download the file. + sig { returns(T.nilable(String)) } + attr_reader :url + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/account.rbi b/rbi/stripe/resources/financial_connections/account.rbi new file mode 100644 index 000000000..1f32fe8ad --- /dev/null +++ b/rbi/stripe/resources/financial_connections/account.rbi @@ -0,0 +1,200 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. + class Account < APIResource + class AccountHolder < Stripe::StripeObject + # The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + # Type of account holder that this account belongs to. + sig { returns(String) } + attr_reader :type + end + class Balance < Stripe::StripeObject + class Cash < Stripe::StripeObject + # The funds available to the account holder. Typically this is the current balance after subtracting any outbound pending transactions and adding any inbound pending transactions. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + sig { returns(T.nilable(T::Hash[String, Integer])) } + attr_reader :available + end + class Credit < Stripe::StripeObject + # The credit that has been used by the account holder. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + sig { returns(T.nilable(T::Hash[String, Integer])) } + attr_reader :used + end + # The time that the external institution calculated this balance. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :as_of + # Attribute for field cash + sig { returns(Cash) } + attr_reader :cash + # Attribute for field credit + sig { returns(Credit) } + attr_reader :credit + # The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + sig { returns(T::Hash[String, Integer]) } + attr_reader :current + # The `type` of the balance. An additional hash is included on the balance with a name matching this value. + sig { returns(String) } + attr_reader :type + end + class BalanceRefresh < Stripe::StripeObject + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :last_attempted_at + # Time at which the next balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + sig { returns(String) } + attr_reader :status + end + class InferredBalancesRefresh < Stripe::StripeObject + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :last_attempted_at + # Time at which the next inferred balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + sig { returns(String) } + attr_reader :status + end + class OwnershipRefresh < Stripe::StripeObject + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :last_attempted_at + # Time at which the next ownership refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + sig { returns(String) } + attr_reader :status + end + class TransactionRefresh < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + # The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :last_attempted_at + # Time at which the next transaction refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :next_refresh_available_at + # The status of the last refresh attempt. + sig { returns(String) } + attr_reader :status + end + # The account holder that this account belongs to. + sig { returns(T.nilable(AccountHolder)) } + attr_reader :account_holder + + # The most recent information about the account's balance. + sig { returns(T.nilable(Balance)) } + attr_reader :balance + + # The state of the most recent attempt to refresh the account balance. + sig { returns(T.nilable(BalanceRefresh)) } + attr_reader :balance_refresh + + # The type of the account. Account category is further divided in `subcategory`. + sig { returns(String) } + attr_reader :category + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # A human-readable name that has been assigned to this account, either by the account holder or by the institution. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The state of the most recent attempt to refresh the account's inferred balance history. + sig { returns(T.nilable(InferredBalancesRefresh)) } + attr_reader :inferred_balances_refresh + + # The name of the institution that holds this account. + sig { returns(String) } + attr_reader :institution_name + + # The last 4 digits of the account number. If present, this will be 4 numeric characters. + sig { returns(T.nilable(String)) } + attr_reader :last4 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The most recent information about the account's owners. + sig { returns(T.nilable(T.any(String, Stripe::FinancialConnections::AccountOwnership))) } + attr_reader :ownership + + # The state of the most recent attempt to refresh the account owners. + sig { returns(T.nilable(OwnershipRefresh)) } + attr_reader :ownership_refresh + + # The list of permissions granted by this account. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :permissions + + # The status of the link to the account. + sig { returns(String) } + attr_reader :status + + # If `category` is `cash`, one of: + # + # - `checking` + # - `savings` + # - `other` + # + # If `category` is `credit`, one of: + # + # - `mortgage` + # - `line_of_credit` + # - `credit_card` + # - `other` + # + # If `category` is `investment` or `other`, this will be `other`. + sig { returns(String) } + attr_reader :subcategory + + # The list of data refresh subscriptions requested on this account. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :subscriptions + + # The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. + sig { returns(T::Array[String]) } + attr_reader :supported_payment_method_types + + # The state of the most recent attempt to refresh the account transactions. + sig { returns(T.nilable(TransactionRefresh)) } + attr_reader :transaction_refresh + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/account_inferred_balance.rbi b/rbi/stripe/resources/financial_connections/account_inferred_balance.rbi new file mode 100644 index 000000000..4a2a09762 --- /dev/null +++ b/rbi/stripe/resources/financial_connections/account_inferred_balance.rbi @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # A historical balance for the account on a particular day. It may be sourced from a balance snapshot provided by a financial institution, or inferred using transactions data. + class AccountInferredBalance < APIResource + # The time for which this balance was calculated, measured in seconds since the Unix epoch. If the balance was computed by Stripe and not provided directly by a financial institution, it will always be 23:59:59 UTC. + sig { returns(Integer) } + attr_reader :as_of + + # The balances owed to (or by) the account holder, before subtracting any outbound pending transactions or adding any inbound pending transactions. + # + # Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + # + # Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. + sig { returns(T::Hash[String, Integer]) } + attr_reader :current + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/account_owner.rbi b/rbi/stripe/resources/financial_connections/account_owner.rbi new file mode 100644 index 000000000..c80ba872f --- /dev/null +++ b/rbi/stripe/resources/financial_connections/account_owner.rbi @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # Describes an owner of an account. + class AccountOwner < StripeObject + # The email address of the owner. + sig { returns(T.nilable(String)) } + attr_reader :email + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The full name of the owner. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ownership object that this owner belongs to. + sig { returns(String) } + attr_reader :ownership + + # The raw phone number of the owner. + sig { returns(T.nilable(String)) } + attr_reader :phone + + # The raw physical address of the owner. + sig { returns(T.nilable(String)) } + attr_reader :raw_address + + # The timestamp of the refresh that updated this owner. + sig { returns(T.nilable(Integer)) } + attr_reader :refreshed_at + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/account_ownership.rbi b/rbi/stripe/resources/financial_connections/account_ownership.rbi new file mode 100644 index 000000000..6784a4477 --- /dev/null +++ b/rbi/stripe/resources/financial_connections/account_ownership.rbi @@ -0,0 +1,26 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # Describes a snapshot of the owners of an account at a particular point in time. + class AccountOwnership < StripeObject + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # A paginated list of owners for this account. + sig { returns(Stripe::ListObject) } + attr_reader :owners + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/institution.rbi b/rbi/stripe/resources/financial_connections/institution.rbi new file mode 100644 index 000000000..ad1534ab3 --- /dev/null +++ b/rbi/stripe/resources/financial_connections/institution.rbi @@ -0,0 +1,76 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # An institution represents a financial institution to which an end user can connect using the Financial Connections authentication flow. + class Institution < APIResource + class Features < Stripe::StripeObject + class Balances < Stripe::StripeObject + # Whether the given feature is supported by this institution. + sig { returns(T::Boolean) } + attr_reader :supported + end + class Ownership < Stripe::StripeObject + # Whether the given feature is supported by this institution. + sig { returns(T::Boolean) } + attr_reader :supported + end + class PaymentMethod < Stripe::StripeObject + # Whether the given feature is supported by this institution. + sig { returns(T::Boolean) } + attr_reader :supported + end + class Transactions < Stripe::StripeObject + # Whether the given feature is supported by this institution. + sig { returns(T::Boolean) } + attr_reader :supported + end + # Attribute for field balances + sig { returns(Balances) } + attr_reader :balances + # Attribute for field ownership + sig { returns(Ownership) } + attr_reader :ownership + # Attribute for field payment_method + sig { returns(PaymentMethod) } + attr_reader :payment_method + # Attribute for field transactions + sig { returns(Transactions) } + attr_reader :transactions + end + # Attribute for field features + sig { returns(Features) } + attr_reader :features + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The name of this institution. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # A list of routing numbers which are known to correspond to this institution. Due to the many to many relationship between institutions and routing numbers, this list may not be comprehensive and routing numbers may also be shared between institutions. + sig { returns(T::Array[String]) } + attr_reader :routing_numbers + + # The status of this institution in the Financial Connections authentication flow. + sig { returns(String) } + attr_reader :status + + # A URL corresponding to this institution. This URL is also displayed in the authentication flow to help end users confirm that they are authenticating with the right institution. + sig { returns(T.nilable(String)) } + attr_reader :url + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/session.rbi b/rbi/stripe/resources/financial_connections/session.rbi new file mode 100644 index 000000000..80457723f --- /dev/null +++ b/rbi/stripe/resources/financial_connections/session.rbi @@ -0,0 +1,104 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. + class Session < APIResource + class AccountHolder < Stripe::StripeObject + # The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + # Type of account holder that this account belongs to. + sig { returns(String) } + attr_reader :type + end + class Filters < Stripe::StripeObject + # Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :account_subcategories + # List of countries from which to filter accounts. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :countries + # Stripe ID of the institution with which the customer should be directed to log in. + sig { returns(String) } + attr_reader :institution + end + class Limits < Stripe::StripeObject + # The number of accounts that can be linked in this Session. + sig { returns(Integer) } + attr_reader :accounts + end + class ManualEntry < Stripe::StripeObject; end + class StatusDetails < Stripe::StripeObject + class Cancelled < Stripe::StripeObject + # The reason for the Session being cancelled. + sig { returns(String) } + attr_reader :reason + end + # Attribute for field cancelled + sig { returns(Cancelled) } + attr_reader :cancelled + end + # The account holder for whom accounts are collected in this session. + sig { returns(T.nilable(AccountHolder)) } + attr_reader :account_holder + + # The accounts that were collected as part of this Session. + sig { returns(Stripe::ListObject) } + attr_reader :accounts + + # A value that will be passed to the client to launch the authentication flow. + sig { returns(String) } + attr_reader :client_secret + + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field limits + sig { returns(Limits) } + attr_reader :limits + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Attribute for field manual_entry + sig { returns(ManualEntry) } + attr_reader :manual_entry + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Permissions requested for accounts collected during this session. + sig { returns(T::Array[String]) } + attr_reader :permissions + + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + sig { returns(String) } + attr_reader :return_url + + # The current state of the session. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_details + sig { returns(StatusDetails) } + attr_reader :status_details + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/financial_connections/transaction.rbi b/rbi/stripe/resources/financial_connections/transaction.rbi new file mode 100644 index 000000000..dba6d14b6 --- /dev/null +++ b/rbi/stripe/resources/financial_connections/transaction.rbi @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module FinancialConnections + # A Transaction represents a real transaction that affects a Financial Connections Account balance. + class Transaction < APIResource + class StatusTransitions < Stripe::StripeObject + # Time at which this transaction posted. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :posted_at + # Time at which this transaction was voided. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :void_at + end + # The ID of the Financial Connections Account this transaction belongs to. + sig { returns(String) } + attr_reader :account + + # The amount of this transaction, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # 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). + sig { returns(String) } + attr_reader :currency + + # The description of this transaction. + sig { returns(String) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The status of the transaction. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # Time at which the transaction was transacted. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :transacted_at + + # The token of the transaction refresh that last updated or created this transaction. + sig { returns(String) } + attr_reader :transaction_refresh + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/forwarding/request.rbi b/rbi/stripe/resources/forwarding/request.rbi new file mode 100644 index 000000000..eb7db33fc --- /dev/null +++ b/rbi/stripe/resources/forwarding/request.rbi @@ -0,0 +1,115 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Forwarding + # Instructs Stripe to make a request on your behalf using the destination URL. The destination URL + # is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials + # provided during onboarding, and injects card details from the payment_method into the request. + # + # Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers, + # before storing the request and response data in the forwarding Request object, which are subject to a + # 30-day retention period. + # + # You can provide a Stripe idempotency key to make sure that requests with the same key result in only one + # outbound request. The Stripe idempotency key provided should be unique and different from any idempotency + # keys provided on the underlying third-party request. + # + # Forwarding Requests are synchronous requests that return a response or time out according to + # Stripe's limits. + # + # Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding). + class Request < APIResource + class RequestContext < Stripe::StripeObject + # The time it took in milliseconds for the destination endpoint to respond. + sig { returns(Integer) } + attr_reader :destination_duration + # The IP address of the destination. + sig { returns(String) } + attr_reader :destination_ip_address + end + class RequestDetails < Stripe::StripeObject + class Header < Stripe::StripeObject + # The header name. + sig { returns(String) } + attr_reader :name + # The header value. + sig { returns(String) } + attr_reader :value + end + # The body payload to send to the destination endpoint. + sig { returns(String) } + attr_reader :body + # The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. + sig { returns(T::Array[Header]) } + attr_reader :headers + # The HTTP method used to call the destination endpoint. + sig { returns(String) } + attr_reader :http_method + end + class ResponseDetails < Stripe::StripeObject + class Header < Stripe::StripeObject + # The header name. + sig { returns(String) } + attr_reader :name + # The header value. + sig { returns(String) } + attr_reader :value + end + # The response body from the destination endpoint to Stripe. + sig { returns(String) } + attr_reader :body + # HTTP headers that the destination endpoint returned. + sig { returns(T::Array[Header]) } + attr_reader :headers + # The HTTP status code that the destination endpoint returned. + sig { returns(Integer) } + attr_reader :status + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. + sig { returns(String) } + attr_reader :payment_method + + # The field kinds to be replaced in the forwarded request. + sig { returns(T::Array[String]) } + attr_reader :replacements + + # Context about the request from Stripe's servers to the destination endpoint. + sig { returns(T.nilable(RequestContext)) } + attr_reader :request_context + + # The request that was sent to the destination endpoint. We redact any sensitive fields. + sig { returns(T.nilable(RequestDetails)) } + attr_reader :request_details + + # The response that the destination endpoint returned to us. We redact any sensitive fields. + sig { returns(T.nilable(ResponseDetails)) } + attr_reader :response_details + + # The destination URL for the forwarded request. Must be supported by the config. + sig { returns(T.nilable(String)) } + attr_reader :url + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/funding_instructions.rbi b/rbi/stripe/resources/funding_instructions.rbi new file mode 100644 index 000000000..8fbb87eda --- /dev/null +++ b/rbi/stripe/resources/funding_instructions.rbi @@ -0,0 +1,441 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is + # automatically applied to future invoices and payments using the `customer_balance` payment method. + # Customers can fund this balance by initiating a bank transfer to any account in the + # `financial_addresses` field. + # Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions) + class FundingInstructions < APIResource + class BankTransfer < Stripe::StripeObject + class FinancialAddress < Stripe::StripeObject + class Aba < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(String) } + attr_reader :account_holder_name + # The ABA account number + sig { returns(String) } + attr_reader :account_number + # The account type + sig { returns(String) } + attr_reader :account_type + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The bank name + sig { returns(String) } + attr_reader :bank_name + # The ABA routing number + sig { returns(String) } + attr_reader :routing_number + end + class Iban < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + sig { returns(String) } + attr_reader :account_holder_name + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The BIC/SWIFT code of the account. + sig { returns(String) } + attr_reader :bic + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # The IBAN of the account. + sig { returns(String) } + attr_reader :iban + end + class SortCode < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + sig { returns(String) } + attr_reader :account_holder_name + # The account number + sig { returns(String) } + attr_reader :account_number + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The six-digit sort code + sig { returns(String) } + attr_reader :sort_code + end + class Spei < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(String) } + attr_reader :account_holder_name + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The three-digit bank code + sig { returns(String) } + attr_reader :bank_code + # The short banking institution name + sig { returns(String) } + attr_reader :bank_name + # The CLABE number + sig { returns(String) } + attr_reader :clabe + end + class Swift < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(String) } + attr_reader :account_holder_name + # The account number + sig { returns(String) } + attr_reader :account_number + # The account type + sig { returns(String) } + attr_reader :account_type + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The bank name + sig { returns(String) } + attr_reader :bank_name + # The SWIFT code + sig { returns(String) } + attr_reader :swift_code + end + class Zengin < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(T.nilable(String)) } + attr_reader :account_holder_name + # The account number + sig { returns(T.nilable(String)) } + attr_reader :account_number + # The bank account type. In Japan, this can only be `futsu` or `toza`. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The bank code of the account + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # The bank name of the account + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # The branch code of the account + sig { returns(T.nilable(String)) } + attr_reader :branch_code + # The branch name of the account + sig { returns(T.nilable(String)) } + attr_reader :branch_name + end + # ABA Records contain U.S. bank account details per the ABA format. + sig { returns(Aba) } + attr_reader :aba + # Iban Records contain E.U. bank account details per the SEPA format. + sig { returns(Iban) } + attr_reader :iban + # Sort Code Records contain U.K. bank account details per the sort code format. + sig { returns(SortCode) } + attr_reader :sort_code + # SPEI Records contain Mexico bank account details per the SPEI format. + sig { returns(Spei) } + attr_reader :spei + # The payment networks supported by this FinancialAddress + sig { returns(T::Array[String]) } + attr_reader :supported_networks + # SWIFT Records contain U.S. bank account details per the SWIFT format. + sig { returns(Swift) } + attr_reader :swift + # The type of financial address + sig { returns(String) } + attr_reader :type + # Zengin Records contain Japan bank account details per the Zengin format. + sig { returns(Zengin) } + attr_reader :zengin + end + # The country of the bank account to fund + sig { returns(String) } + attr_reader :country + # A list of financial addresses that can be used to fund a particular balance + sig { returns(T::Array[FinancialAddress]) } + attr_reader :financial_addresses + # The bank_transfer type + sig { returns(String) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + + # 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). + sig { returns(String) } + attr_reader :currency + + # The `funding_type` of the returned instructions + sig { returns(String) } + attr_reader :funding_type + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/gift_cards/card.rbi b/rbi/stripe/resources/gift_cards/card.rbi new file mode 100644 index 000000000..e5dd29202 --- /dev/null +++ b/rbi/stripe/resources/gift_cards/card.rbi @@ -0,0 +1,90 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module GiftCards + # A gift card represents a single gift card owned by a customer, including the + # remaining balance, gift card code, and whether or not it is active. + class Card < APIResource + class CreatedBy < Stripe::StripeObject + class Checkout < Stripe::StripeObject + # The Stripe CheckoutSession that created this object. + sig { returns(String) } + attr_reader :checkout_session + # The Stripe CheckoutSession LineItem that created this object. + sig { returns(T.nilable(String)) } + attr_reader :line_item + end + class Order < Stripe::StripeObject + # The Stripe Order LineItem that created this object. + sig { returns(T.nilable(String)) } + attr_reader :line_item + # The Stripe Order that created this object. + sig { returns(String) } + attr_reader :order + end + class Payment < Stripe::StripeObject + # The PaymentIntent that created this object. + sig { returns(String) } + attr_reader :payment_intent + end + # Attribute for field checkout + sig { returns(Checkout) } + attr_reader :checkout + # Attribute for field order + sig { returns(Order) } + attr_reader :order + # Attribute for field payment + sig { returns(Payment) } + attr_reader :payment + # The type of event that created this object. + sig { returns(String) } + attr_reader :type + end + # Whether this gift card can be used or not. + sig { returns(T::Boolean) } + attr_reader :active + + # The amount of funds available for new transactions. + sig { returns(Integer) } + attr_reader :amount_available + + # The amount of funds marked as held. + sig { returns(Integer) } + attr_reader :amount_held + + # Code used to redeem this gift card. + sig { returns(T.nilable(String)) } + attr_reader :code + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The related Stripe objects that created this gift card. + sig { returns(T.nilable(CreatedBy)) } + attr_reader :created_by + + # 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). + sig { returns(String) } + attr_reader :currency + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Transactions on this gift card. + sig { returns(Stripe::ListObject) } + attr_reader :transactions + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/gift_cards/transaction.rbi b/rbi/stripe/resources/gift_cards/transaction.rbi new file mode 100644 index 000000000..e85e2294b --- /dev/null +++ b/rbi/stripe/resources/gift_cards/transaction.rbi @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module GiftCards + # A gift card transaction represents a single transaction on a referenced gift card. + # A transaction is in one of three states, `confirmed`, `held` or `canceled`. A `confirmed` + # transaction is one that has added/deducted funds. A `held` transaction has created a + # temporary hold on funds, which can then be cancelled or confirmed. A `held` transaction + # can be confirmed into a `confirmed` transaction, or canceled into a `canceled` transaction. + # A `canceled` transaction has no effect on a gift card's balance. + class Transaction < APIResource + class CreatedBy < Stripe::StripeObject + class Checkout < Stripe::StripeObject + # The Stripe CheckoutSession that created this object. + sig { returns(String) } + attr_reader :checkout_session + # The Stripe CheckoutSession LineItem that created this object. + sig { returns(T.nilable(String)) } + attr_reader :line_item + end + class Order < Stripe::StripeObject + # The Stripe Order LineItem that created this object. + sig { returns(T.nilable(String)) } + attr_reader :line_item + # The Stripe Order that created this object. + sig { returns(String) } + attr_reader :order + end + class Payment < Stripe::StripeObject + # The PaymentIntent that created this object. + sig { returns(String) } + attr_reader :payment_intent + end + # Attribute for field checkout + sig { returns(Checkout) } + attr_reader :checkout + # Attribute for field order + sig { returns(Order) } + attr_reader :order + # Attribute for field payment + sig { returns(Payment) } + attr_reader :payment + # The type of event that created this object. + sig { returns(String) } + attr_reader :type + end + # The amount of this transaction. A positive value indicates that funds were added to the gift card. A negative value indicates that funds were removed from the gift card. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + # Time at which the transaction was confirmed. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :confirmed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :created + + # The related Stripe objects that created this gift card transaction. + sig { returns(T.nilable(CreatedBy)) } + attr_reader :created_by + + # 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). + sig { returns(T.nilable(String)) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The gift card that this transaction occurred on + sig { returns(T.nilable(String)) } + attr_reader :gift_card + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Status of this transaction, one of `held`, `confirmed`, or `canceled`. + sig { returns(T.nilable(String)) } + attr_reader :status + + # A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + sig { returns(T.nilable(String)) } + attr_reader :transfer_group + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/identity/verification_report.rbi b/rbi/stripe/resources/identity/verification_report.rbi new file mode 100644 index 000000000..0fe1c84c5 --- /dev/null +++ b/rbi/stripe/resources/identity/verification_report.rbi @@ -0,0 +1,300 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Identity + # A VerificationReport is the result of an attempt to collect and verify data from a user. + # The collection of verification checks performed is determined from the `type` and `options` + # parameters used. You can find the result of each verification check performed in the + # appropriate sub-resource: `document`, `id_number`, `selfie`. + # + # Each VerificationReport contains a copy of any data collected by the user as well as + # reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files) + # API. To configure and create VerificationReports, use the + # [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. + # + # Related guide: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). + class VerificationReport < APIResource + class Document < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class Dob < Stripe::StripeObject + # Numerical day between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # Numerical month between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + sig { returns(T.nilable(String)) } + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + class ExpirationDate < Stripe::StripeObject + # Numerical day between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # Numerical month between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + class IssuedDate < Stripe::StripeObject + # Numerical day between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # Numerical month between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + # Address as it appears in the document. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Date of birth as it appears in the document. + sig { returns(T.nilable(Dob)) } + attr_reader :dob + # Details on the verification error. Present when status is `unverified`. + sig { returns(T.nilable(Error)) } + attr_reader :error + # Expiration date of the document. + sig { returns(T.nilable(ExpirationDate)) } + attr_reader :expiration_date + # Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :files + # First name as it appears in the document. + sig { returns(T.nilable(String)) } + attr_reader :first_name + # Issued date of the document. + sig { returns(T.nilable(IssuedDate)) } + attr_reader :issued_date + # Issuing country of the document. + sig { returns(T.nilable(String)) } + attr_reader :issuing_country + # Last name as it appears in the document. + sig { returns(T.nilable(String)) } + attr_reader :last_name + # Document ID number. + sig { returns(T.nilable(String)) } + attr_reader :number + # Status of this `document` check. + sig { returns(String) } + attr_reader :status + # Type of the document. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Email < Stripe::StripeObject + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + sig { returns(T.nilable(String)) } + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + # Email to be verified. + sig { returns(T.nilable(String)) } + attr_reader :email + # Details on the verification error. Present when status is `unverified`. + sig { returns(T.nilable(Error)) } + attr_reader :error + # Status of this `email` check. + sig { returns(String) } + attr_reader :status + end + class IdNumber < Stripe::StripeObject + class Dob < Stripe::StripeObject + # Numerical day between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # Numerical month between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + sig { returns(T.nilable(String)) } + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + # Date of birth. + sig { returns(T.nilable(Dob)) } + attr_reader :dob + # Details on the verification error. Present when status is `unverified`. + sig { returns(T.nilable(Error)) } + attr_reader :error + # First name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + # ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present. + sig { returns(T.nilable(String)) } + attr_reader :id_number + # Type of ID number. + sig { returns(T.nilable(String)) } + attr_reader :id_number_type + # Last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + # Status of this `id_number` check. + sig { returns(String) } + attr_reader :status + end + class Options < Stripe::StripeObject + class Document < Stripe::StripeObject + # Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + sig { returns(T::Array[String]) } + attr_reader :allowed_types + # Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + sig { returns(T::Boolean) } + attr_reader :require_id_number + # Disable image uploads, identity document images have to be captured using the device’s camera. + sig { returns(T::Boolean) } + attr_reader :require_live_capture + # Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. [Learn more](https://stripe.com/docs/identity/selfie). + sig { returns(T::Boolean) } + attr_reader :require_matching_selfie + end + class IdNumber < Stripe::StripeObject; end + # Attribute for field document + sig { returns(Document) } + attr_reader :document + # Attribute for field id_number + sig { returns(IdNumber) } + attr_reader :id_number + end + class Phone < Stripe::StripeObject + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + sig { returns(T.nilable(String)) } + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + # Details on the verification error. Present when status is `unverified`. + sig { returns(T.nilable(Error)) } + attr_reader :error + # Phone to be verified. + sig { returns(T.nilable(String)) } + attr_reader :phone + # Status of this `phone` check. + sig { returns(String) } + attr_reader :status + end + class Selfie < Stripe::StripeObject + class Error < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification failure. + sig { returns(T.nilable(String)) } + attr_reader :code + # A human-readable message giving the reason for the failure. These messages can be shown to your users. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + # ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. + sig { returns(T.nilable(String)) } + attr_reader :document + # Details on the verification error. Present when status is `unverified`. + sig { returns(T.nilable(Error)) } + attr_reader :error + # ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. + sig { returns(T.nilable(String)) } + attr_reader :selfie + # Status of this `selfie` check. + sig { returns(String) } + attr_reader :status + end + # A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + sig { returns(T.nilable(String)) } + attr_reader :client_reference_id + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Result from a document check + sig { returns(Document) } + attr_reader :document + + # Result from a email check + sig { returns(Email) } + attr_reader :email + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Result from an id_number check + sig { returns(IdNumber) } + attr_reader :id_number + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field options + sig { returns(Options) } + attr_reader :options + + # Result from a phone check + sig { returns(Phone) } + attr_reader :phone + + # Result from a selfie check + sig { returns(Selfie) } + attr_reader :selfie + + # Type of report. + sig { returns(String) } + attr_reader :type + + # The configuration token of a verification flow from the dashboard. + sig { returns(String) } + attr_reader :verification_flow + + # ID of the VerificationSession that created this report. + sig { returns(T.nilable(String)) } + attr_reader :verification_session + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/identity/verification_session.rbi b/rbi/stripe/resources/identity/verification_session.rbi new file mode 100644 index 000000000..2f62e5562 --- /dev/null +++ b/rbi/stripe/resources/identity/verification_session.rbi @@ -0,0 +1,209 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Identity + # A VerificationSession guides you through the process of collecting and verifying the identities + # of your users. It contains details about the type of verification, such as what [verification + # check](https://stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for + # each verification in your system. + # + # A VerificationSession transitions through [multiple + # statuses](https://stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through + # the verification flow. The VerificationSession contains the user's verified data after + # verification checks are complete. + # + # Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) + class VerificationSession < APIResource + class LastError < Stripe::StripeObject + # A short machine-readable string giving the reason for the verification or user-session failure. + sig { returns(T.nilable(String)) } + attr_reader :code + # A message that explains the reason for verification or user-session failure. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + class Options < Stripe::StripeObject + class Document < Stripe::StripeObject + # Array of strings of allowed identity document types. If the provided identity document isn’t one of the allowed types, the verification check will fail with a document_type_not_allowed error code. + sig { returns(T::Array[String]) } + attr_reader :allowed_types + # Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document’s extracted name and date of birth. + sig { returns(T::Boolean) } + attr_reader :require_id_number + # Disable image uploads, identity document images have to be captured using the device’s camera. + sig { returns(T::Boolean) } + attr_reader :require_live_capture + # Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user’s face. [Learn more](https://stripe.com/docs/identity/selfie). + sig { returns(T::Boolean) } + attr_reader :require_matching_selfie + end + class Email < Stripe::StripeObject + # Request one time password verification of `provided_details.email`. + sig { returns(T::Boolean) } + attr_reader :require_verification + end + class IdNumber < Stripe::StripeObject; end + class Phone < Stripe::StripeObject + # Request one time password verification of `provided_details.phone`. + sig { returns(T::Boolean) } + attr_reader :require_verification + end + # Attribute for field document + sig { returns(Document) } + attr_reader :document + # Attribute for field email + sig { returns(Email) } + attr_reader :email + # Attribute for field id_number + sig { returns(IdNumber) } + attr_reader :id_number + # Attribute for field phone + sig { returns(Phone) } + attr_reader :phone + end + class ProvidedDetails < Stripe::StripeObject + # Email of user being verified + sig { returns(String) } + attr_reader :email + # Phone number of user being verified + sig { returns(String) } + attr_reader :phone + end + class Redaction < Stripe::StripeObject + # Indicates whether this object and its related objects have been redacted or not. + sig { returns(String) } + attr_reader :status + end + class VerifiedOutputs < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class Dob < Stripe::StripeObject + # Numerical day between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # Numerical month between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + # The user's verified address. + sig { returns(T.nilable(Address)) } + attr_reader :address + # The user’s verified date of birth. + sig { returns(T.nilable(Dob)) } + attr_reader :dob + # The user's verified email address + sig { returns(T.nilable(String)) } + attr_reader :email + # The user's verified first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + # The user's verified id number. + sig { returns(T.nilable(String)) } + attr_reader :id_number + # The user's verified id number type. + sig { returns(T.nilable(String)) } + attr_reader :id_number_type + # The user's verified last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + # The user's verified phone number + sig { returns(T.nilable(String)) } + attr_reader :phone + end + # A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. + sig { returns(T.nilable(String)) } + attr_reader :client_reference_id + + # The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don’t store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. + sig { returns(T.nilable(String)) } + attr_reader :client_secret + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # If present, this property tells you the last error encountered when processing the verification. + sig { returns(T.nilable(LastError)) } + attr_reader :last_error + + # ID of the most recent VerificationReport. [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results) + sig { returns(T.nilable(T.any(String, Stripe::Identity::VerificationReport))) } + attr_reader :last_verification_report + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # A set of options for the session’s verification checks. + sig { returns(T.nilable(Options)) } + attr_reader :options + + # Details provided about the user being verified. These details may be shown to the user. + sig { returns(T.nilable(ProvidedDetails)) } + attr_reader :provided_details + + # Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. + sig { returns(T.nilable(Redaction)) } + attr_reader :redaction + + # Token referencing a Customer resource. + sig { returns(T.nilable(String)) } + attr_reader :related_customer + + # Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). + sig { returns(String) } + attr_reader :status + + # The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. + sig { returns(String) } + attr_reader :type + + # The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don’t store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. + sig { returns(T.nilable(String)) } + attr_reader :url + + # The configuration token of a verification flow from the dashboard. + sig { returns(String) } + attr_reader :verification_flow + + # The user’s verified data. + sig { returns(T.nilable(VerifiedOutputs)) } + attr_reader :verified_outputs + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/invoice.rbi b/rbi/stripe/resources/invoice.rbi new file mode 100644 index 000000000..4d3a73ece --- /dev/null +++ b/rbi/stripe/resources/invoice.rbi @@ -0,0 +1,937 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Invoices are statements of amounts owed by a customer, and are either + # generated one-off, or generated periodically from a subscription. + # + # They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments + # that may be caused by subscription upgrades/downgrades (if necessary). + # + # If your invoice is configured to be billed through automatic charges, + # Stripe automatically finalizes your invoice and attempts payment. Note + # that finalizing the invoice, + # [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does + # not happen immediately as the invoice is created. Stripe waits + # until one hour after the last webhook was successfully sent (or the last + # webhook timed out after failing). If you (and the platforms you may have + # connected to) have no webhooks configured, Stripe waits one hour after + # creation to finalize the invoice. + # + # If your invoice is configured to be billed by sending an email, then based on your + # [email settings](https://dashboard.stripe.com/account/billing/automatic), + # Stripe will email the invoice to your customer and await payment. These + # emails can contain a link to a hosted page to pay the invoice. + # + # Stripe applies any customer credit on the account before determining the + # amount due for the invoice (i.e., the amount that will be actually + # charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge + # per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the + # invoice is automatically marked paid, and we add the amount due to the + # customer's credit balance which is applied to the next invoice. + # + # More details on the customer's credit balance are + # [here](https://stripe.com/docs/billing/customer/balance). + # + # Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending) + class Invoice < APIResource + class AmountsDue < Stripe::StripeObject + # Incremental amount due for this payment in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + # The amount in cents (or local equivalent) that was paid for this payment. + sig { returns(Integer) } + attr_reader :amount_paid + # The difference between the payment’s amount and amount_paid, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount_remaining + # Number of days from when invoice is finalized until the payment is due. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + # Date on which a payment plan’s payment is due. + sig { returns(T.nilable(Integer)) } + attr_reader :due_date + # Timestamp when the payment was paid. + sig { returns(T.nilable(Integer)) } + attr_reader :paid_at + # The status of the payment, one of `open`, `paid`, or `past_due` + sig { returns(String) } + attr_reader :status + end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + # The status of the most recent automated tax calculation for this invoice. + sig { returns(T.nilable(String)) } + attr_reader :status + end + class CustomField < Stripe::StripeObject + # The name of the custom field. + sig { returns(String) } + attr_reader :name + # The value of the custom field. + sig { returns(String) } + attr_reader :value + end + class CustomerAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class CustomerShipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class CustomerTaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(T.nilable(String)) } + attr_reader :value + end + class FromInvoice < Stripe::StripeObject + # The relation between this invoice and the cloned invoice + sig { returns(String) } + attr_reader :action + # The invoice that was cloned. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + end + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + class LastFinalizationError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + sig { returns(String) } + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + sig { returns(String) } + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + sig { returns(String) } + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + sig { returns(String) } + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + sig { returns(String) } + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + sig { returns(String) } + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + sig { returns(Stripe::PaymentIntent) } + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + sig { returns(Stripe::PaymentMethod) } + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + sig { returns(String) } + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + sig { returns(String) } + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + sig { returns(Stripe::SetupIntent) } + attr_reader :setup_intent + # Attribute for field source + sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) } + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + sig { returns(String) } + attr_reader :type + end + class PaymentSettings < Stripe::StripeObject + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + sig { returns(String) } + attr_reader :preferred_language + end + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + # Whether Installments are enabled for this Invoice. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + end + # Attribute for field installments + sig { returns(Installments) } + attr_reader :installments + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + sig { returns(T.nilable(String)) } + attr_reader :request_three_d_secure + end + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + sig { returns(String) } + attr_reader :country + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :funding_type + end + class IdBankTransfer < Stripe::StripeObject; end + class Konbini < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + sig { returns(T::Array[String]) } + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + sig { returns(String) } + attr_reader :institution + end + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + # The list of permissions to request. The `payment_method` permission must be included. + sig { returns(T::Array[String]) } + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + end + # Attribute for field financial_connections + sig { returns(FinancialConnections) } + attr_reader :financial_connections + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(AcssDebit)) } + attr_reader :acss_debit + # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Bancontact)) } + attr_reader :bancontact + # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Card)) } + attr_reader :card + # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(CustomerBalance)) } + attr_reader :customer_balance + # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(IdBankTransfer)) } + attr_reader :id_bank_transfer + # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Konbini)) } + attr_reader :konbini + # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(SepaDebit)) } + attr_reader :sepa_debit + # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(UsBankAccount)) } + attr_reader :us_bank_account + end + # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + sig { returns(T.nilable(String)) } + attr_reader :default_mandate + # Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + sig { returns(T.nilable(T::Array[String])) } + attr_reader :payment_method_types + end + class Rendering < Stripe::StripeObject + class Pdf < Stripe::StripeObject + # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. + sig { returns(T.nilable(String)) } + attr_reader :page_size + end + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + sig { returns(T.nilable(String)) } + attr_reader :amount_tax_display + # Invoice pdf rendering options + sig { returns(T.nilable(Pdf)) } + attr_reader :pdf + # ID of the rendering template that the invoice is formatted by. + sig { returns(T.nilable(String)) } + attr_reader :template + # Version of the rendering template that the invoice is using. + sig { returns(T.nilable(Integer)) } + attr_reader :template_version + end + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # Total shipping cost before any taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_tax + # Total shipping cost after taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The ID of the ShippingRate for this invoice. + sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) } + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class StatusTransitions < Stripe::StripeObject + # The time that the invoice draft was finalized. + sig { returns(T.nilable(Integer)) } + attr_reader :finalized_at + # The time that the invoice was marked uncollectible. + sig { returns(T.nilable(Integer)) } + attr_reader :marked_uncollectible_at + # The time that the invoice was paid. + sig { returns(T.nilable(Integer)) } + attr_reader :paid_at + # The time that the invoice was voided. + sig { returns(T.nilable(Integer)) } + attr_reader :voided_at + end + class SubscriptionDetails < Stripe::StripeObject + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + sig { returns(String) } + attr_reader :behavior + # The time after which the subscription will resume collecting payments. + sig { returns(T.nilable(Integer)) } + attr_reader :resumes_at + end + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + # *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + sig { returns(T.nilable(PauseCollection)) } + attr_reader :pause_collection + end + class ThresholdReason < Stripe::StripeObject + class ItemReason < Stripe::StripeObject + # The IDs of the line items that triggered the threshold invoice. + sig { returns(T::Array[String]) } + attr_reader :line_item_ids + # The quantity threshold boundary that applied to the given line item. + sig { returns(Integer) } + attr_reader :usage_gte + end + # The total invoice amount threshold boundary if it triggered the threshold invoice. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates which line items triggered a threshold invoice. + sig { returns(T::Array[ItemReason]) } + attr_reader :item_reasons + end + class TotalDiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + sig { returns(Integer) } + attr_reader :amount + # The discount that was applied to get this discount amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + end + class TotalMarginAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the reduction in line item amount. + sig { returns(Integer) } + attr_reader :amount + # The margin that was applied to get this margin amount. + sig { returns(T.any(String, Stripe::Margin)) } + attr_reader :margin + end + class TotalPretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + sig { returns(Integer) } + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + sig { returns(T.nilable(T.any(String, Stripe::Billing::CreditBalanceTransaction))) } + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + # The margin that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Margin)) } + attr_reader :margin + # Type of the pretax credit amount referenced. + sig { returns(String) } + attr_reader :type + end + class TotalTaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + sig { returns(Integer) } + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + sig { returns(T::Boolean) } + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + sig { returns(T.any(String, Stripe::TaxRate)) } + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # The country of the business associated with this invoice, most often the business creating the invoice. + sig { returns(T.nilable(String)) } + attr_reader :account_country + + # The public name of the business associated with this invoice, most often the business creating the invoice. + sig { returns(T.nilable(String)) } + attr_reader :account_name + + # The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + + # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + sig { returns(Integer) } + attr_reader :amount_due + + # Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit balance. + sig { returns(Integer) } + attr_reader :amount_overpaid + + # The amount, in cents (or local equivalent), that was paid. + sig { returns(Integer) } + attr_reader :amount_paid + + # The difference between amount_due and amount_paid, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount_remaining + + # This is the sum of all the shipping amounts. + sig { returns(Integer) } + attr_reader :amount_shipping + + # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. + sig { returns(T.nilable(T::Array[AmountsDue])) } + attr_reader :amounts_due + + # ID of the Connect Application that created the invoice. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. + sig { returns(Integer) } + attr_reader :attempt_count + + # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + sig { returns(T::Boolean) } + attr_reader :attempted + + # Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. + sig { returns(T::Boolean) } + attr_reader :auto_advance + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + sig { returns(T.nilable(Integer)) } + attr_reader :automatically_finalizes_at + + # Indicates the reason why the invoice was created. + # + # * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + # * `subscription_create`: A new subscription was created. + # * `subscription_cycle`: A subscription advanced into a new period. + # * `subscription_threshold`: A subscription reached a billing threshold. + # * `subscription_update`: A subscription was updated. + # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + sig { returns(T.nilable(String)) } + attr_reader :billing_reason + + # ID of the latest charge generated for this invoice, if any. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :charge + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + sig { returns(String) } + attr_reader :collection_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Custom fields displayed on the invoice. + sig { returns(T.nilable(T::Array[CustomField])) } + attr_reader :custom_fields + + # The ID of the customer who will be billed. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(CustomerAddress)) } + attr_reader :customer_address + + # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_email + + # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_name + + # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_phone + + # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(CustomerShipping)) } + attr_reader :customer_shipping + + # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_tax_exempt + + # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(T::Array[CustomerTaxId])) } + attr_reader :customer_tax_ids + + # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::Margin)])) } + attr_reader :default_margins + + # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + + # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + sig { + returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)))) + } + attr_reader :default_source + + # The tax rates applied to this invoice, if any. + sig { returns(T::Array[Stripe::TaxRate]) } + attr_reader :default_tax_rates + + # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + sig { returns(T.nilable(Stripe::Discount)) } + attr_reader :discount + + # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[T.any(String, Stripe::Discount)]) } + attr_reader :discounts + + # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :due_date + + # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + sig { returns(T.nilable(Integer)) } + attr_reader :effective_at + + # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + sig { returns(T.nilable(Integer)) } + attr_reader :ending_balance + + # Footer displayed on the invoice. + sig { returns(T.nilable(String)) } + attr_reader :footer + + # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + sig { returns(T.nilable(FromInvoice)) } + attr_reader :from_invoice + + # The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. + sig { returns(T.nilable(String)) } + attr_reader :hosted_invoice_url + + # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. + sig { returns(String) } + attr_reader :id + + # The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. + sig { returns(T.nilable(String)) } + attr_reader :invoice_pdf + + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + + # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + sig { returns(T.nilable(LastFinalizationError)) } + attr_reader :last_finalization_error + + # The ID of the most recent non-draft revision of this invoice + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :latest_revision + + # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + sig { returns(Stripe::ListObject) } + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`. + sig { returns(T.nilable(Integer)) } + attr_reader :next_payment_attempt + + # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + sig { returns(T.nilable(String)) } + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + sig { returns(T::Boolean) } + attr_reader :paid + + # Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + sig { returns(T::Boolean) } + attr_reader :paid_out_of_band + + # The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + + # Attribute for field payment_settings + sig { returns(PaymentSettings) } + attr_reader :payment_settings + + # Payments for this invoice + sig { returns(Stripe::ListObject) } + attr_reader :payments + + # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + sig { returns(Integer) } + attr_reader :period_end + + # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + sig { returns(Integer) } + attr_reader :period_start + + # Total amount of all post-payment credit notes issued for this invoice. + sig { returns(Integer) } + attr_reader :post_payment_credit_notes_amount + + # Total amount of all pre-payment credit notes issued for this invoice. + sig { returns(Integer) } + attr_reader :pre_payment_credit_notes_amount + + # The quote this invoice was generated from. + sig { returns(T.nilable(T.any(String, Stripe::Quote))) } + attr_reader :quote + + # This is the transaction number that appears on email receipts sent for this invoice. + sig { returns(T.nilable(String)) } + attr_reader :receipt_number + + # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + sig { returns(T.nilable(Rendering)) } + attr_reader :rendering + + # The details of the cost of shipping, including the ShippingRate applied on the invoice. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + + # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. + sig { returns(Integer) } + attr_reader :starting_balance + + # Extra information about an invoice for the customer's credit card statement. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + sig { returns(T.nilable(String)) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # The subscription that this invoice was prepared for, if any. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # Details about the subscription that created this invoice. + sig { returns(T.nilable(SubscriptionDetails)) } + attr_reader :subscription_details + + # Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + sig { returns(Integer) } + attr_reader :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 + sig { returns(Integer) } + attr_reader :subtotal + + # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + sig { returns(T.nilable(Integer)) } + attr_reader :subtotal_excluding_tax + + # The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + sig { returns(T.nilable(Integer)) } + attr_reader :tax + + # ID of the test clock this invoice belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # Attribute for field threshold_reason + sig { returns(ThresholdReason) } + attr_reader :threshold_reason + + # Total after discounts and taxes. + sig { returns(Integer) } + attr_reader :total + + # The aggregate amounts calculated per discount across all line items. + sig { returns(T.nilable(T::Array[TotalDiscountAmount])) } + attr_reader :total_discount_amounts + + # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + sig { returns(T.nilable(Integer)) } + attr_reader :total_excluding_tax + + # The aggregate amounts calculated per margin across all line items. + sig { returns(T.nilable(T::Array[TotalMarginAmount])) } + attr_reader :total_margin_amounts + + # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + sig { returns(T.nilable(T::Array[TotalPretaxCreditAmount])) } + attr_reader :total_pretax_credit_amounts + + # The aggregate amounts calculated per tax rate for all line items. + sig { returns(T::Array[TotalTaxAmount]) } + attr_reader :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. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + + # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + sig { returns(T.nilable(Integer)) } + attr_reader :webhooks_delivered_at + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/invoice_item.rbi b/rbi/stripe/resources/invoice_item.rbi new file mode 100644 index 000000000..47538c6b2 --- /dev/null +++ b/rbi/stripe/resources/invoice_item.rbi @@ -0,0 +1,126 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an + # invoice by creating or updating it with an `invoice` field, at which point it will be included as + # [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within + # [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). + # + # Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined + # with a [subscription](https://stripe.com/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge + # or credit the customer's card only at the end of a regular billing cycle. This is useful for combining several charges + # (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals. + # + # Related guides: [Integrate with the Invoicing API](https://stripe.com/docs/invoicing/integration), [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). + class InvoiceItem < APIResource + class Period < Stripe::StripeObject + # The end of the period, which must be greater than or equal to the start. This value is inclusive. + sig { returns(Integer) } + attr_reader :end + # The start of the period. This value is inclusive. + sig { returns(Integer) } + attr_reader :start + end + # Amount (in the `currency` specified) of the invoice item. This should always be equal to `unit_amount * quantity`. + sig { returns(Integer) } + attr_reader :amount + + # 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). + sig { returns(String) } + attr_reader :currency + + # The ID of the customer who will be billed when this invoice item is billed. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :date + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # If true, discounts will apply to this invoice item. Always false for prorations. + sig { returns(T::Boolean) } + attr_reader :discountable + + # The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::Discount)])) } + attr_reader :discounts + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The ID of the invoice this invoice item belongs to. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The margins which apply to the invoice item. When set, the `default_margins` on the invoice do not apply to this invoice item. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::Margin)])) } + attr_reader :margins + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field period + sig { returns(Period) } + attr_reader :period + + # If the invoice item is a proration, the plan of the subscription that the proration was computed for. + sig { returns(T.nilable(Stripe::Plan)) } + attr_reader :plan + + # The price of the invoice item. + sig { returns(T.nilable(Stripe::Price)) } + attr_reader :price + + # Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + sig { returns(T::Boolean) } + attr_reader :proration + + # Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + sig { returns(Integer) } + attr_reader :quantity + + # The subscription that this invoice item has been created for, if any. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # The subscription item that this invoice item has been created for, if any. + sig { returns(String) } + attr_reader :subscription_item + + # The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + + # ID of the test clock this invoice item belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # Unit amount (in the `currency` specified) of the invoice item. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/invoice_line_item.rbi b/rbi/stripe/resources/invoice_line_item.rbi new file mode 100644 index 000000000..c580f5e39 --- /dev/null +++ b/rbi/stripe/resources/invoice_line_item.rbi @@ -0,0 +1,193 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Invoice Line Items represent the individual lines within an [invoice](https://stripe.com/docs/api/invoices) and only exist within the context of an invoice. + # + # Each line item is backed by either an [invoice item](https://stripe.com/docs/api/invoiceitems) or a [subscription item](https://stripe.com/docs/api/subscription_items). + class InvoiceLineItem < StripeObject + class DiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + sig { returns(Integer) } + attr_reader :amount + # The discount that was applied to get this discount amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + end + class MarginAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the reduction in line item amount. + sig { returns(Integer) } + attr_reader :amount + # The margin that was applied to get this margin amount. + sig { returns(T.any(String, Stripe::Margin)) } + attr_reader :margin + end + class Period < Stripe::StripeObject + # The end of the period, which must be greater than or equal to the start. This value is inclusive. + sig { returns(Integer) } + attr_reader :end + # The start of the period. This value is inclusive. + sig { returns(Integer) } + attr_reader :start + end + class PretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + sig { returns(Integer) } + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + sig { returns(T.nilable(T.any(String, Stripe::Billing::CreditBalanceTransaction))) } + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + # The margin that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Margin)) } + attr_reader :margin + # Type of the pretax credit amount referenced. + sig { returns(String) } + attr_reader :type + end + class ProrationDetails < Stripe::StripeObject + class CreditedItems < Stripe::StripeObject + # Invoice containing the credited invoice line items + sig { returns(String) } + attr_reader :invoice + # Credited invoice line items + sig { returns(T::Array[String]) } + attr_reader :invoice_line_items + end + # For a credit proration `line_item`, the original debit line_items to which the credit proration applies. + sig { returns(T.nilable(CreditedItems)) } + attr_reader :credited_items + end + class TaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + sig { returns(Integer) } + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + sig { returns(T::Boolean) } + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + sig { returns(T.any(String, Stripe::TaxRate)) } + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The amount, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. + sig { returns(T.nilable(Integer)) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The amount of discount calculated per discount for this line item. + sig { returns(T.nilable(T::Array[DiscountAmount])) } + attr_reader :discount_amounts + + # If true, discounts will apply to this line item. Always false for prorations. + sig { returns(T::Boolean) } + attr_reader :discountable + + # The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[T.any(String, Stripe::Discount)]) } + attr_reader :discounts + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The ID of the invoice that contains this line item. + sig { returns(T.nilable(String)) } + attr_reader :invoice + + # The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. + sig { returns(T.any(String, Stripe::InvoiceItem)) } + attr_reader :invoice_item + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The amount of margin calculated per margin for this line item. + sig { returns(T.nilable(T::Array[MarginAmount])) } + attr_reader :margin_amounts + + # The margins applied to the line item. When set, the `default_margins` on the invoice do not apply to the line item. Use `expand[]=margins` to expand each margin. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::Margin)])) } + attr_reader :margins + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field period + sig { returns(Period) } + attr_reader :period + + # The plan of the subscription, if the line item is a subscription or a proration. + sig { returns(T.nilable(Stripe::Plan)) } + attr_reader :plan + + # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. + sig { returns(T.nilable(T::Array[PretaxCreditAmount])) } + attr_reader :pretax_credit_amounts + + # The price of the line item. + sig { returns(T.nilable(Stripe::Price)) } + attr_reader :price + + # Whether this is a proration. + sig { returns(T::Boolean) } + attr_reader :proration + + # Additional details for proration line items + sig { returns(T.nilable(ProrationDetails)) } + attr_reader :proration_details + + # The quantity of the subscription, if the line item is a subscription or a proration. + sig { returns(T.nilable(Integer)) } + attr_reader :quantity + + # The subscription that the invoice item pertains to, if any. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. + sig { returns(T.any(String, Stripe::SubscriptionItem)) } + attr_reader :subscription_item + + # The amount of tax calculated per tax rate for this line item + sig { returns(T::Array[TaxAmount]) } + attr_reader :tax_amounts + + # The tax rates which apply to the line item. + sig { returns(T::Array[Stripe::TaxRate]) } + attr_reader :tax_rates + + # A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. + sig { returns(String) } + attr_reader :type + + # The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_excluding_tax + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/invoice_payment.rbi b/rbi/stripe/resources/invoice_payment.rbi new file mode 100644 index 000000000..974f0ae23 --- /dev/null +++ b/rbi/stripe/resources/invoice_payment.rbi @@ -0,0 +1,82 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # The invoice payment object + class InvoicePayment < APIResource + class Payment < Stripe::StripeObject + # ID of the successful charge for this payment when `type` is `charge`. + sig { returns(T.any(String, Stripe::Charge)) } + attr_reader :charge + # ID of the PaymentIntent associated with this payment when `type` is `payment_intent`. Note: This property is only populated for invoices finalized on or after March 15th, 2019. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + # ID of the PaymentRecord associated with this payment when `type` is `payment_record`. + sig { returns(T.any(String, Stripe::PaymentRecord)) } + attr_reader :payment_record + # Type of payment object associated with this invoice payment. + sig { returns(String) } + attr_reader :type + end + class StatusTransitions < Stripe::StripeObject + # The time that the payment was canceled. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # The time that the payment succeeded. + sig { returns(T.nilable(Integer)) } + attr_reader :paid_at + end + # Excess payment that was received for this invoice and credited to the customer’s `invoice_credit_balance`. This field is null until the payment is `paid`. Overpayment can happen when you attach more than one PaymentIntent to the invoice, and each of them succeeds. To avoid overpayment, cancel any PaymentIntents that you do not need before attaching more. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_overpaid + + # Amount that was actually paid for this invoice, in cents (or local equivalent). This field is null until the payment is `paid`. This amount can be less than the `amount_requested` if the PaymentIntent’s `amount_received` is not sufficient to pay all of the invoices that it is attached to. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_paid + + # Amount intended to be paid toward this invoice, in cents (or local equivalent) + sig { returns(Integer) } + attr_reader :amount_requested + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The invoice that was paid. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + + # Stripe automatically creates a default InvoicePayment when the invoice is finalized, and keeps it synchronized with the invoice’s `amount_remaining`. The PaymentIntent associated with the default payment can’t be edited or canceled directly. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_default + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field payment + sig { returns(Payment) } + attr_reader :payment + + # The status of the payment, one of `open`, `paid`, or `canceled`. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/invoice_rendering_template.rbi b/rbi/stripe/resources/invoice_rendering_template.rbi new file mode 100644 index 000000000..a48e8dec9 --- /dev/null +++ b/rbi/stripe/resources/invoice_rendering_template.rbi @@ -0,0 +1,41 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Invoice Rendering Templates are used to configure how invoices are rendered on surfaces like the PDF. Invoice Rendering Templates + # can be created from within the Dashboard, and they can be used over the API when creating invoices. + class InvoiceRenderingTemplate < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # A brief description of the template, hidden from customers + sig { returns(T.nilable(String)) } + attr_reader :nickname + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The status of the template, one of `active` or `archived`. + sig { returns(String) } + attr_reader :status + + # Version of this template; version increases by one when an update on the template changes any field that controls invoice rendering + sig { returns(Integer) } + attr_reader :version + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/authorization.rbi b/rbi/stripe/resources/issuing/authorization.rbi new file mode 100644 index 000000000..394dd8bbe --- /dev/null +++ b/rbi/stripe/resources/issuing/authorization.rbi @@ -0,0 +1,396 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + # object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + # purchase to be completed successfully. + # + # Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) + class Authorization < APIResource + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + sig { returns(T.nilable(Integer)) } + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + sig { returns(T.nilable(Integer)) } + attr_reader :cashback_amount + end + class Fleet < Stripe::StripeObject + class CardholderPromptData < Stripe::StripeObject + # [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry. The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID. + sig { returns(T.nilable(String)) } + attr_reader :alphanumeric_id + # Driver ID. + sig { returns(T.nilable(String)) } + attr_reader :driver_id + # Odometer reading. + sig { returns(T.nilable(Integer)) } + attr_reader :odometer + # An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + sig { returns(T.nilable(String)) } + attr_reader :unspecified_id + # User ID. + sig { returns(T.nilable(String)) } + attr_reader :user_id + # Vehicle number. + sig { returns(T.nilable(String)) } + attr_reader :vehicle_number + end + class ReportedBreakdown < Stripe::StripeObject + class Fuel < Stripe::StripeObject + # Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes. + sig { returns(T.nilable(String)) } + attr_reader :gross_amount_decimal + end + class NonFuel < Stripe::StripeObject + # Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + sig { returns(T.nilable(String)) } + attr_reader :gross_amount_decimal + end + class Tax < Stripe::StripeObject + # Amount of state or provincial Sales Tax included in the transaction amount. `null` if not reported by merchant or not subject to tax. + sig { returns(T.nilable(String)) } + attr_reader :local_amount_decimal + # Amount of national Sales Tax or VAT included in the transaction amount. `null` if not reported by merchant or not subject to tax. + sig { returns(T.nilable(String)) } + attr_reader :national_amount_decimal + end + # Breakdown of fuel portion of the purchase. + sig { returns(T.nilable(Fuel)) } + attr_reader :fuel + # Breakdown of non-fuel portion of the purchase. + sig { returns(T.nilable(NonFuel)) } + attr_reader :non_fuel + # Information about tax included in this transaction. + sig { returns(T.nilable(Tax)) } + attr_reader :tax + end + # Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. + sig { returns(T.nilable(CardholderPromptData)) } + attr_reader :cardholder_prompt_data + # The type of purchase. + sig { returns(T.nilable(String)) } + attr_reader :purchase_type + # More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + sig { returns(T.nilable(ReportedBreakdown)) } + attr_reader :reported_breakdown + # The type of fuel service. + sig { returns(T.nilable(String)) } + attr_reader :service_type + end + class FraudChallenge < Stripe::StripeObject + # The method by which the fraud challenge was delivered to the cardholder. + sig { returns(String) } + attr_reader :channel + # The status of the fraud challenge. + sig { returns(String) } + attr_reader :status + # If the challenge is not deliverable, the reason why. + sig { returns(T.nilable(String)) } + attr_reader :undeliverable_reason + end + class Fuel < Stripe::StripeObject + # [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + sig { returns(T.nilable(String)) } + attr_reader :industry_product_code + # The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :quantity_decimal + # The type of fuel that was purchased. + sig { returns(T.nilable(String)) } + attr_reader :type + # The units for `quantity_decimal`. + sig { returns(T.nilable(String)) } + attr_reader :unit + # The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :unit_cost_decimal + end + class MerchantData < Stripe::StripeObject + # A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + sig { returns(String) } + attr_reader :category + # The merchant category code for the seller’s business + sig { returns(String) } + attr_reader :category_code + # City where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :city + # Country where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :country + # Name of the seller + sig { returns(T.nilable(String)) } + attr_reader :name + # Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + sig { returns(String) } + attr_reader :network_id + # Postal code where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :state + # An ID assigned by the seller to the location of the sale. + sig { returns(T.nilable(String)) } + attr_reader :terminal_id + # URL provided by the merchant on a 3DS request + sig { returns(T.nilable(String)) } + attr_reader :url + end + class NetworkData < Stripe::StripeObject + # Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`. + sig { returns(T.nilable(String)) } + attr_reader :acquiring_institution_id + # The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer `network_data.transaction_id` if present, unless you have special requirements. + sig { returns(T.nilable(String)) } + attr_reader :system_trace_audit_number + # Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class PendingRequest < Stripe::StripeObject + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + sig { returns(T.nilable(Integer)) } + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + sig { returns(T.nilable(Integer)) } + attr_reader :cashback_amount + end + # The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(T.nilable(AmountDetails)) } + attr_reader :amount_details + # 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). + sig { returns(String) } + attr_reader :currency + # If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. + sig { returns(T::Boolean) } + attr_reader :is_amount_controllable + # The amount the merchant is requesting to be authorized in the `merchant_currency`. The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :merchant_amount + # The local currency the merchant is requesting to authorize. + sig { returns(String) } + attr_reader :merchant_currency + # The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + sig { returns(T.nilable(Integer)) } + attr_reader :network_risk_score + end + class RequestHistory < Stripe::StripeObject + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + sig { returns(T.nilable(Integer)) } + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + sig { returns(T.nilable(Integer)) } + attr_reader :cashback_amount + end + # The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Stripe held this amount from your account to fund the authorization if the request was approved. + sig { returns(Integer) } + attr_reader :amount + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(T.nilable(AmountDetails)) } + attr_reader :amount_details + # Whether this request was approved. + sig { returns(T::Boolean) } + attr_reader :approved + # A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + # The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :merchant_amount + # The currency that was collected by the merchant and presented to the cardholder for the authorization. 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). + sig { returns(String) } + attr_reader :merchant_currency + # The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. + sig { returns(T.nilable(Integer)) } + attr_reader :network_risk_score + # When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. + sig { returns(String) } + attr_reader :reason + # If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. + sig { returns(T.nilable(String)) } + attr_reader :reason_message + # Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time. + sig { returns(T.nilable(Integer)) } + attr_reader :requested_at + end + class Treasury < Stripe::StripeObject + # The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization + sig { returns(T::Array[String]) } + attr_reader :received_credits + # The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization + sig { returns(T::Array[String]) } + attr_reader :received_debits + # The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization + sig { returns(T.nilable(String)) } + attr_reader :transaction + end + class VerificationData < Stripe::StripeObject + class AuthenticationExemption < Stripe::StripeObject + # The entity that requested the exemption, either the acquiring merchant or the Issuing user. + sig { returns(String) } + attr_reader :claimed_by + # The specific exemption claimed for this authorization. + sig { returns(String) } + attr_reader :type + end + class ThreeDSecure < Stripe::StripeObject + # The outcome of the 3D Secure authentication request. + sig { returns(String) } + attr_reader :result + end + # Whether the cardholder provided an address first line and if it matched the cardholder’s `billing.address.line1`. + sig { returns(String) } + attr_reader :address_line1_check + # Whether the cardholder provided a postal code and if it matched the cardholder’s `billing.address.postal_code`. + sig { returns(String) } + attr_reader :address_postal_code_check + # The exemption applied to this authorization. + sig { returns(T.nilable(AuthenticationExemption)) } + attr_reader :authentication_exemption + # Whether the cardholder provided a CVC and if it matched Stripe’s record. + sig { returns(String) } + attr_reader :cvc_check + # Whether the cardholder provided an expiry date and if it matched Stripe’s record. + sig { returns(String) } + attr_reader :expiry_check + # The postal code submitted as part of the authorization used for postal code verification. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # 3D Secure details. + sig { returns(T.nilable(ThreeDSecure)) } + attr_reader :three_d_secure + end + # The total amount that was authorized or rejected. This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. + sig { returns(Integer) } + attr_reader :amount + + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(T.nilable(AmountDetails)) } + attr_reader :amount_details + + # Whether the authorization has been approved. + sig { returns(T::Boolean) } + attr_reader :approved + + # How the card details were provided. + sig { returns(String) } + attr_reader :authorization_method + + # List of balance transactions associated with this authorization. + sig { returns(T::Array[Stripe::BalanceTransaction]) } + attr_reader :balance_transactions + + # You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders. + sig { returns(Stripe::Issuing::Card) } + attr_reader :card + + # The cardholder to whom this authorization belongs. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Cardholder))) } + attr_reader :cardholder + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. 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). + sig { returns(String) } + attr_reader :currency + + # Fleet-specific information for authorizations using Fleet cards. + sig { returns(T.nilable(Fleet)) } + attr_reader :fleet + + # Fraud challenges sent to the cardholder, if this authorization was declined for fraud risk reasons. + sig { returns(T.nilable(T::Array[FraudChallenge])) } + attr_reader :fraud_challenges + + # Information about fuel that was purchased with this transaction. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. + sig { returns(T.nilable(Fuel)) } + attr_reader :fuel + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. + sig { returns(Integer) } + attr_reader :merchant_amount + + # The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `currency` field on this authorization. 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). + sig { returns(String) } + attr_reader :merchant_currency + + # Attribute for field merchant_data + sig { returns(MerchantData) } + attr_reader :merchant_data + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Details about the authorization, such as identifiers, set by the card network. + sig { returns(T.nilable(NetworkData)) } + attr_reader :network_data + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook. + sig { returns(T.nilable(PendingRequest)) } + attr_reader :pending_request + + # History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. + sig { returns(T::Array[RequestHistory]) } + attr_reader :request_history + + # The current status of the authorization in its lifecycle. + sig { returns(String) } + attr_reader :status + + # [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. If a network token was not used for this authorization, this field will be null. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Token))) } + attr_reader :token + + # List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. + sig { returns(T::Array[Stripe::Issuing::Transaction]) } + attr_reader :transactions + + # [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). + sig { returns(T.nilable(Treasury)) } + attr_reader :treasury + + # Attribute for field verification_data + sig { returns(VerificationData) } + attr_reader :verification_data + + # Whether the authorization bypassed fraud risk checks because the cardholder has previously completed a fraud challenge on a similar high-risk authorization from the same merchant. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :verified_by_fraud_challenge + + # The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. + sig { returns(T.nilable(String)) } + attr_reader :wallet + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/card.rbi b/rbi/stripe/resources/issuing/card.rbi new file mode 100644 index 000000000..d223aa99b --- /dev/null +++ b/rbi/stripe/resources/issuing/card.rbi @@ -0,0 +1,263 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # You can [create physical or virtual cards](https://stripe.com/docs/issuing) that are issued to cardholders. + class Card < APIResource + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class AddressValidation < Stripe::StripeObject + class NormalizedAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # The address validation capabilities to use. + sig { returns(String) } + attr_reader :mode + # The normalized shipping address. + sig { returns(T.nilable(NormalizedAddress)) } + attr_reader :normalized_address + # The validation result for the shipping address. + sig { returns(T.nilable(String)) } + attr_reader :result + end + class Customs < Stripe::StripeObject + # A registration number used for customs in Europe. See [https://www.gov.uk/eori](https://www.gov.uk/eori) for the UK and [https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. + sig { returns(T.nilable(String)) } + attr_reader :eori_number + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Address validation details for the shipment. + sig { returns(T.nilable(AddressValidation)) } + attr_reader :address_validation + # The delivery company that shipped a card. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Additional information that may be required for clearing customs. + sig { returns(T.nilable(Customs)) } + attr_reader :customs + # A unix timestamp representing a best estimate of when the card will be delivered. + sig { returns(T.nilable(Integer)) } + attr_reader :eta + # Recipient name. + sig { returns(String) } + attr_reader :name + # The phone number of the receiver of the shipment. Our courier partners will use this number to contact you in the event of card delivery issues. For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + # Whether a signature is required for card delivery. This feature is only supported for US users. Standard shipping service does not support signature on delivery. The default value for standard shipping service is false and for express and priority services is true. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :require_signature + # Shipment service, such as `standard` or `express`. + sig { returns(String) } + attr_reader :service + # The delivery status of the card. + sig { returns(T.nilable(String)) } + attr_reader :status + # A tracking number for a card shipment. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + # A link to the shipping carrier's site where you can view detailed information about a card shipment. + sig { returns(T.nilable(String)) } + attr_reader :tracking_url + # Packaging options. + sig { returns(String) } + attr_reader :type + end + class SpendingControls < Stripe::StripeObject + class SpendingLimit < Stripe::StripeObject + # Maximum amount allowed to spend per interval. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :categories + # Interval (or event) to which the amount applies. + sig { returns(String) } + attr_reader :interval + end + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allowed_categories + # Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allowed_merchant_countries + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :blocked_categories + # Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :blocked_merchant_countries + # Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). + sig { returns(T.nilable(T::Array[SpendingLimit])) } + attr_reader :spending_limits + # Currency of the amounts within `spending_limits`. Always the same as the currency of the card. + sig { returns(T.nilable(String)) } + attr_reader :spending_limits_currency + end + class Wallets < Stripe::StripeObject + class ApplePay < Stripe::StripeObject + # Apple Pay Eligibility + sig { returns(T::Boolean) } + attr_reader :eligible + # Reason the card is ineligible for Apple Pay + sig { returns(T.nilable(String)) } + attr_reader :ineligible_reason + end + class GooglePay < Stripe::StripeObject + # Google Pay Eligibility + sig { returns(T::Boolean) } + attr_reader :eligible + # Reason the card is ineligible for Google Pay + sig { returns(T.nilable(String)) } + attr_reader :ineligible_reason + end + # Attribute for field apple_pay + sig { returns(ApplePay) } + attr_reader :apple_pay + # Attribute for field google_pay + sig { returns(GooglePay) } + attr_reader :google_pay + # Unique identifier for a card used with digital wallets + sig { returns(T.nilable(String)) } + attr_reader :primary_account_identifier + end + # The brand of the card. + sig { returns(String) } + attr_reader :brand + + # The reason why the card was canceled. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_reason + + # An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. + # + # Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards/virtual/issue-cards#create-cardholder) + sig { returns(Stripe::Issuing::Cardholder) } + attr_reader :cardholder + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # 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. + sig { returns(String) } + attr_reader :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. + sig { returns(String) } + attr_reader :cvc + + # The expiration month of the card. + sig { returns(Integer) } + attr_reader :exp_month + + # The expiration year of the card. + sig { returns(Integer) } + attr_reader :exp_year + + # The financial account this card is attached to. + sig { returns(T.nilable(String)) } + attr_reader :financial_account + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The last 4 digits of the card number. + sig { returns(String) } + attr_reader :last4 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The full unredacted card number. 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. + sig { returns(String) } + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The personalization design object belonging to this card. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::PersonalizationDesign))) } + attr_reader :personalization_design + + # The latest card that replaces this card, if any. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Card))) } + attr_reader :replaced_by + + # The card this card replaces, if any. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Card))) } + attr_reader :replacement_for + + # The reason why the previous card needed to be replaced. + sig { returns(T.nilable(String)) } + attr_reader :replacement_reason + + # Where and how the card will be shipped. + sig { returns(T.nilable(Shipping)) } + attr_reader :shipping + + # Attribute for field spending_controls + sig { returns(SpendingControls) } + attr_reader :spending_controls + + # Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. + sig { returns(String) } + attr_reader :status + + # The type of the card. + sig { returns(String) } + attr_reader :type + + # Information relating to digital wallets (like Apple Pay and Google Pay). + sig { returns(T.nilable(Wallets)) } + attr_reader :wallets + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/cardholder.rbi b/rbi/stripe/resources/issuing/cardholder.rbi new file mode 100644 index 000000000..0b44b85d3 --- /dev/null +++ b/rbi/stripe/resources/issuing/cardholder.rbi @@ -0,0 +1,203 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. + # + # Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards/virtual/issue-cards#create-cardholder) + class Cardholder < APIResource + class Billing < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + end + class Company < Stripe::StripeObject + # Whether the company's business ID number was provided. + sig { returns(T::Boolean) } + attr_reader :tax_id_provided + end + class Individual < Stripe::StripeObject + class CardIssuing < Stripe::StripeObject + class UserTermsAcceptance < Stripe::StripeObject + # The Unix timestamp marking when the cardholder accepted the Authorized User Terms. + sig { returns(T.nilable(Integer)) } + attr_reader :date + # The IP address from which the cardholder accepted the Authorized User Terms. + sig { returns(T.nilable(String)) } + attr_reader :ip + # The user agent of the browser from which the cardholder accepted the Authorized User Terms. + sig { returns(T.nilable(String)) } + attr_reader :user_agent + end + # Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. + sig { returns(T.nilable(UserTermsAcceptance)) } + attr_reader :user_terms_acceptance + end + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # The month of birth, between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year of birth. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + class Verification < Stripe::StripeObject + class Document < Stripe::StripeObject + # The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :back + # The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :front + end + # An identifying document, either a passport or local ID card. + sig { returns(T.nilable(Document)) } + attr_reader :document + end + # Information related to the card_issuing program for this cardholder. + sig { returns(T.nilable(CardIssuing)) } + attr_reader :card_issuing + # The date of birth of this cardholder. + sig { returns(T.nilable(Dob)) } + attr_reader :dob + # The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + sig { returns(T.nilable(String)) } + attr_reader :first_name + # The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. + sig { returns(T.nilable(String)) } + attr_reader :last_name + # Government-issued ID document for this cardholder. + sig { returns(T.nilable(Verification)) } + attr_reader :verification + end + class Requirements < Stripe::StripeObject + # If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. + sig { returns(T.nilable(String)) } + attr_reader :disabled_reason + # Array of fields that need to be collected in order to verify and re-enable the cardholder. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :past_due + end + class SpendingControls < Stripe::StripeObject + class SpendingLimit < Stripe::StripeObject + # Maximum amount allowed to spend per interval. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :categories + # Interval (or event) to which the amount applies. + sig { returns(String) } + attr_reader :interval + end + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allowed_categories + # Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :allowed_merchant_countries + # Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :blocked_categories + # Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :blocked_merchant_countries + # Limit spending with amount-based rules that apply across this cardholder's cards. + sig { returns(T.nilable(T::Array[SpendingLimit])) } + attr_reader :spending_limits + # Currency of the amounts within `spending_limits`. + sig { returns(T.nilable(String)) } + attr_reader :spending_limits_currency + end + # Attribute for field billing + sig { returns(Billing) } + attr_reader :billing + + # Additional information about a `company` cardholder. + sig { returns(T.nilable(Company)) } + attr_reader :company + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The cardholder's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Additional information about an `individual` cardholder. + sig { returns(T.nilable(Individual)) } + attr_reader :individual + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The cardholder's name. This will be printed on cards issued to them. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. + sig { returns(T.nilable(String)) } + attr_reader :phone_number + + # The cardholder’s preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. + # This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + + # Attribute for field requirements + sig { returns(Requirements) } + attr_reader :requirements + + # Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. + sig { returns(T.nilable(SpendingControls)) } + attr_reader :spending_controls + + # Specifies whether to permit authorizations on this cardholder's cards. + sig { returns(String) } + attr_reader :status + + # One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/credit_underwriting_record.rbi b/rbi/stripe/resources/issuing/credit_underwriting_record.rbi new file mode 100644 index 000000000..82d55a1fd --- /dev/null +++ b/rbi/stripe/resources/issuing/credit_underwriting_record.rbi @@ -0,0 +1,146 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # Every time an applicant submits an application for a Charge Card product your platform offers, or every time your platform takes a proactive credit decision on an existing account, you must record the decision by creating a new `CreditUnderwritingRecord` object on a connected account. + # + # [Follow the guide](https://stripe.com/docs/issuing/credit/report-credit-decisions-and-manage-aans) to learn about your requirements as a platform. + class CreditUnderwritingRecord < APIResource + class Application < Stripe::StripeObject + # The channel through which the applicant has submitted their application. + sig { returns(String) } + attr_reader :application_method + # Scope of demand made by the applicant. + sig { returns(String) } + attr_reader :purpose + # Date when the applicant submitted their application. + sig { returns(Integer) } + attr_reader :submitted_at + end + class CreditUser < Stripe::StripeObject + # Email of the applicant or accountholder. + sig { returns(String) } + attr_reader :email + # Full name of the company or person. + sig { returns(String) } + attr_reader :name + end + class Decision < Stripe::StripeObject + class ApplicationRejected < Stripe::StripeObject + # Details about the `reasons.other` when present. + sig { returns(T.nilable(String)) } + attr_reader :reason_other_explanation + # List of reasons why the application was rejected up to 4 reasons, in order of importance. + sig { returns(T::Array[String]) } + attr_reader :reasons + end + class CreditLimitApproved < Stripe::StripeObject + # Credit amount approved. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy). + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + end + class CreditLimitDecreased < Stripe::StripeObject + # Credit amount approved after decrease. An approved credit limit is required before you can set a amount in the [CreditPolicy API](https://stripe.com/docs/api/issuing/credit_policy). + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Details about the `reasons.other` when present. + sig { returns(T.nilable(String)) } + attr_reader :reason_other_explanation + # List of reasons why the existing credit was decreased, up to 4 reasons, in order of importance. + sig { returns(T::Array[String]) } + attr_reader :reasons + end + class CreditLineClosed < Stripe::StripeObject + # Details about the `reasons.other` when present. + sig { returns(T.nilable(String)) } + attr_reader :reason_other_explanation + # List of reasons why the existing account was closed, up to 4 reasons, in order of importance. + sig { returns(T::Array[String]) } + attr_reader :reasons + end + # Details about a decision application_rejected. + sig { returns(T.nilable(ApplicationRejected)) } + attr_reader :application_rejected + # Details about a decision credit_limit_approved. + sig { returns(T.nilable(CreditLimitApproved)) } + attr_reader :credit_limit_approved + # Details about a decision credit_limit_decreased. + sig { returns(T.nilable(CreditLimitDecreased)) } + attr_reader :credit_limit_decreased + # Details about a decision credit_line_closed. + sig { returns(T.nilable(CreditLineClosed)) } + attr_reader :credit_line_closed + # Outcome of the decision. + sig { returns(String) } + attr_reader :type + end + class UnderwritingException < Stripe::StripeObject + # Written explanation for the exception. + sig { returns(String) } + attr_reader :explanation + # The decision before the exception was applied. + sig { returns(String) } + attr_reader :original_decision_type + end + # For decisions triggered by an application, details about the submission. + sig { returns(T.nilable(Application)) } + attr_reader :application + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The event that triggered the underwriting. + sig { returns(String) } + attr_reader :created_from + + # Attribute for field credit_user + sig { returns(CreditUser) } + attr_reader :credit_user + + # Date when a decision was made. + sig { returns(T.nilable(Integer)) } + attr_reader :decided_at + + # Details about the decision. + sig { returns(T.nilable(Decision)) } + attr_reader :decision + + # For underwriting initiated by an application, a decision must be taken 30 days after the submission. + sig { returns(T.nilable(Integer)) } + attr_reader :decision_deadline + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # File containing regulatory reporting data for the decision. Required if you are subject to this [reporting requirement](https://stripe.com/docs/issuing/credit/report-required-regulatory-data-for-credit-decisions). + sig { returns(T.nilable(String)) } + attr_reader :regulatory_reporting_file + + # If an exception to the usual underwriting criteria was made for this application, details about the exception must be provided. Exceptions should only be granted in rare circumstances, in consultation with Stripe Compliance. + sig { returns(T.nilable(UnderwritingException)) } + attr_reader :underwriting_exception + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/dispute.rbi b/rbi/stripe/resources/issuing/dispute.rbi new file mode 100644 index 000000000..0dacacd4a --- /dev/null +++ b/rbi/stripe/resources/issuing/dispute.rbi @@ -0,0 +1,237 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. + # + # Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes) + class Dispute < APIResource + class Evidence < Stripe::StripeObject + class Canceled < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Date when order was canceled. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # Whether the cardholder was provided with a cancellation policy. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :cancellation_policy_provided + # Reason for canceling the order. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_reason + # Date when the cardholder expected to receive the product. + sig { returns(T.nilable(Integer)) } + attr_reader :expected_at + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + # Description of the merchandise or service that was purchased. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # Whether the product was a merchandise or service. + sig { returns(T.nilable(String)) } + attr_reader :product_type + # Result of cardholder's attempt to return the product. + sig { returns(T.nilable(String)) } + attr_reader :return_status + # Date when the product was returned or attempted to be returned. + sig { returns(T.nilable(Integer)) } + attr_reader :returned_at + end + class Duplicate < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :card_statement + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :cash_receipt + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :check_image + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + # Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. + sig { returns(T.nilable(String)) } + attr_reader :original_transaction + end + class Fraudulent < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + end + class MerchandiseNotAsDescribed < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + # Date when the product was received. + sig { returns(T.nilable(Integer)) } + attr_reader :received_at + # Description of the cardholder's attempt to return the product. + sig { returns(T.nilable(String)) } + attr_reader :return_description + # Result of cardholder's attempt to return the product. + sig { returns(T.nilable(String)) } + attr_reader :return_status + # Date when the product was returned or attempted to be returned. + sig { returns(T.nilable(Integer)) } + attr_reader :returned_at + end + class NoValidAuthorization < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + end + class NotReceived < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Date when the cardholder expected to receive the product. + sig { returns(T.nilable(Integer)) } + attr_reader :expected_at + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + # Description of the merchandise or service that was purchased. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # Whether the product was a merchandise or service. + sig { returns(T.nilable(String)) } + attr_reader :product_type + end + class Other < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + # Description of the merchandise or service that was purchased. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # Whether the product was a merchandise or service. + sig { returns(T.nilable(String)) } + attr_reader :product_type + end + class ServiceNotAsDescribed < Stripe::StripeObject + # (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :additional_documentation + # Date when order was canceled. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # Reason for canceling the order. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_reason + # Explanation of why the cardholder is disputing this transaction. + sig { returns(T.nilable(String)) } + attr_reader :explanation + # Date when the product was received. + sig { returns(T.nilable(Integer)) } + attr_reader :received_at + end + # Attribute for field canceled + sig { returns(Canceled) } + attr_reader :canceled + # Attribute for field duplicate + sig { returns(Duplicate) } + attr_reader :duplicate + # Attribute for field fraudulent + sig { returns(Fraudulent) } + attr_reader :fraudulent + # Attribute for field merchandise_not_as_described + sig { returns(MerchandiseNotAsDescribed) } + attr_reader :merchandise_not_as_described + # Attribute for field no_valid_authorization + sig { returns(NoValidAuthorization) } + attr_reader :no_valid_authorization + # Attribute for field not_received + sig { returns(NotReceived) } + attr_reader :not_received + # Attribute for field other + sig { returns(Other) } + attr_reader :other + # The reason for filing the dispute. Its value will match the field containing the evidence. + sig { returns(String) } + attr_reader :reason + # Attribute for field service_not_as_described + sig { returns(ServiceNotAsDescribed) } + attr_reader :service_not_as_described + end + class Treasury < Stripe::StripeObject + # The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute + sig { returns(T.nilable(String)) } + attr_reader :debit_reversal + # The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. + sig { returns(String) } + attr_reader :received_debit + end + # Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). + sig { returns(Integer) } + attr_reader :amount + + # List of balance transactions associated with the dispute. + sig { returns(T.nilable(T::Array[Stripe::BalanceTransaction])) } + attr_reader :balance_transactions + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The currency the `transaction` was made in. + sig { returns(String) } + attr_reader :currency + + # Attribute for field evidence + sig { returns(Evidence) } + attr_reader :evidence + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values. + sig { returns(String) } + attr_reader :loss_reason + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Current status of the dispute. + sig { returns(String) } + attr_reader :status + + # The transaction being disputed. + sig { returns(T.any(String, Stripe::Issuing::Transaction)) } + attr_reader :transaction + + # [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + sig { returns(T.nilable(Treasury)) } + attr_reader :treasury + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/dispute_settlement_detail.rbi b/rbi/stripe/resources/issuing/dispute_settlement_detail.rbi new file mode 100644 index 000000000..46f484da3 --- /dev/null +++ b/rbi/stripe/resources/issuing/dispute_settlement_detail.rbi @@ -0,0 +1,54 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # Represents a record from the card network of a money movement or change in state for an Issuing dispute. These records are included in the settlement reports that we receive from networks and expose to users as Settlement objects. + class DisputeSettlementDetail < APIResource + # Disputed amount in the card’s currency and in the smallest currency unit. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). + sig { returns(Integer) } + attr_reader :amount + + # The card used to make the original transaction. + sig { returns(String) } + attr_reader :card + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The currency the original transaction was made in. 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). + sig { returns(String) } + attr_reader :currency + + # The ID of the linked dispute. + sig { returns(String) } + attr_reader :dispute + + # The type of event corresponding to this dispute settlement detail, representing the stage in the dispute network lifecycle. + sig { returns(String) } + attr_reader :event_type + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The card network for this dispute settlement detail. One of ["visa", "mastercard", "maestro"] + sig { returns(String) } + attr_reader :network + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ID of the linked card network settlement. + sig { returns(T.nilable(String)) } + attr_reader :settlement + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/fraud_liability_debit.rbi b/rbi/stripe/resources/issuing/fraud_liability_debit.rbi new file mode 100644 index 000000000..5d0ee1af2 --- /dev/null +++ b/rbi/stripe/resources/issuing/fraud_liability_debit.rbi @@ -0,0 +1,42 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # A fraud liability debit occurs when Stripe debits a platform's account for fraud losses on Issuing transactions. + class FraudLiabilityDebit < APIResource + # Debited amount. This is equal to the disputed amount and is given in the card’s currency and in the smallest currency unit. + sig { returns(Integer) } + attr_reader :amount + + # ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this debit. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The currency of the debit. 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). + sig { returns(String) } + attr_reader :currency + + # The ID of the linked dispute. + sig { returns(String) } + attr_reader :dispute + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/personalization_design.rbi b/rbi/stripe/resources/issuing/personalization_design.rbi new file mode 100644 index 000000000..136f9e82f --- /dev/null +++ b/rbi/stripe/resources/issuing/personalization_design.rbi @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line. + class PersonalizationDesign < APIResource + class CarrierText < Stripe::StripeObject + # The footer body text of the carrier letter. + sig { returns(T.nilable(String)) } + attr_reader :footer_body + # The footer title text of the carrier letter. + sig { returns(T.nilable(String)) } + attr_reader :footer_title + # The header body text of the carrier letter. + sig { returns(T.nilable(String)) } + attr_reader :header_body + # The header title text of the carrier letter. + sig { returns(T.nilable(String)) } + attr_reader :header_title + end + class Preferences < Stripe::StripeObject + # Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. + sig { returns(T::Boolean) } + attr_reader :is_default + # Whether this personalization design is used to create cards when one is not specified and a default for this connected account does not exist. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_platform_default + end + class RejectionReasons < Stripe::StripeObject + # The reason(s) the card logo was rejected. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :card_logo + # The reason(s) the carrier text was rejected. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :carrier_text + end + # The file for the card logo to use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :card_logo + + # Hash containing carrier text, for use with physical bundles that support carrier text. + sig { returns(T.nilable(CarrierText)) } + attr_reader :carrier_text + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. + sig { returns(T.nilable(String)) } + attr_reader :lookup_key + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Friendly display name. + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The physical bundle object belonging to this personalization design. + sig { returns(T.any(String, Stripe::Issuing::PhysicalBundle)) } + attr_reader :physical_bundle + + # Attribute for field preferences + sig { returns(Preferences) } + attr_reader :preferences + + # Attribute for field rejection_reasons + sig { returns(RejectionReasons) } + attr_reader :rejection_reasons + + # Whether this personalization design can be used to create cards. + sig { returns(String) } + attr_reader :status + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/physical_bundle.rbi b/rbi/stripe/resources/issuing/physical_bundle.rbi new file mode 100644 index 000000000..81142c152 --- /dev/null +++ b/rbi/stripe/resources/issuing/physical_bundle.rbi @@ -0,0 +1,49 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. + class PhysicalBundle < APIResource + class Features < Stripe::StripeObject + # The policy for how to use card logo images in a card design with this physical bundle. + sig { returns(String) } + attr_reader :card_logo + # The policy for how to use carrier letter text in a card design with this physical bundle. + sig { returns(String) } + attr_reader :carrier_text + # The policy for how to use a second line on a card with this physical bundle. + sig { returns(String) } + attr_reader :second_line + end + # Attribute for field features + sig { returns(Features) } + attr_reader :features + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Friendly display name. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Whether this physical bundle can be used to create cards. + sig { returns(String) } + attr_reader :status + + # Whether this physical bundle is a standard Stripe offering or custom-made for you. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/settlement.rbi b/rbi/stripe/resources/issuing/settlement.rbi new file mode 100644 index 000000000..eb2fd32ef --- /dev/null +++ b/rbi/stripe/resources/issuing/settlement.rbi @@ -0,0 +1,78 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # When a non-stripe BIN is used, any use of an [issued card](https://stripe.com/docs/issuing) must be settled directly with the card network. The net amount owed is represented by an Issuing `Settlement` object. + class Settlement < APIResource + # The Bank Identification Number reflecting this settlement record. + sig { returns(String) } + attr_reader :bin + + # The date that the transactions are cleared and posted to user's accounts. + sig { returns(Integer) } + attr_reader :clearing_date + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The total interchange received as reimbursement for the transactions. + sig { returns(Integer) } + attr_reader :interchange_fees + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The total net amount required to settle with the network. + sig { returns(Integer) } + attr_reader :net_total + + # The card network for this settlement report. One of ["visa", "maestro"] + sig { returns(String) } + attr_reader :network + + # The total amount of fees owed to the network. + sig { returns(Integer) } + attr_reader :network_fees + + # The Settlement Identification Number assigned by the network. + sig { returns(String) } + attr_reader :network_settlement_identifier + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # One of `international` or `uk_national_net`. + sig { returns(String) } + attr_reader :settlement_service + + # The current processing status of this settlement. + sig { returns(String) } + attr_reader :status + + # The total number of transactions reflected in this settlement. + sig { returns(Integer) } + attr_reader :transaction_count + + # The total transaction amount reflected in this settlement. + sig { returns(Integer) } + attr_reader :transaction_volume + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/token.rbi b/rbi/stripe/resources/issuing/token.rbi new file mode 100644 index 000000000..e82e9809c --- /dev/null +++ b/rbi/stripe/resources/issuing/token.rbi @@ -0,0 +1,163 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can [view and manage these tokens](https://stripe.com/docs/issuing/controls/token-management) through Stripe. + class Token < APIResource + class NetworkData < Stripe::StripeObject + class Device < Stripe::StripeObject + # An obfuscated ID derived from the device ID. + sig { returns(String) } + attr_reader :device_fingerprint + # The IP address of the device at provisioning time. + sig { returns(String) } + attr_reader :ip_address + # The geographic latitude/longitude coordinates of the device at provisioning time. The format is [+-]decimal/[+-]decimal. + sig { returns(String) } + attr_reader :location + # The name of the device used for tokenization. + sig { returns(String) } + attr_reader :name + # The phone number of the device used for tokenization. + sig { returns(String) } + attr_reader :phone_number + # The type of device used for tokenization. + sig { returns(String) } + attr_reader :type + end + class Mastercard < Stripe::StripeObject + # A unique reference ID from MasterCard to represent the card account number. + sig { returns(String) } + attr_reader :card_reference_id + # The network-unique identifier for the token. + sig { returns(String) } + attr_reader :token_reference_id + # The ID of the entity requesting tokenization, specific to MasterCard. + sig { returns(String) } + attr_reader :token_requestor_id + # The name of the entity requesting tokenization, if known. This is directly provided from MasterCard. + sig { returns(String) } + attr_reader :token_requestor_name + end + class Visa < Stripe::StripeObject + # A unique reference ID from Visa to represent the card account number. + sig { returns(String) } + attr_reader :card_reference_id + # The network-unique identifier for the token. + sig { returns(String) } + attr_reader :token_reference_id + # The ID of the entity requesting tokenization, specific to Visa. + sig { returns(String) } + attr_reader :token_requestor_id + # Degree of risk associated with the token between `01` and `99`, with higher number indicating higher risk. A `00` value indicates the token was not scored by Visa. + sig { returns(String) } + attr_reader :token_risk_score + end + class WalletProvider < Stripe::StripeObject + class CardholderAddress < Stripe::StripeObject + # The street address of the cardholder tokenizing the card. + sig { returns(String) } + attr_reader :line1 + # The postal code of the cardholder tokenizing the card. + sig { returns(String) } + attr_reader :postal_code + end + # The wallet provider-given account ID of the digital wallet the token belongs to. + sig { returns(String) } + attr_reader :account_id + # An evaluation on the trustworthiness of the wallet account between 1 and 5. A higher score indicates more trustworthy. + sig { returns(Integer) } + attr_reader :account_trust_score + # The method used for tokenizing a card. + sig { returns(String) } + attr_reader :card_number_source + # Attribute for field cardholder_address + sig { returns(CardholderAddress) } + attr_reader :cardholder_address + # The name of the cardholder tokenizing the card. + sig { returns(String) } + attr_reader :cardholder_name + # An evaluation on the trustworthiness of the device. A higher score indicates more trustworthy. + sig { returns(Integer) } + attr_reader :device_trust_score + # The hashed email address of the cardholder's account with the wallet provider. + sig { returns(String) } + attr_reader :hashed_account_email_address + # The reasons for suggested tokenization given by the card network. + sig { returns(T::Array[String]) } + attr_reader :reason_codes + # The recommendation on responding to the tokenization request. + sig { returns(String) } + attr_reader :suggested_decision + # The version of the standard for mapping reason codes followed by the wallet provider. + sig { returns(String) } + attr_reader :suggested_decision_version + end + # Attribute for field device + sig { returns(Device) } + attr_reader :device + # Attribute for field mastercard + sig { returns(Mastercard) } + attr_reader :mastercard + # The network that the token is associated with. An additional hash is included with a name matching this value, containing tokenization data specific to the card network. + sig { returns(String) } + attr_reader :type + # Attribute for field visa + sig { returns(Visa) } + attr_reader :visa + # Attribute for field wallet_provider + sig { returns(WalletProvider) } + attr_reader :wallet_provider + end + # Card associated with this token. + sig { returns(T.any(String, Stripe::Issuing::Card)) } + attr_reader :card + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The hashed ID derived from the device ID from the card network associated with the token. + sig { returns(T.nilable(String)) } + attr_reader :device_fingerprint + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The last four digits of the token. + sig { returns(String) } + attr_reader :last4 + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The token service provider / card network associated with the token. + sig { returns(String) } + attr_reader :network + + # Attribute for field network_data + sig { returns(NetworkData) } + attr_reader :network_data + + # Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :network_updated_at + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The usage state of the token. + sig { returns(String) } + attr_reader :status + + # The digital wallet for this token, if one was used. + sig { returns(String) } + attr_reader :wallet_provider + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/issuing/transaction.rbi b/rbi/stripe/resources/issuing/transaction.rbi new file mode 100644 index 000000000..bd3daf349 --- /dev/null +++ b/rbi/stripe/resources/issuing/transaction.rbi @@ -0,0 +1,321 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Issuing + # Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving + # your Stripe account, such as a completed purchase or refund, is represented by an Issuing + # `Transaction` object. + # + # Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions) + class Transaction < APIResource + class AmountDetails < Stripe::StripeObject + # The fee charged by the ATM for the cash withdrawal. + sig { returns(T.nilable(Integer)) } + attr_reader :atm_fee + # The amount of cash requested by the cardholder. + sig { returns(T.nilable(Integer)) } + attr_reader :cashback_amount + end + class MerchantData < Stripe::StripeObject + # A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. + sig { returns(String) } + attr_reader :category + # The merchant category code for the seller’s business + sig { returns(String) } + attr_reader :category_code + # City where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :city + # Country where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :country + # Name of the seller + sig { returns(T.nilable(String)) } + attr_reader :name + # Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. + sig { returns(String) } + attr_reader :network_id + # Postal code where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State where the seller is located + sig { returns(T.nilable(String)) } + attr_reader :state + # An ID assigned by the seller to the location of the sale. + sig { returns(T.nilable(String)) } + attr_reader :terminal_id + # URL provided by the merchant on a 3DS request + sig { returns(T.nilable(String)) } + attr_reader :url + end + class NetworkData < Stripe::StripeObject + # A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. + sig { returns(T.nilable(String)) } + attr_reader :processing_date + # Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + end + class PurchaseDetails < Stripe::StripeObject + class Fleet < Stripe::StripeObject + class CardholderPromptData < Stripe::StripeObject + # Driver ID. + sig { returns(T.nilable(String)) } + attr_reader :driver_id + # Odometer reading. + sig { returns(T.nilable(Integer)) } + attr_reader :odometer + # An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. + sig { returns(T.nilable(String)) } + attr_reader :unspecified_id + # User ID. + sig { returns(T.nilable(String)) } + attr_reader :user_id + # Vehicle number. + sig { returns(T.nilable(String)) } + attr_reader :vehicle_number + end + class ReportedBreakdown < Stripe::StripeObject + class Fuel < Stripe::StripeObject + # Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. + sig { returns(T.nilable(String)) } + attr_reader :gross_amount_decimal + end + class NonFuel < Stripe::StripeObject + # Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. + sig { returns(T.nilable(String)) } + attr_reader :gross_amount_decimal + end + class Tax < Stripe::StripeObject + # Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. + sig { returns(T.nilable(String)) } + attr_reader :local_amount_decimal + # Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. + sig { returns(T.nilable(String)) } + attr_reader :national_amount_decimal + end + # Breakdown of fuel portion of the purchase. + sig { returns(T.nilable(Fuel)) } + attr_reader :fuel + # Breakdown of non-fuel portion of the purchase. + sig { returns(T.nilable(NonFuel)) } + attr_reader :non_fuel + # Information about tax included in this transaction. + sig { returns(T.nilable(Tax)) } + attr_reader :tax + end + # Answers to prompts presented to cardholder at point of sale. + sig { returns(T.nilable(CardholderPromptData)) } + attr_reader :cardholder_prompt_data + # The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. + sig { returns(T.nilable(String)) } + attr_reader :purchase_type + # More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. + sig { returns(T.nilable(ReportedBreakdown)) } + attr_reader :reported_breakdown + # The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. + sig { returns(T.nilable(String)) } + attr_reader :service_type + end + class Flight < Stripe::StripeObject + class Segment < Stripe::StripeObject + # The three-letter IATA airport code of the flight's destination. + sig { returns(T.nilable(String)) } + attr_reader :arrival_airport_code + # The airline carrier code. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # The three-letter IATA airport code that the flight departed from. + sig { returns(T.nilable(String)) } + attr_reader :departure_airport_code + # The flight number. + sig { returns(T.nilable(String)) } + attr_reader :flight_number + # The flight's service class. + sig { returns(T.nilable(String)) } + attr_reader :service_class + # Whether a stopover is allowed on this flight. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :stopover_allowed + end + # The time that the flight departed. + sig { returns(T.nilable(Integer)) } + attr_reader :departure_at + # The name of the passenger. + sig { returns(T.nilable(String)) } + attr_reader :passenger_name + # Whether the ticket is refundable. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :refundable + # The legs of the trip. + sig { returns(T.nilable(T::Array[Segment])) } + attr_reader :segments + # The travel agency that issued the ticket. + sig { returns(T.nilable(String)) } + attr_reader :travel_agency + end + class Fuel < Stripe::StripeObject + # [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. + sig { returns(T.nilable(String)) } + attr_reader :industry_product_code + # The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :quantity_decimal + # The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. + sig { returns(String) } + attr_reader :type + # The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. + sig { returns(String) } + attr_reader :unit + # The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. + sig { returns(String) } + attr_reader :unit_cost_decimal + end + class Lodging < Stripe::StripeObject + # The time of checking into the lodging. + sig { returns(T.nilable(Integer)) } + attr_reader :check_in_at + # The number of nights stayed at the lodging. + sig { returns(T.nilable(Integer)) } + attr_reader :nights + end + class Receipt < Stripe::StripeObject + # The description of the item. The maximum length of this field is 26 characters. + sig { returns(T.nilable(String)) } + attr_reader :description + # The quantity of the item. + sig { returns(T.nilable(Float)) } + attr_reader :quantity + # The total for this line item in cents. + sig { returns(T.nilable(Integer)) } + attr_reader :total + # The unit cost of the item in cents. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_cost + end + # Fleet-specific information for transactions using Fleet cards. + sig { returns(T.nilable(Fleet)) } + attr_reader :fleet + # Information about the flight that was purchased with this transaction. + sig { returns(T.nilable(Flight)) } + attr_reader :flight + # Information about fuel that was purchased with this transaction. + sig { returns(T.nilable(Fuel)) } + attr_reader :fuel + # Information about lodging that was purchased with this transaction. + sig { returns(T.nilable(Lodging)) } + attr_reader :lodging + # The line items in the purchase. + sig { returns(T.nilable(T::Array[Receipt])) } + attr_reader :receipt + # A merchant-specific order number. + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class Treasury < Stripe::StripeObject + # The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund + sig { returns(T.nilable(String)) } + attr_reader :received_credit + # The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture + sig { returns(T.nilable(String)) } + attr_reader :received_debit + end + # The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + + # Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(T.nilable(AmountDetails)) } + attr_reader :amount_details + + # The `Authorization` object that led to this transaction. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Authorization))) } + attr_reader :authorization + + # ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # The card used to make this transaction. + sig { returns(T.any(String, Stripe::Issuing::Card)) } + attr_reader :card + + # The cardholder to whom this transaction belongs. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Cardholder))) } + attr_reader :cardholder + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # If you've disputed the transaction, the ID of the dispute. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Dispute))) } + attr_reader :dispute + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency. + sig { returns(Integer) } + attr_reader :merchant_amount + + # The currency with which the merchant is taking payment. + sig { returns(String) } + attr_reader :merchant_currency + + # Attribute for field merchant_data + sig { returns(MerchantData) } + attr_reader :merchant_data + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Details about the transaction, such as processing dates, set by the card network. + sig { returns(T.nilable(NetworkData)) } + attr_reader :network_data + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Additional purchase information that is optionally provided by the merchant. + sig { returns(T.nilable(PurchaseDetails)) } + attr_reader :purchase_details + + # Attribute for field settlement + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Settlement))) } + attr_reader :settlement + + # [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null. + sig { returns(T.nilable(T.any(String, Stripe::Issuing::Token))) } + attr_reader :token + + # [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts + sig { returns(T.nilable(Treasury)) } + attr_reader :treasury + + # The nature of the transaction. + sig { returns(String) } + attr_reader :type + + # The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. + sig { returns(T.nilable(String)) } + attr_reader :wallet + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/line_item.rbi b/rbi/stripe/resources/line_item.rbi new file mode 100644 index 000000000..c2361be63 --- /dev/null +++ b/rbi/stripe/resources/line_item.rbi @@ -0,0 +1,123 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A line item. + class LineItem < APIResource + class AdjustableQuantity < Stripe::StripeObject + # Attribute for field enabled + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field maximum + sig { returns(T.nilable(Integer)) } + attr_reader :maximum + # Attribute for field minimum + sig { returns(T.nilable(Integer)) } + attr_reader :minimum + end + class Discount < Stripe::StripeObject + # The amount discounted. + sig { returns(Integer) } + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + sig { returns(Stripe::Discount) } + attr_reader :discount + end + class Display < Stripe::StripeObject + # Attribute for field description + sig { returns(T.nilable(String)) } + attr_reader :description + # Attribute for field images + sig { returns(T::Array[String]) } + attr_reader :images + # Attribute for field name + sig { returns(String) } + attr_reader :name + end + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # Attribute for field adjustable_quantity + sig { returns(T.nilable(AdjustableQuantity)) } + attr_reader :adjustable_quantity + + # Total discount amount applied. If no discounts were applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_discount + + # Total before any discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + + # Total tax amount applied. If no tax was applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_tax + + # Total after discounts and taxes. + sig { returns(Integer) } + attr_reader :amount_total + + # 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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The discounts applied to the line item. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + + # Attribute for field display + sig { returns(Display) } + attr_reader :display + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The price used to generate the line item. + sig { returns(T.nilable(Stripe::Price)) } + attr_reader :price + + # The ID of the product for this line item. + # + # This will always be the same as `price.product`. + sig { returns(T.any(String, Stripe::Product)) } + attr_reader :product + + # The quantity of products being purchased. + sig { returns(T.nilable(Integer)) } + attr_reader :quantity + + # The taxes applied to the line item. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/login_link.rbi b/rbi/stripe/resources/login_link.rbi new file mode 100644 index 000000000..1774125f4 --- /dev/null +++ b/rbi/stripe/resources/login_link.rbi @@ -0,0 +1,20 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Login Links are single-use URLs for a connected account to access the Express Dashboard. The connected account's [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/object#account_object-controller-stripe_dashboard-type) must be `express` to have access to the Express Dashboard. + class LoginLink < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The URL for the login link. + sig { returns(String) } + attr_reader :url + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/mandate.rbi b/rbi/stripe/resources/mandate.rbi new file mode 100644 index 000000000..e4244d4d6 --- /dev/null +++ b/rbi/stripe/resources/mandate.rbi @@ -0,0 +1,222 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A Mandate is a record of the permission that your customer gives you to debit their payment method. + class Mandate < APIResource + class CustomerAcceptance < Stripe::StripeObject + class Offline < Stripe::StripeObject; end + class Online < Stripe::StripeObject + # The customer accepts the mandate from this IP address. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + # The customer accepts the mandate using the user agent of the browser. + sig { returns(T.nilable(String)) } + attr_reader :user_agent + end + # The time that the customer accepts the mandate. + sig { returns(T.nilable(Integer)) } + attr_reader :accepted_at + # Attribute for field offline + sig { returns(Offline) } + attr_reader :offline + # Attribute for field online + sig { returns(Online) } + attr_reader :online + # The mandate includes the type of customer acceptance information, such as: `online` or `offline`. + sig { returns(String) } + attr_reader :type + end + class MultiUse < Stripe::StripeObject; end + class PaymentMethodDetails < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + # List of Stripe products where this mandate can be selected automatically. + sig { returns(T::Array[String]) } + attr_reader :default_for + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + sig { returns(T.nilable(String)) } + attr_reader :interval_description + # Payment schedule for the mandate. + sig { returns(String) } + attr_reader :payment_schedule + # Transaction type of the mandate. + sig { returns(String) } + attr_reader :transaction_type + end + class AmazonPay < Stripe::StripeObject; end + class AuBecsDebit < Stripe::StripeObject + # The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. + sig { returns(String) } + attr_reader :url + end + class BacsDebit < Stripe::StripeObject + # The status of the mandate on the Bacs network. Can be one of `pending`, `revoked`, `refused`, or `accepted`. + sig { returns(String) } + attr_reader :network_status + # The unique reference identifying the mandate on the Bacs network. + sig { returns(String) } + attr_reader :reference + # When the mandate is revoked on the Bacs network this field displays the reason for the revocation. + sig { returns(T.nilable(String)) } + attr_reader :revocation_reason + # The URL that will contain the mandate that the customer has signed. + sig { returns(String) } + attr_reader :url + end + class Card < Stripe::StripeObject; end + class Cashapp < Stripe::StripeObject; end + class KakaoPay < Stripe::StripeObject; end + class KrCard < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject + # The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + sig { returns(T.nilable(String)) } + attr_reader :billing_agreement_id + # Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + sig { returns(T.nilable(String)) } + attr_reader :payer_id + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_email + end + class Payto < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + sig { returns(String) } + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + sig { returns(T.nilable(String)) } + attr_reader :end_date + # The periodicity at which payments will be collected. + sig { returns(String) } + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + sig { returns(T.nilable(Integer)) } + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + sig { returns(T.nilable(String)) } + attr_reader :purpose + # Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + sig { returns(T.nilable(String)) } + attr_reader :start_date + end + class RevolutPay < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject + # The unique reference of the mandate. + sig { returns(String) } + attr_reader :reference + # The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. + sig { returns(String) } + attr_reader :url + end + class UsBankAccount < Stripe::StripeObject + # Mandate collection method + sig { returns(String) } + attr_reader :collection_method + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # This mandate corresponds with a specific payment method type. The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class SingleUse < Stripe::StripeObject + # The amount of the payment on a single use mandate. + sig { returns(Integer) } + attr_reader :amount + # The currency of the payment on a single use mandate. + sig { returns(String) } + attr_reader :currency + end + # Attribute for field customer_acceptance + sig { returns(CustomerAcceptance) } + attr_reader :customer_acceptance + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Attribute for field multi_use + sig { returns(MultiUse) } + attr_reader :multi_use + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) that the mandate is intended for. + sig { returns(String) } + attr_reader :on_behalf_of + + # ID of the payment method associated with this mandate. + sig { returns(T.any(String, Stripe::PaymentMethod)) } + attr_reader :payment_method + + # Attribute for field payment_method_details + sig { returns(PaymentMethodDetails) } + attr_reader :payment_method_details + + # Attribute for field single_use + sig { returns(SingleUse) } + attr_reader :single_use + + # The mandate status indicates whether or not you can use it to initiate a payment. + sig { returns(String) } + attr_reader :status + + # The type of the mandate. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/margin.rbi b/rbi/stripe/resources/margin.rbi new file mode 100644 index 000000000..033757acb --- /dev/null +++ b/rbi/stripe/resources/margin.rbi @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A (partner) margin represents a specific discount distributed in partner reseller programs to business partners who + # resell products and services and earn a discount (margin) for doing so. + class Margin < APIResource + # Whether the margin can be applied to invoices, invoice items, or invoice line items. Defaults to `true`. + sig { returns(T::Boolean) } + attr_reader :active + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Name of the margin that's displayed on, for example, invoices. + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Percent that will be taken off the subtotal before tax (after all other discounts and promotions) of any invoice to which the margin is applied. + sig { returns(Float) } + attr_reader :percent_off + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/order.rbi b/rbi/stripe/resources/order.rbi new file mode 100644 index 000000000..5cb8ac441 --- /dev/null +++ b/rbi/stripe/resources/order.rbi @@ -0,0 +1,707 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # An Order describes a purchase being made by a customer, including the + # products & quantities being purchased, the order status, the payment information, + # and the billing/shipping details. + # + # Related guide: [Orders overview](https://stripe.com/docs/orders) + class Order < APIResource + class AutomaticTax < Stripe::StripeObject + # Whether Stripe automatically computes tax on this Order. + sig { returns(T::Boolean) } + attr_reader :enabled + # The status of the most recent automated tax calculation for this Order. + sig { returns(T.nilable(String)) } + attr_reader :status + end + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Billing address for the order. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Email address for the order. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name for the order. + sig { returns(T.nilable(String)) } + attr_reader :name + # Billing phone number for the order (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class Credit < Stripe::StripeObject + class GiftCard < Stripe::StripeObject + # The token of the gift card applied to the order + sig { returns(String) } + attr_reader :card + end + # The amount of this credit to apply to the order. + sig { returns(Integer) } + attr_reader :amount + # Details for a gift card. + sig { returns(T.nilable(GiftCard)) } + attr_reader :gift_card + # Line items on this order that are ineligible for this credit + sig { returns(T.nilable(T::Array[String])) } + attr_reader :ineligible_line_items + # The type of credit to apply to the order, only `gift_card` currently supported. + sig { returns(String) } + attr_reader :type + end + class Payment < Stripe::StripeObject + class Settings < Stripe::StripeObject + class AutomaticPaymentMethods < Stripe::StripeObject + # Whether this Order has been opted into managing payment method types via the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + sig { returns(T::Boolean) } + attr_reader :enabled + end + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + sig { returns(String) } + attr_reader :custom_mandate_url + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + sig { returns(T.nilable(String)) } + attr_reader :interval_description + # Payment schedule for the mandate. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class AfterpayClearpay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Order identifier shown to the user in Afterpay's online portal. We recommend using a value that helps you answer any questions a customer might have about the payment. The identifier is limited to 128 characters and may contain only letters, digits, underscores, backslashes and dashes. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Indicates that you intend to make future payments with the payment method. + # + # Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + # + # 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). + # + # If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + sig { returns(String) } + attr_reader :setup_future_usage + end + class Alipay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + sig { returns(String) } + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Card < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with the payment method. + # + # Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the order's Customer, if present, after the order's PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. + # + # 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). + # + # If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. + sig { returns(String) } + attr_reader :setup_future_usage + end + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + sig { returns(String) } + attr_reader :country + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + # + # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + sig { returns(T::Array[String]) } + attr_reader :requested_address_types + # The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :funding_type + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Ideal < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Klarna < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Preferred locale of the Klarna checkout page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_locale + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Link < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # [Deprecated] This is a legacy parameter that no longer has any function. + sig { returns(T.nilable(String)) } + attr_reader :persistent_token + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Oxxo < Stripe::StripeObject + # The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + sig { returns(Integer) } + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class P24 < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Paypal < Stripe::StripeObject + class LineItem < Stripe::StripeObject + class Tax < Stripe::StripeObject + # The tax for a single unit of the line item in minor units. Cannot be a negative number. + sig { returns(Integer) } + attr_reader :amount + # The tax behavior for the line item. + sig { returns(String) } + attr_reader :behavior + end + # Type of the line item. + sig { returns(String) } + attr_reader :category + # Description of the line item. + sig { returns(String) } + attr_reader :description + # Descriptive name of the line item. + sig { returns(String) } + attr_reader :name + # Quantity of the line item. Cannot be a negative number. + sig { returns(Integer) } + attr_reader :quantity + # Client facing stock keeping unit, article number or similar. + sig { returns(String) } + attr_reader :sku + # The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + sig { returns(String) } + attr_reader :sold_by + # Attribute for field tax + sig { returns(Tax) } + attr_reader :tax + # Price for a single unit of the line item in minor units. Cannot be a negative number. + sig { returns(Integer) } + attr_reader :unit_amount + end + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # The line items purchased by the customer. + sig { returns(T::Array[LineItem]) } + attr_reader :line_items + # Preferred locale of the PayPal checkout page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_locale + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + sig { returns(T.nilable(String)) } + attr_reader :reference + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + sig { returns(T.nilable(String)) } + attr_reader :reference_id + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + sig { returns(T::Array[String]) } + attr_reader :subsellers + end + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Sofort < Stripe::StripeObject + # Preferred language of the SOFORT authorization page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class WechatPay < Stripe::StripeObject + # The app ID registered with WeChat Pay. Only required when client is ios or android. + sig { returns(T.nilable(String)) } + attr_reader :app_id + # The client type that the end customer will pay from + sig { returns(T.nilable(String)) } + attr_reader :client + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + end + class TransferData < Stripe::StripeObject + # The amount that will be transferred automatically when the order is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # ID of the Connected account receiving the transfer. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + # Indicates whether order has been opted into using [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) to manage payment method types. + sig { returns(T.nilable(AutomaticPaymentMethods)) } + attr_reader :automatic_payment_methods + # PaymentMethod-specific configuration to provide to the order's PaymentIntent. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + # The list of [payment method types](https://stripe.com/docs/payments/payment-methods/overview) to provide to the order's PaymentIntent. Do not include this attribute if you prefer to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). + sig { returns(T.nilable(T::Array[String])) } + attr_reader :payment_method_types + # The URL to redirect the customer to after they authenticate their payment. + sig { returns(T.nilable(String)) } + attr_reader :return_url + # For non-card charges, you can use this value as the complete description that appears on your customers' statements. Must contain at least one letter, maximum 22 characters. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + # Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_suffix + # Provides configuration for completing a transfer for the order after it is paid. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + end + # ID of the payment intent associated with this order. Null when the order is `open`. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + # Settings describing how the order should configure generated PaymentIntents. + sig { returns(T.nilable(Settings)) } + attr_reader :settings + # The status of the underlying payment associated with this order, if any. Null when the order is `open`. + sig { returns(T.nilable(String)) } + attr_reader :status + end + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # Total shipping cost before any discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_tax + # Total shipping cost after discounts and taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The ID of the ShippingRate for this order. + sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) } + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Recipient shipping address. Required if the order includes products that are shippable. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Recipient name. + sig { returns(T.nilable(String)) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class TaxDetails < Stripe::StripeObject + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(T.nilable(String)) } + attr_reader :value + end + # Describes the purchaser's tax exemption status. One of `none`, `exempt`, or `reverse`. + sig { returns(String) } + attr_reader :tax_exempt + # The purchaser's tax IDs to be used in calculation of tax for this Order. + sig { returns(T::Array[TaxId]) } + attr_reader :tax_ids + end + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + sig { returns(Integer) } + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + sig { returns(Stripe::Discount) } + attr_reader :discount + end + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The aggregated discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The aggregated tax amounts by rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + # Attribute for field amount_credit + sig { returns(Integer) } + attr_reader :amount_credit + # This is the sum of all the discounts. + sig { returns(Integer) } + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + sig { returns(Integer) } + attr_reader :amount_tax + # Attribute for field breakdown + sig { returns(Breakdown) } + attr_reader :breakdown + end + # Attribute for field amount_remaining + sig { returns(Integer) } + attr_reader :amount_remaining + + # Order cost before any discounts or taxes are applied. A positive integer representing the subtotal of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :amount_subtotal + + # Total order cost after discounts and taxes are applied. A positive integer representing the cost of the order in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). To submit an order, the total must be either 0 or at least $0.50 USD or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). + sig { returns(Integer) } + attr_reader :amount_total + + # ID of the Connect application that created the Order, if any. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # Customer billing details associated with the order. + sig { returns(T.nilable(BillingDetails)) } + attr_reader :billing_details + + # The client secret of this Order. Used for client-side retrieval using a publishable key. + # + # The client secret can be used to complete a payment for an Order from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + # + # Refer to our docs for [creating and processing an order](https://stripe.com/docs/orders-beta/create-and-process) to learn about how client_secret should be handled. + sig { returns(T.nilable(String)) } + attr_reader :client_secret + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The credits applied to the Order. At most 10 credits can be applied to an Order. + sig { returns(T::Array[Credit]) } + attr_reader :credits + + # 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). + sig { returns(String) } + attr_reader :currency + + # The customer which this orders belongs to. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The discounts applied to the order. Use `expand[]=discounts` to expand each discount. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::Discount)])) } + attr_reader :discounts + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # A recent IP address of the purchaser used for tax reporting and tax location inference. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + + # A list of line items the customer is ordering. Each line item includes information about the product, the quantity, and the resulting cost. There is a maximum of 100 line items. + sig { returns(Stripe::ListObject) } + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field payment + sig { returns(Payment) } + attr_reader :payment + + # The details of the customer cost of shipping, including the customer chosen ShippingRate. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # Customer shipping information associated with the order. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + + # The overall status of the order. + sig { returns(String) } + attr_reader :status + + # Attribute for field tax_details + sig { returns(TaxDetails) } + attr_reader :tax_details + + # Attribute for field total_details + sig { returns(TotalDetails) } + attr_reader :total_details + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_attempt_record.rbi b/rbi/stripe/resources/payment_attempt_record.rbi new file mode 100644 index 000000000..e6a43ce9e --- /dev/null +++ b/rbi/stripe/resources/payment_attempt_record.rbi @@ -0,0 +1,208 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe. + # Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment + # method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment Record + # can have guaranteed funds. + class PaymentAttemptRecord < APIResource + class AmountCanceled < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountFailed < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountGuaranteed < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountRequested < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class CustomerDetails < Stripe::StripeObject + # ID of the Stripe Customer associated with this payment. + sig { returns(T.nilable(String)) } + attr_reader :customer + # The customer's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # The customer's name. + sig { returns(T.nilable(String)) } + attr_reader :name + # The customer's phone number. + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class PaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # A representation of a physical address. + sig { returns(Address) } + attr_reader :address + # The billing email associated with the method of payment. + sig { returns(T.nilable(String)) } + attr_reader :email + # The billing name associated with the method of payment. + sig { returns(T.nilable(String)) } + attr_reader :name + # The billing phone number associated with the method of payment. + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class Custom < Stripe::StripeObject + # Display name for the custom (user-defined) payment method type used to make this payment. + sig { returns(String) } + attr_reader :display_name + # The custom payment method type associated with this payment. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # The billing details associated with the method of payment. + sig { returns(T.nilable(BillingDetails)) } + attr_reader :billing_details + # Information about the custom (user-defined) payment method used to make this payment. + sig { returns(T.nilable(Custom)) } + attr_reader :custom + # ID of the Stripe PaymentMethod used to make this payment. + sig { returns(T.nilable(String)) } + attr_reader :payment_method + # The type of Payment Method used for this payment attempt. + sig { returns(String) } + attr_reader :type + end + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # A representation of a physical address. + sig { returns(Address) } + attr_reader :address + # The shipping recipient's name. + sig { returns(T.nilable(String)) } + attr_reader :name + # The shipping recipient's phone number. + sig { returns(T.nilable(String)) } + attr_reader :phone + end + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountCanceled) } + attr_reader :amount_canceled + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountFailed) } + attr_reader :amount_failed + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountGuaranteed) } + attr_reader :amount_guaranteed + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountRequested) } + attr_reader :amount_requested + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Customer information for this payment. + sig { returns(T.nilable(CustomerDetails)) } + attr_reader :customer_details + + # Indicates whether the customer was present in your checkout flow during this payment. + sig { returns(T.nilable(String)) } + attr_reader :customer_presence + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Information about the Payment Method debited for this payment. + sig { returns(T.nilable(PaymentMethodDetails)) } + attr_reader :payment_method_details + + # ID of the Payment Record this Payment Attempt Record belongs to. + sig { returns(String) } + attr_reader :payment_record + + # An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + sig { returns(T.nilable(String)) } + attr_reader :payment_reference + + # Shipping information for this payment. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_intent.rbi b/rbi/stripe/resources/payment_intent.rbi new file mode 100644 index 000000000..a8bb60a2d --- /dev/null +++ b/rbi/stripe/resources/payment_intent.rbi @@ -0,0 +1,2488 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + class PaymentIntent < APIResource + class AmountDetails < Stripe::StripeObject + class Tip < Stripe::StripeObject + # Portion of the amount that corresponds to a tip. + sig { returns(Integer) } + attr_reader :amount + end + # Attribute for field tip + sig { returns(Tip) } + attr_reader :tip + end + class AsyncWorkflows < Stripe::StripeObject + class Inputs < Stripe::StripeObject + class Tax < Stripe::StripeObject + # The [TaxCalculation](https://stripe.com/docs/api/tax/calculations) id + sig { returns(String) } + attr_reader :calculation + end + # Attribute for field tax + sig { returns(Tax) } + attr_reader :tax + end + # Attribute for field inputs + sig { returns(Inputs) } + attr_reader :inputs + end + class AutomaticPaymentMethods < Stripe::StripeObject + # Controls whether this PaymentIntent will accept redirect-based payment methods. + # + # Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. + sig { returns(String) } + attr_reader :allow_redirects + # Automatically calculates compatible payment methods + sig { returns(T::Boolean) } + attr_reader :enabled + end + class LastPaymentError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + sig { returns(String) } + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + sig { returns(String) } + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + sig { returns(String) } + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + sig { returns(String) } + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + sig { returns(String) } + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + sig { returns(String) } + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + sig { returns(Stripe::PaymentIntent) } + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + sig { returns(Stripe::PaymentMethod) } + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + sig { returns(String) } + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + sig { returns(String) } + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + sig { returns(Stripe::SetupIntent) } + attr_reader :setup_intent + # Attribute for field source + sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) } + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + sig { returns(String) } + attr_reader :type + end + class NextAction < Stripe::StripeObject + class AlipayHandleRedirect < Stripe::StripeObject + # The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. + sig { returns(T.nilable(String)) } + attr_reader :native_data + # The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. + sig { returns(T.nilable(String)) } + attr_reader :native_url + # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + sig { returns(T.nilable(String)) } + attr_reader :return_url + # The URL you must redirect your customer to in order to authenticate the payment. + sig { returns(T.nilable(String)) } + attr_reader :url + end + class BoletoDisplayDetails < Stripe::StripeObject + # The timestamp after which the boleto expires. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. + sig { returns(T.nilable(String)) } + attr_reader :hosted_voucher_url + # The boleto number. + sig { returns(T.nilable(String)) } + attr_reader :number + # The URL to the downloadable boleto voucher PDF. + sig { returns(T.nilable(String)) } + attr_reader :pdf + end + class CardAwaitNotification < Stripe::StripeObject + # The time that payment will be attempted. If customer approval is required, they need to provide approval before this time. + sig { returns(T.nilable(Integer)) } + attr_reader :charge_attempt_at + # 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. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :customer_approval_required + end + class CashappHandleRedirectOrDisplayQrCode < Stripe::StripeObject + class QrCode < Stripe::StripeObject + # The date (unix timestamp) when the QR code expires. + sig { returns(Integer) } + attr_reader :expires_at + # The image_url_png string used to render QR code + sig { returns(String) } + attr_reader :image_url_png + # The image_url_svg string used to render QR code + sig { returns(String) } + attr_reader :image_url_svg + end + # The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + sig { returns(String) } + attr_reader :hosted_instructions_url + # The url for mobile redirect based auth + sig { returns(String) } + attr_reader :mobile_auth_url + # Attribute for field qr_code + sig { returns(QrCode) } + attr_reader :qr_code + end + class DisplayBankTransferInstructions < Stripe::StripeObject + class FinancialAddress < Stripe::StripeObject + class Aba < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(String) } + attr_reader :account_holder_name + # The ABA account number + sig { returns(String) } + attr_reader :account_number + # The account type + sig { returns(String) } + attr_reader :account_type + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The bank name + sig { returns(String) } + attr_reader :bank_name + # The ABA routing number + sig { returns(String) } + attr_reader :routing_number + end + class Iban < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + sig { returns(String) } + attr_reader :account_holder_name + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The BIC/SWIFT code of the account. + sig { returns(String) } + attr_reader :bic + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # The IBAN of the account. + sig { returns(String) } + attr_reader :iban + end + class SortCode < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The name of the person or business that owns the bank account + sig { returns(String) } + attr_reader :account_holder_name + # The account number + sig { returns(String) } + attr_reader :account_number + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The six-digit sort code + sig { returns(String) } + attr_reader :sort_code + end + class Spei < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(String) } + attr_reader :account_holder_name + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The three-digit bank code + sig { returns(String) } + attr_reader :bank_code + # The short banking institution name + sig { returns(String) } + attr_reader :bank_name + # The CLABE number + sig { returns(String) } + attr_reader :clabe + end + class Swift < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(String) } + attr_reader :account_holder_name + # The account number + sig { returns(String) } + attr_reader :account_number + # The account type + sig { returns(String) } + attr_reader :account_type + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The bank name + sig { returns(String) } + attr_reader :bank_name + # The SWIFT code + sig { returns(String) } + attr_reader :swift_code + end + class Zengin < Stripe::StripeObject + class AccountHolderAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class BankAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field account_holder_address + sig { returns(AccountHolderAddress) } + attr_reader :account_holder_address + # The account holder name + sig { returns(T.nilable(String)) } + attr_reader :account_holder_name + # The account number + sig { returns(T.nilable(String)) } + attr_reader :account_number + # The bank account type. In Japan, this can only be `futsu` or `toza`. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # Attribute for field bank_address + sig { returns(BankAddress) } + attr_reader :bank_address + # The bank code of the account + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # The bank name of the account + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # The branch code of the account + sig { returns(T.nilable(String)) } + attr_reader :branch_code + # The branch name of the account + sig { returns(T.nilable(String)) } + attr_reader :branch_name + end + # ABA Records contain U.S. bank account details per the ABA format. + sig { returns(Aba) } + attr_reader :aba + # Iban Records contain E.U. bank account details per the SEPA format. + sig { returns(Iban) } + attr_reader :iban + # Sort Code Records contain U.K. bank account details per the sort code format. + sig { returns(SortCode) } + attr_reader :sort_code + # SPEI Records contain Mexico bank account details per the SPEI format. + sig { returns(Spei) } + attr_reader :spei + # The payment networks supported by this FinancialAddress + sig { returns(T::Array[String]) } + attr_reader :supported_networks + # SWIFT Records contain U.S. bank account details per the SWIFT format. + sig { returns(Swift) } + attr_reader :swift + # The type of financial address + sig { returns(String) } + attr_reader :type + # Zengin Records contain Japan bank account details per the Zengin format. + sig { returns(Zengin) } + attr_reader :zengin + end + # The remaining amount that needs to be transferred to complete the payment. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_remaining + # 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). + sig { returns(T.nilable(String)) } + attr_reader :currency + # A list of financial addresses that can be used to fund the customer balance + sig { returns(T::Array[FinancialAddress]) } + attr_reader :financial_addresses + # A link to a hosted page that guides your customer through completing the transfer. + sig { returns(T.nilable(String)) } + attr_reader :hosted_instructions_url + # A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Type of bank transfer + sig { returns(String) } + attr_reader :type + end + class KonbiniDisplayDetails < Stripe::StripeObject + class Stores < Stripe::StripeObject + class Familymart < Stripe::StripeObject + # The confirmation number. + sig { returns(String) } + attr_reader :confirmation_number + # The payment code. + sig { returns(String) } + attr_reader :payment_code + end + class Lawson < Stripe::StripeObject + # The confirmation number. + sig { returns(String) } + attr_reader :confirmation_number + # The payment code. + sig { returns(String) } + attr_reader :payment_code + end + class Ministop < Stripe::StripeObject + # The confirmation number. + sig { returns(String) } + attr_reader :confirmation_number + # The payment code. + sig { returns(String) } + attr_reader :payment_code + end + class Seicomart < Stripe::StripeObject + # The confirmation number. + sig { returns(String) } + attr_reader :confirmation_number + # The payment code. + sig { returns(String) } + attr_reader :payment_code + end + # FamilyMart instruction details. + sig { returns(T.nilable(Familymart)) } + attr_reader :familymart + # Lawson instruction details. + sig { returns(T.nilable(Lawson)) } + attr_reader :lawson + # Ministop instruction details. + sig { returns(T.nilable(Ministop)) } + attr_reader :ministop + # Seicomart instruction details. + sig { returns(T.nilable(Seicomart)) } + attr_reader :seicomart + end + # The timestamp at which the pending Konbini payment expires. + sig { returns(Integer) } + attr_reader :expires_at + # The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. + sig { returns(T.nilable(String)) } + attr_reader :hosted_voucher_url + # Attribute for field stores + sig { returns(Stores) } + attr_reader :stores + end + class MultibancoDisplayDetails < Stripe::StripeObject + # Entity number associated with this Multibanco payment. + sig { returns(T.nilable(String)) } + attr_reader :entity + # The timestamp at which the Multibanco voucher expires. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # The URL for the hosted Multibanco voucher page, which allows customers to view a Multibanco voucher. + sig { returns(T.nilable(String)) } + attr_reader :hosted_voucher_url + # Reference number associated with this Multibanco payment. + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class OxxoDisplayDetails < Stripe::StripeObject + # The timestamp after which the OXXO voucher expires. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_after + # The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. + sig { returns(T.nilable(String)) } + attr_reader :hosted_voucher_url + # OXXO reference number. + sig { returns(T.nilable(String)) } + attr_reader :number + end + class PaynowDisplayQrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + sig { returns(String) } + attr_reader :data + # The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. + sig { returns(T.nilable(String)) } + attr_reader :hosted_instructions_url + # The image_url_png string used to render QR code + sig { returns(String) } + attr_reader :image_url_png + # The image_url_svg string used to render QR code + sig { returns(String) } + attr_reader :image_url_svg + end + class PixDisplayQrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + sig { returns(String) } + attr_reader :data + # The date (unix timestamp) when the PIX expires. + sig { returns(Integer) } + attr_reader :expires_at + # The URL to the hosted pix instructions page, which allows customers to view the pix QR code. + sig { returns(String) } + attr_reader :hosted_instructions_url + # The image_url_png string used to render png QR code + sig { returns(String) } + attr_reader :image_url_png + # The image_url_svg string used to render svg QR code + sig { returns(String) } + attr_reader :image_url_svg + end + class PromptpayDisplayQrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + sig { returns(String) } + attr_reader :data + # The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. + sig { returns(String) } + attr_reader :hosted_instructions_url + # The PNG path used to render the QR code, can be used as the source in an HTML img tag + sig { returns(String) } + attr_reader :image_url_png + # The SVG path used to render the QR code, can be used as the source in an HTML img tag + sig { returns(String) } + attr_reader :image_url_svg + end + class RedirectToUrl < Stripe::StripeObject + # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + sig { returns(T.nilable(String)) } + attr_reader :return_url + # The URL you must redirect your customer to in order to authenticate the payment. + sig { returns(T.nilable(String)) } + attr_reader :url + end + class SwishHandleRedirectOrDisplayQrCode < Stripe::StripeObject + class QrCode < Stripe::StripeObject + # The raw data string used to generate QR code, it should be used together with QR code library. + sig { returns(String) } + attr_reader :data + # The image_url_png string used to render QR code + sig { returns(String) } + attr_reader :image_url_png + # The image_url_svg string used to render QR code + sig { returns(String) } + attr_reader :image_url_svg + end + # The URL to the hosted Swish instructions page, which allows customers to view the QR code. + sig { returns(String) } + attr_reader :hosted_instructions_url + # The url for mobile redirect based auth (for internal use only and not typically available in standard API requests). + sig { returns(String) } + attr_reader :mobile_auth_url + # Attribute for field qr_code + sig { returns(QrCode) } + attr_reader :qr_code + end + class VerifyWithMicrodeposits < Stripe::StripeObject + # The timestamp when the microdeposits are expected to land. + sig { returns(Integer) } + attr_reader :arrival_date + # The URL for the hosted verification page, which allows customers to verify their bank account. + sig { returns(String) } + attr_reader :hosted_verification_url + # The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. + sig { returns(T.nilable(String)) } + attr_reader :microdeposit_type + end + class WechatPayDisplayQrCode < Stripe::StripeObject + # The data being used to generate QR code + sig { returns(String) } + attr_reader :data + # The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. + sig { returns(String) } + attr_reader :hosted_instructions_url + # The base64 image data for a pre-generated QR code + sig { returns(String) } + attr_reader :image_data_url + # The image_url_png string used to render QR code + sig { returns(String) } + attr_reader :image_url_png + # The image_url_svg string used to render QR code + sig { returns(String) } + attr_reader :image_url_svg + end + class WechatPayRedirectToAndroidApp < Stripe::StripeObject + # app_id is the APP ID registered on WeChat open platform + sig { returns(String) } + attr_reader :app_id + # nonce_str is a random string + sig { returns(String) } + attr_reader :nonce_str + # package is static value + sig { returns(String) } + attr_reader :package + # an unique merchant ID assigned by WeChat Pay + sig { returns(String) } + attr_reader :partner_id + # an unique trading ID assigned by WeChat Pay + sig { returns(String) } + attr_reader :prepay_id + # A signature + sig { returns(String) } + attr_reader :sign + # Specifies the current time in epoch format + sig { returns(String) } + attr_reader :timestamp + end + class WechatPayRedirectToIosApp < Stripe::StripeObject + # An universal link that redirect to WeChat Pay app + sig { returns(String) } + attr_reader :native_url + end + # Attribute for field alipay_handle_redirect + sig { returns(AlipayHandleRedirect) } + attr_reader :alipay_handle_redirect + # Attribute for field boleto_display_details + sig { returns(BoletoDisplayDetails) } + attr_reader :boleto_display_details + # Attribute for field card_await_notification + sig { returns(CardAwaitNotification) } + attr_reader :card_await_notification + # Attribute for field cashapp_handle_redirect_or_display_qr_code + sig { returns(CashappHandleRedirectOrDisplayQrCode) } + attr_reader :cashapp_handle_redirect_or_display_qr_code + # Attribute for field display_bank_transfer_instructions + sig { returns(DisplayBankTransferInstructions) } + attr_reader :display_bank_transfer_instructions + # Attribute for field konbini_display_details + sig { returns(KonbiniDisplayDetails) } + attr_reader :konbini_display_details + # Attribute for field multibanco_display_details + sig { returns(MultibancoDisplayDetails) } + attr_reader :multibanco_display_details + # Attribute for field oxxo_display_details + sig { returns(OxxoDisplayDetails) } + attr_reader :oxxo_display_details + # Attribute for field paynow_display_qr_code + sig { returns(PaynowDisplayQrCode) } + attr_reader :paynow_display_qr_code + # Attribute for field pix_display_qr_code + sig { returns(PixDisplayQrCode) } + attr_reader :pix_display_qr_code + # Attribute for field promptpay_display_qr_code + sig { returns(PromptpayDisplayQrCode) } + attr_reader :promptpay_display_qr_code + # Attribute for field redirect_to_url + sig { returns(RedirectToUrl) } + attr_reader :redirect_to_url + # Attribute for field swish_handle_redirect_or_display_qr_code + sig { returns(SwishHandleRedirectOrDisplayQrCode) } + attr_reader :swish_handle_redirect_or_display_qr_code + # Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + sig { returns(String) } + attr_reader :type + # When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. + sig { returns(T::Hash[String, T.untyped]) } + attr_reader :use_stripe_sdk + # Attribute for field verify_with_microdeposits + sig { returns(VerifyWithMicrodeposits) } + attr_reader :verify_with_microdeposits + # Attribute for field wechat_pay_display_qr_code + sig { returns(WechatPayDisplayQrCode) } + attr_reader :wechat_pay_display_qr_code + # Attribute for field wechat_pay_redirect_to_android_app + sig { returns(WechatPayRedirectToAndroidApp) } + attr_reader :wechat_pay_redirect_to_android_app + # Attribute for field wechat_pay_redirect_to_ios_app + sig { returns(WechatPayRedirectToIosApp) } + attr_reader :wechat_pay_redirect_to_ios_app + end + class PaymentDetails < Stripe::StripeObject + class CarRental < Stripe::StripeObject + class Affiliate < Stripe::StripeObject + # The name of the affiliate that originated the purchase. + sig { returns(String) } + attr_reader :name + end + class Delivery < Stripe::StripeObject + class Recipient < Stripe::StripeObject + # The email of the recipient the ticket is delivered to. + sig { returns(String) } + attr_reader :email + # The name of the recipient the ticket is delivered to. + sig { returns(String) } + attr_reader :name + # The phone number of the recipient the ticket is delivered to. + sig { returns(String) } + attr_reader :phone + end + # The delivery method for the payment + sig { returns(String) } + attr_reader :mode + # Attribute for field recipient + sig { returns(Recipient) } + attr_reader :recipient + end + class Driver < Stripe::StripeObject + # Full name of the driver on the reservation. + sig { returns(String) } + attr_reader :name + end + class PickupAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ReturnAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field affiliate + sig { returns(Affiliate) } + attr_reader :affiliate + # The booking number associated with the car rental. + sig { returns(String) } + attr_reader :booking_number + # Class code of the car. + sig { returns(String) } + attr_reader :car_class_code + # Make of the car. + sig { returns(String) } + attr_reader :car_make + # Model of the car. + sig { returns(String) } + attr_reader :car_model + # The name of the rental car company. + sig { returns(String) } + attr_reader :company + # The customer service phone number of the car rental company. + sig { returns(String) } + attr_reader :customer_service_phone_number + # Number of days the car is being rented. + sig { returns(Integer) } + attr_reader :days_rented + # Attribute for field delivery + sig { returns(Delivery) } + attr_reader :delivery + # The details of the drivers associated with the trip. + sig { returns(T::Array[Driver]) } + attr_reader :drivers + # List of additional charges being billed. + sig { returns(T::Array[String]) } + attr_reader :extra_charges + # Indicates if the customer did not keep nor cancel their booking. + sig { returns(T::Boolean) } + attr_reader :no_show + # Attribute for field pickup_address + sig { returns(PickupAddress) } + attr_reader :pickup_address + # Car pick-up time. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :pickup_at + # Rental rate. + sig { returns(Integer) } + attr_reader :rate_amount + # The frequency at which the rate amount is applied. One of `day`, `week` or `month` + sig { returns(String) } + attr_reader :rate_interval + # The full name of the person or entity renting the car. + sig { returns(String) } + attr_reader :renter_name + # Attribute for field return_address + sig { returns(ReturnAddress) } + attr_reader :return_address + # Car return time. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :return_at + # Indicates whether the goods or services are tax-exempt or tax is not collected. + sig { returns(T::Boolean) } + attr_reader :tax_exempt + end + class EventDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class Affiliate < Stripe::StripeObject + # The name of the affiliate that originated the purchase. + sig { returns(String) } + attr_reader :name + end + class Delivery < Stripe::StripeObject + class Recipient < Stripe::StripeObject + # The email of the recipient the ticket is delivered to. + sig { returns(String) } + attr_reader :email + # The name of the recipient the ticket is delivered to. + sig { returns(String) } + attr_reader :name + # The phone number of the recipient the ticket is delivered to. + sig { returns(String) } + attr_reader :phone + end + # The delivery method for the payment + sig { returns(String) } + attr_reader :mode + # Attribute for field recipient + sig { returns(Recipient) } + attr_reader :recipient + end + # Indicates if the tickets are digitally checked when entering the venue. + sig { returns(T::Boolean) } + attr_reader :access_controlled_venue + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Attribute for field affiliate + sig { returns(Affiliate) } + attr_reader :affiliate + # The name of the company + sig { returns(String) } + attr_reader :company + # Attribute for field delivery + sig { returns(Delivery) } + attr_reader :delivery + # Event end time. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :ends_at + # Type of the event entertainment (concert, sports event etc) + sig { returns(String) } + attr_reader :genre + # The name of the event. + sig { returns(String) } + attr_reader :name + # Event start time. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :starts_at + end + class Subscription < Stripe::StripeObject + class Affiliate < Stripe::StripeObject + # The name of the affiliate that originated the purchase. + sig { returns(String) } + attr_reader :name + end + class BillingInterval < Stripe::StripeObject + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + sig { returns(Integer) } + attr_reader :count + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + end + # Attribute for field affiliate + sig { returns(Affiliate) } + attr_reader :affiliate + # Info whether the subscription will be auto renewed upon expiry. + sig { returns(T::Boolean) } + attr_reader :auto_renewal + # Attribute for field billing_interval + sig { returns(BillingInterval) } + attr_reader :billing_interval + # Subscription end time. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :ends_at + # Name of the product on subscription. e.g. Apple Music Subscription. + sig { returns(String) } + attr_reader :name + # Subscription start time. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :starts_at + end + # Attribute for field car_rental + sig { returns(CarRental) } + attr_reader :car_rental + # Attribute for field event_details + sig { returns(EventDetails) } + attr_reader :event_details + # Attribute for field subscription + sig { returns(Subscription) } + attr_reader :subscription + end + class PaymentMethodConfigurationDetails < Stripe::StripeObject + # ID of the payment method configuration used. + sig { returns(String) } + attr_reader :id + # ID of the parent payment method configuration used. + sig { returns(T.nilable(String)) } + attr_reader :parent + end + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + sig { returns(String) } + attr_reader :custom_mandate_url + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + sig { returns(T.nilable(String)) } + attr_reader :interval_description + # Payment schedule for the mandate. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class Affirm < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Preferred language of the Affirm authorization page that the customer is redirected to. + sig { returns(String) } + attr_reader :preferred_locale + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class AfterpayClearpay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. + # This field differs from the statement descriptor and item name. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Alipay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Alma < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class AmazonPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class AuBecsDebit < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class BacsDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + sig { returns(String) } + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Blik < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Boleto < Stripe::StripeObject + # 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. + sig { returns(Integer) } + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + class AvailablePlan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_reader :type + end + class Plan < Stripe::StripeObject + # For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. + sig { returns(T.nilable(Integer)) } + attr_reader :count + # For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. + # One of `month`. + sig { returns(T.nilable(String)) } + attr_reader :interval + # Type of installment plan, one of `fixed_count`. + sig { returns(String) } + attr_reader :type + end + # Installment plans that may be selected for this PaymentIntent. + sig { returns(T.nilable(T::Array[AvailablePlan])) } + attr_reader :available_plans + # Whether Installments are enabled for this PaymentIntent. + sig { returns(T::Boolean) } + attr_reader :enabled + # Installment plan selected for this PaymentIntent. + sig { returns(T.nilable(Plan)) } + attr_reader :plan + end + class MandateOptions < Stripe::StripeObject + # Amount to be charged for future payments. + sig { returns(Integer) } + attr_reader :amount + # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + sig { returns(String) } + attr_reader :amount_type + # A description of the mandate or subscription that is meant to be displayed to the customer. + sig { returns(T.nilable(String)) } + attr_reader :description + # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + sig { returns(T.nilable(Integer)) } + attr_reader :end_date + # Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + sig { returns(String) } + attr_reader :interval + # The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + sig { returns(T.nilable(Integer)) } + attr_reader :interval_count + # Unique identifier for the mandate or subscription. + sig { returns(String) } + attr_reader :reference + # Start date of the mandate or subscription. Start date should not be lesser than yesterday. + sig { returns(Integer) } + attr_reader :start_date + # Specifies the type of mandates supported. Possible values are `india`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :supported_types + end + class StatementDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(String) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(String) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(String) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(String) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(String) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Phone number + sig { returns(String) } + attr_reader :phone + end + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Installment details for this payment (Mexico only). + # + # For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). + sig { returns(T.nilable(Installments)) } + attr_reader :installments + # Configuration options for setting up an eMandate for cards issued in India. + sig { returns(T.nilable(MandateOptions)) } + attr_reader :mandate_options + # Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. + sig { returns(T.nilable(String)) } + attr_reader :network + # Request ability to [decrement the authorization](https://stripe.com/docs/payments/decremental-authorization) for this PaymentIntent. + sig { returns(String) } + attr_reader :request_decremental_authorization + # Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. + sig { returns(String) } + attr_reader :request_extended_authorization + # Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. + sig { returns(String) } + attr_reader :request_incremental_authorization + # Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. + sig { returns(String) } + attr_reader :request_multicapture + # Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. + sig { returns(String) } + attr_reader :request_overcapture + # Request partial authorization on this PaymentIntent. + sig { returns(String) } + attr_reader :request_partial_authorization + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + sig { returns(T.nilable(String)) } + attr_reader :request_three_d_secure + # When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). + sig { returns(T::Boolean) } + attr_reader :require_cvc_recollection + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. + sig { returns(String) } + attr_reader :statement_descriptor_suffix_kana + # Provides information about a card payment that customers see on their statements. Concatenated with the Kanji prefix (shortened Kanji descriptor) or Kanji statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 17 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 17 characters. + sig { returns(String) } + attr_reader :statement_descriptor_suffix_kanji + # Attribute for field statement_details + sig { returns(StatementDetails) } + attr_reader :statement_details + end + class CardPresent < Stripe::StripeObject + class Routing < Stripe::StripeObject + # Requested routing priority + sig { returns(T.nilable(String)) } + attr_reader :requested_priority + end + # Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) + sig { returns(T.nilable(T::Boolean)) } + attr_reader :request_extended_authorization + # Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :request_incremental_authorization_support + # Attribute for field routing + sig { returns(Routing) } + attr_reader :routing + end + class Cashapp < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + sig { returns(String) } + attr_reader :country + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. + # + # Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. + sig { returns(T::Array[String]) } + attr_reader :requested_address_types + # The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :funding_type + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Eps < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Fpx < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Giropay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Gopay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Grabpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class IdBankTransfer < Stripe::StripeObject + # The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now till 2678400 seconds (31 days) from now. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_after + # The UNIX timestamp until which the virtual bank account is valid. Permitted range is from now until 30 days from now. If unset, it defaults to 1 days from now. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Ideal < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class InteracPresent < Stripe::StripeObject; end + class KakaoPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Klarna < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Preferred locale of the Klarna checkout page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_locale + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Konbini < Stripe::StripeObject + # An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. + sig { returns(T.nilable(String)) } + attr_reader :confirmation_number + # The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_after_days + # The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # A product descriptor of up to 22 characters, which will appear to customers at the convenience store. + sig { returns(T.nilable(String)) } + attr_reader :product_description + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class KrCard < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Link < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # [Deprecated] This is a legacy parameter that no longer has any function. + sig { returns(T.nilable(String)) } + attr_reader :persistent_token + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class MbWay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Mobilepay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Multibanco < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class NaverPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class Oxxo < Stripe::StripeObject + # The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. + sig { returns(Integer) } + attr_reader :expires_after_days + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class P24 < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Payco < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class Paynow < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Paypal < Stripe::StripeObject + class LineItem < Stripe::StripeObject + class Tax < Stripe::StripeObject + # The tax for a single unit of the line item in minor units. Cannot be a negative number. + sig { returns(Integer) } + attr_reader :amount + # The tax behavior for the line item. + sig { returns(String) } + attr_reader :behavior + end + # Type of the line item. + sig { returns(String) } + attr_reader :category + # Description of the line item. + sig { returns(String) } + attr_reader :description + # Descriptive name of the line item. + sig { returns(String) } + attr_reader :name + # Quantity of the line item. Cannot be a negative number. + sig { returns(Integer) } + attr_reader :quantity + # Client facing stock keeping unit, article number or similar. + sig { returns(String) } + attr_reader :sku + # The Stripe account ID of the connected account that sells the item. This is only needed when using [Separate Charges and Transfers](https://docs.stripe.com/connect/separate-charges-and-transfers). + sig { returns(String) } + attr_reader :sold_by + # Attribute for field tax + sig { returns(Tax) } + attr_reader :tax + # Price for a single unit of the line item in minor units. Cannot be a negative number. + sig { returns(Integer) } + attr_reader :unit_amount + end + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # The line items purchased by the customer. + sig { returns(T::Array[LineItem]) } + attr_reader :line_items + # Preferred locale of the PayPal checkout page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_locale + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + sig { returns(T.nilable(String)) } + attr_reader :reference + # A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. + sig { returns(T.nilable(String)) } + attr_reader :reference_id + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + sig { returns(T::Array[String]) } + attr_reader :subsellers + end + class Payto < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + sig { returns(T.nilable(String)) } + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + sig { returns(T.nilable(String)) } + attr_reader :end_date + # The periodicity at which payments will be collected. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + sig { returns(T.nilable(Integer)) } + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + sig { returns(T.nilable(String)) } + attr_reader :purpose + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Pix < Stripe::StripeObject + # The number of seconds (between 10 and 1209600) after which Pix payment will expire. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_after_seconds + # The timestamp at which the Pix expires. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Promptpay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Qris < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Rechnung < Stripe::StripeObject; end + class RevolutPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class SamsungPay < Stripe::StripeObject + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + end + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Shopeepay < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Sofort < Stripe::StripeObject + # Preferred language of the SOFORT authorization page that the customer is redirected to. + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Swish < Stripe::StripeObject + # A reference for this payment to be displayed in the Swish app. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Twint < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + sig { returns(T::Array[String]) } + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + sig { returns(String) } + attr_reader :institution + end + class ManualEntry < Stripe::StripeObject + # Settings for configuring manual entry of account details. + sig { returns(String) } + attr_reader :mode + end + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + # Attribute for field manual_entry + sig { returns(ManualEntry) } + attr_reader :manual_entry + # The list of permissions to request. The `payment_method` permission must be included. + sig { returns(T::Array[String]) } + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + sig { returns(String) } + attr_reader :return_url + end + class MandateOptions < Stripe::StripeObject + # Mandate collection method + sig { returns(String) } + attr_reader :collection_method + end + # Attribute for field financial_connections + sig { returns(FinancialConnections) } + attr_reader :financial_connections + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Preferred transaction settlement speed + sig { returns(String) } + attr_reader :preferred_settlement_speed + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class WechatPay < Stripe::StripeObject + # The app ID registered with WeChat Pay. Only required when client is ios or android. + sig { returns(T.nilable(String)) } + attr_reader :app_id + # The client type that the end customer will pay from + sig { returns(T.nilable(String)) } + attr_reader :client + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + class Zip < Stripe::StripeObject + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(String) } + attr_reader :setup_future_usage + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + # Attribute for field alma + sig { returns(Alma) } + attr_reader :alma + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + # Attribute for field blik + sig { returns(Blik) } + attr_reader :blik + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + # Attribute for field fpx + sig { returns(Fpx) } + attr_reader :fpx + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + # Attribute for field gopay + sig { returns(Gopay) } + attr_reader :gopay + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + # Attribute for field interac_present + sig { returns(InteracPresent) } + attr_reader :interac_present + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field konbini + sig { returns(Konbini) } + attr_reader :konbini + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field mb_way + sig { returns(MbWay) } + attr_reader :mb_way + # Attribute for field mobilepay + sig { returns(Mobilepay) } + attr_reader :mobilepay + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + # Attribute for field naver_pay + sig { returns(NaverPay) } + attr_reader :naver_pay + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + # Attribute for field payco + sig { returns(Payco) } + attr_reader :payco + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field pix + sig { returns(Pix) } + attr_reader :pix + # Attribute for field promptpay + sig { returns(Promptpay) } + attr_reader :promptpay + # Attribute for field qris + sig { returns(Qris) } + attr_reader :qris + # Attribute for field rechnung + sig { returns(Rechnung) } + attr_reader :rechnung + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field shopeepay + sig { returns(Shopeepay) } + attr_reader :shopeepay + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + # Attribute for field twint + sig { returns(Twint) } + attr_reader :twint + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + # Attribute for field zip + sig { returns(Zip) } + attr_reader :zip + end + class Processing < Stripe::StripeObject + class Card < Stripe::StripeObject + class CustomerNotification < Stripe::StripeObject + # 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. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :approval_requested + # If customer approval is required, they need to provide approval before this time. + sig { returns(T.nilable(Integer)) } + attr_reader :completes_at + end + # Attribute for field customer_notification + sig { returns(CustomerNotification) } + attr_reader :customer_notification + end + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Type of the payment method for which payment is in `processing` state, one of `card`. + sig { returns(String) } + attr_reader :type + end + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class TransferData < Stripe::StripeObject + # Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + sig { returns(Integer) } + attr_reader :amount + # The account (if any) that the payment is attributed to for tax + # reporting, and where funds from the payment are transferred to after + # payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + sig { returns(Integer) } + attr_reader :amount + + # Amount that can be captured from this PaymentIntent. + sig { returns(Integer) } + attr_reader :amount_capturable + + # Attribute for field amount_details + sig { returns(AmountDetails) } + attr_reader :amount_details + + # Amount that this PaymentIntent collects. + sig { returns(Integer) } + attr_reader :amount_received + + # ID of the Connect application that created the PaymentIntent. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # Attribute for field async_workflows + sig { returns(AsyncWorkflows) } + attr_reader :async_workflows + + # Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) + sig { returns(T.nilable(AutomaticPaymentMethods)) } + attr_reader :automatic_payment_methods + + # Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + + # Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). + sig { returns(T.nilable(String)) } + attr_reader :cancellation_reason + + # Controls when the funds will be captured from the customer's account. + sig { returns(String) } + attr_reader :capture_method + + # The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. + # + # The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + # + # Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. + sig { returns(T.nilable(String)) } + attr_reader :client_secret + + # Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. + sig { returns(String) } + attr_reader :confirmation_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # ID of the Customer this PaymentIntent belongs to, if one exists. + # + # Payment methods attached to other Customers cannot be used with this PaymentIntent. + # + # If [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) is set and this PaymentIntent's payment method is not `card_present`, then the payment method attaches to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. If the payment method is `card_present` and isn't a digital wallet, then a [generated_card](https://docs.stripe.com/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card is created and attached to the Customer instead. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # ID of the invoice that created this PaymentIntent, if it exists. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :invoice + + # The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + sig { returns(T.nilable(LastPaymentError)) } + attr_reader :last_payment_error + + # ID of the latest [Charge object](https://stripe.com/docs/api/charges) created by this PaymentIntent. This property is `null` until PaymentIntent confirmation is attempted. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :latest_charge + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + sig { returns(T.nilable(NextAction)) } + attr_reader :next_action + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # Attribute for field payment_details + sig { returns(PaymentDetails) } + attr_reader :payment_details + + # ID of the payment method used in this PaymentIntent. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :payment_method + + # Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this PaymentIntent. + sig { returns(T.nilable(PaymentMethodConfigurationDetails)) } + attr_reader :payment_method_configuration_details + + # Payment-method-specific configuration for this PaymentIntent. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + + # The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + sig { returns(T::Array[String]) } + attr_reader :payment_method_types + + # If present, this property tells you about the processing state of the payment. + sig { returns(T.nilable(Processing)) } + attr_reader :processing + + # Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). + sig { returns(T.nilable(String)) } + attr_reader :receipt_email + + # ID of the review associated with this PaymentIntent, if any. + sig { returns(T.nilable(T.any(String, Stripe::Review))) } + attr_reader :review + + # Indicates whether confirmation for this PaymentIntent using a secret key is `required` or `optional`. + sig { returns(String) } + attr_reader :secret_key_confirmation + + # Indicates that you intend to make future payments with this PaymentIntent's payment method. + # + # If you provide a Customer with the PaymentIntent, you can use this parameter to [attach the payment method](/payments/save-during-payment) to the Customer after the PaymentIntent is confirmed and the customer completes any required actions. If you don't provide a Customer, you can still [attach](/api/payment_methods/attach) the payment method to a Customer after the transaction completes. + # + # If the payment method is `card_present` and isn't a digital wallet, Stripe creates and attaches a [generated_card](/api/charges/object#charge_object-payment_method_details-card_present-generated_card) payment method representing the card to the Customer instead. + # + # When processing card payments, Stripe uses `setup_future_usage` to help you comply with regional legislation and network rules, such as [SCA](/strong-customer-authentication). + sig { returns(T.nilable(String)) } + attr_reader :setup_future_usage + + # Shipping information for this PaymentIntent. + sig { returns(T.nilable(Shipping)) } + attr_reader :shipping + + # This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + sig { + returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)))) + } + attr_reader :source + + # Text that appears on the customer's statement as the statement descriptor for a non-card charge. This value overrides the account's default statement descriptor. For information about requirements, including the 22-character limit, see [the Statement Descriptor docs](https://docs.stripe.com/get-started/account/statement-descriptors). + # + # Setting this value for a card charge returns an error. For card charges, set the [statement_descriptor_suffix](https://docs.stripe.com/get-started/account/statement-descriptors#dynamic) instead. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # Provides information about a card charge. Concatenated to the account's [statement descriptor prefix](https://docs.stripe.com/get-started/account/statement-descriptors#static) to form the complete statement descriptor that appears on the customer's statement. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_suffix + + # Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). + sig { returns(String) } + attr_reader :status + + # The data that automatically creates a Transfer after the payment finalizes. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + + # A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). + sig { returns(T.nilable(String)) } + attr_reader :transfer_group + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_link.rbi b/rbi/stripe/resources/payment_link.rbi new file mode 100644 index 000000000..10b1e63b1 --- /dev/null +++ b/rbi/stripe/resources/payment_link.rbi @@ -0,0 +1,455 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. + # + # When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. + # + # Related guide: [Payment Links API](https://stripe.com/docs/payment-links) + class PaymentLink < APIResource + class AfterCompletion < Stripe::StripeObject + class HostedConfirmation < Stripe::StripeObject + # The custom message that is displayed to the customer after the purchase is complete. + sig { returns(T.nilable(String)) } + attr_reader :custom_message + end + class Redirect < Stripe::StripeObject + # The URL the customer will be redirected to after the purchase is complete. + sig { returns(String) } + attr_reader :url + end + # Attribute for field hosted_confirmation + sig { returns(HostedConfirmation) } + attr_reader :hosted_confirmation + # Attribute for field redirect + sig { returns(Redirect) } + attr_reader :redirect + # The specified behavior after the purchase is complete. + sig { returns(String) } + attr_reader :type + end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # If `true`, tax will be calculated automatically using the customer's location. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + end + class ConsentCollection < Stripe::StripeObject + class PaymentMethodReuseAgreement < Stripe::StripeObject + # Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. + # + # When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. + sig { returns(String) } + attr_reader :position + end + # Settings related to the payment method reuse text shown in the Checkout UI. + sig { returns(T.nilable(PaymentMethodReuseAgreement)) } + attr_reader :payment_method_reuse_agreement + # If set to `auto`, enables the collection of customer consent for promotional communications. + sig { returns(T.nilable(String)) } + attr_reader :promotions + # If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service. + sig { returns(T.nilable(String)) } + attr_reader :terms_of_service + end + class CustomField < Stripe::StripeObject + class Dropdown < Stripe::StripeObject + class Option < Stripe::StripeObject + # The label for the option, displayed to the customer. Up to 100 characters. + sig { returns(String) } + attr_reader :label + # The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. + sig { returns(String) } + attr_reader :value + end + # The options available for the customer to select. Up to 200 options allowed. + sig { returns(T::Array[Option]) } + attr_reader :options + end + class Label < Stripe::StripeObject + # Custom text for the label, displayed to the customer. Up to 50 characters. + sig { returns(T.nilable(String)) } + attr_reader :custom + # The type of the label. + sig { returns(String) } + attr_reader :type + end + class Numeric < Stripe::StripeObject + # The maximum character length constraint for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :minimum_length + end + class Text < Stripe::StripeObject + # The maximum character length constraint for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :maximum_length + # The minimum character length requirement for the customer's input. + sig { returns(T.nilable(Integer)) } + attr_reader :minimum_length + end + # Attribute for field dropdown + sig { returns(Dropdown) } + attr_reader :dropdown + # String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. + sig { returns(String) } + attr_reader :key + # Attribute for field label + sig { returns(Label) } + attr_reader :label + # Attribute for field numeric + sig { returns(Numeric) } + attr_reader :numeric + # Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. + sig { returns(T::Boolean) } + attr_reader :optional + # Attribute for field text + sig { returns(Text) } + attr_reader :text + # The type of the field. + sig { returns(String) } + attr_reader :type + end + class CustomText < Stripe::StripeObject + class AfterSubmit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + class ShippingAddress < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + class Submit < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + class TermsOfServiceAcceptance < Stripe::StripeObject + # Text may be up to 1200 characters in length. + sig { returns(String) } + attr_reader :message + end + # Custom text that should be displayed after the payment confirmation button. + sig { returns(T.nilable(AfterSubmit)) } + attr_reader :after_submit + # Custom text that should be displayed alongside shipping address collection. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + # Custom text that should be displayed alongside the payment confirmation button. + sig { returns(T.nilable(Submit)) } + attr_reader :submit + # Custom text that should be displayed in place of the default terms of service agreement text. + sig { returns(T.nilable(TermsOfServiceAcceptance)) } + attr_reader :terms_of_service_acceptance + end + class InvoiceCreation < Stripe::StripeObject + class InvoiceData < Stripe::StripeObject + class CustomField < Stripe::StripeObject + # The name of the custom field. + sig { returns(String) } + attr_reader :name + # The value of the custom field. + sig { returns(String) } + attr_reader :value + end + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + class RenderingOptions < Stripe::StripeObject + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + sig { returns(T.nilable(String)) } + attr_reader :amount_tax_display + end + # The account tax IDs associated with the invoice. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # A list of up to 4 custom fields to be displayed on the invoice. + sig { returns(T.nilable(T::Array[CustomField])) } + attr_reader :custom_fields + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + # Footer to be displayed on the invoice. + sig { returns(T.nilable(String)) } + attr_reader :footer + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + sig { returns(T.nilable(Issuer)) } + attr_reader :issuer + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # Options for invoice PDF rendering. + sig { returns(T.nilable(RenderingOptions)) } + attr_reader :rendering_options + end + # Enable creating an invoice on successful payment. + sig { returns(T::Boolean) } + attr_reader :enabled + # Configuration for the invoice. Default invoice values will be used if unspecified. + sig { returns(T.nilable(InvoiceData)) } + attr_reader :invoice_data + end + class PaymentIntentData < Stripe::StripeObject + # Indicates when the funds will be captured from the customer's account. + sig { returns(T.nilable(String)) } + attr_reader :capture_method + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + # Indicates that you intend to make future payments with the payment method collected during checkout. + sig { returns(T.nilable(String)) } + attr_reader :setup_future_usage + # For a non-card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + # For a card payment, information about the charge that appears on the customer's statement when this payment succeeds in creating a charge. Concatenated with the account's statement descriptor prefix to form the complete statement descriptor. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor_suffix + # A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. + sig { returns(T.nilable(String)) } + attr_reader :transfer_group + end + class PhoneNumberCollection < Stripe::StripeObject + # If `true`, a phone number will be collected during checkout. + sig { returns(T::Boolean) } + attr_reader :enabled + end + class Restrictions < Stripe::StripeObject + class CompletedSessions < Stripe::StripeObject + # The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. + sig { returns(Integer) } + attr_reader :count + # The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. + sig { returns(Integer) } + attr_reader :limit + end + # Attribute for field completed_sessions + sig { returns(CompletedSessions) } + attr_reader :completed_sessions + end + class ShippingAddressCollection < Stripe::StripeObject + # An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. + sig { returns(T::Array[String]) } + attr_reader :allowed_countries + end + class ShippingOption < Stripe::StripeObject + # A non-negative integer in cents representing how much to charge. + sig { returns(Integer) } + attr_reader :shipping_amount + # The ID of the Shipping Rate to use for this shipping option. + sig { returns(T.any(String, Stripe::ShippingRate)) } + attr_reader :shipping_rate + end + class SubscriptionData < Stripe::StripeObject + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + end + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + sig { returns(String) } + attr_reader :missing_payment_method + end + # Defines how a subscription behaves when a free trial ends. + sig { returns(EndBehavior) } + attr_reader :end_behavior + end + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # Attribute for field invoice_settings + sig { returns(InvoiceSettings) } + attr_reader :invoice_settings + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + # Integer representing the number of trial period days before the customer is charged for the first time. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_period_days + # Settings related to subscription trials. + sig { returns(T.nilable(TrialSettings)) } + attr_reader :trial_settings + end + class TaxIdCollection < Stripe::StripeObject + # Indicates whether tax ID collection is enabled for the session. + sig { returns(T::Boolean) } + attr_reader :enabled + # Attribute for field required + sig { returns(String) } + attr_reader :required + end + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The connected account receiving the transfer. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. + sig { returns(T::Boolean) } + attr_reader :active + + # Attribute for field after_completion + sig { returns(AfterCompletion) } + attr_reader :after_completion + + # Whether user redeemable promotion codes are enabled. + sig { returns(T::Boolean) } + attr_reader :allow_promotion_codes + + # The ID of the Connect application that created the Payment Link. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # Configuration for collecting the customer's billing address. Defaults to `auto`. + sig { returns(String) } + attr_reader :billing_address_collection + + # When set, provides configuration to gather active consent from customers. + sig { returns(T.nilable(ConsentCollection)) } + attr_reader :consent_collection + + # 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). + sig { returns(String) } + attr_reader :currency + + # Collect additional information from your customer using custom fields. Up to 3 fields are supported. + sig { returns(T::Array[CustomField]) } + attr_reader :custom_fields + + # Attribute for field custom_text + sig { returns(CustomText) } + attr_reader :custom_text + + # Configuration for Customer creation during checkout. + sig { returns(String) } + attr_reader :customer_creation + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The custom message to be displayed to a customer when a payment link is no longer active. + sig { returns(T.nilable(String)) } + attr_reader :inactive_message + + # Configuration for creating invoice for payment mode payment links. + sig { returns(T.nilable(InvoiceCreation)) } + attr_reader :invoice_creation + + # The line items representing what is being sold. + sig { returns(Stripe::ListObject) } + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # Indicates the parameters to be passed to PaymentIntent creation during checkout. + sig { returns(T.nilable(PaymentIntentData)) } + attr_reader :payment_intent_data + + # Configuration for collecting a payment method during checkout. Defaults to `always`. + sig { returns(String) } + attr_reader :payment_method_collection + + # The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). + sig { returns(T.nilable(T::Array[String])) } + attr_reader :payment_method_types + + # Attribute for field phone_number_collection + sig { returns(PhoneNumberCollection) } + attr_reader :phone_number_collection + + # Settings that restrict the usage of a payment link. + sig { returns(T.nilable(Restrictions)) } + attr_reader :restrictions + + # Configuration for collecting the customer's shipping address. + sig { returns(T.nilable(ShippingAddressCollection)) } + attr_reader :shipping_address_collection + + # The shipping rate options applied to the session. + sig { returns(T::Array[ShippingOption]) } + attr_reader :shipping_options + + # Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. + sig { returns(String) } + attr_reader :submit_type + + # When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. + sig { returns(T.nilable(SubscriptionData)) } + attr_reader :subscription_data + + # Attribute for field tax_id_collection + sig { returns(TaxIdCollection) } + attr_reader :tax_id_collection + + # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + + # The public URL that can be shared with customers. + sig { returns(String) } + attr_reader :url + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_method.rbi b/rbi/stripe/resources/payment_method.rbi new file mode 100644 index 000000000..04669d7e0 --- /dev/null +++ b/rbi/stripe/resources/payment_method.rbi @@ -0,0 +1,1074 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + class PaymentMethod < APIResource + class AcssDebit < Stripe::StripeObject + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Institution number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :institution_number + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Transit number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :transit_number + end + class Affirm < Stripe::StripeObject; end + class AfterpayClearpay < Stripe::StripeObject; end + class Alipay < Stripe::StripeObject; end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + class AuBecsDebit < Stripe::StripeObject + # Six-digit number identifying bank and branch associated with this bank account. + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class BacsDebit < Stripe::StripeObject + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Sort code of the bank account. (e.g., `10-20-30`) + sig { returns(T.nilable(String)) } + attr_reader :sort_code + end + class Bancontact < Stripe::StripeObject; end + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Billing address. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + # Billing phone number (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class Blik < Stripe::StripeObject; end + class Boleto < Stripe::StripeObject + # Uniquely identifies the customer tax id (CNPJ or CPF) + sig { returns(String) } + attr_reader :tax_id + end + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + end + class GeneratedFrom < Stripe::StripeObject + class PaymentMethodDetails < Stripe::StripeObject + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + sig { returns(T.nilable(Integer)) } + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Receipt < Stripe::StripeObject + # The type of account being debited or credited + sig { returns(String) } + attr_reader :account_type + # EMV tag 9F26, cryptogram generated by the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :application_cryptogram + # Mnenomic of the Application Identifier. + sig { returns(T.nilable(String)) } + attr_reader :application_preferred_name + # Identifier for this transaction. + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # EMV tag 8A. A code returned by the card issuer. + sig { returns(T.nilable(String)) } + attr_reader :authorization_response_code + # Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_verification_method + # EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + sig { returns(T.nilable(String)) } + attr_reader :dedicated_file_name + # The outcome of a series of EMV functions performed by the card reader. + sig { returns(T.nilable(String)) } + attr_reader :terminal_verification_results + # An indication of various EMV functions performed during the transaction. + sig { returns(T.nilable(String)) } + attr_reader :transaction_status_information + end + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + sig { returns(String) } + attr_reader :type + end + # The authorized amount + sig { returns(T.nilable(Integer)) } + attr_reader :amount_authorized + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + sig { returns(T.nilable(String)) } + attr_reader :brand_product + # When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. + sig { returns(Integer) } + attr_reader :capture_before + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Authorization response cryptogram. + sig { returns(T.nilable(String)) } + attr_reader :emv_auth_data + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + sig { returns(T.nilable(String)) } + attr_reader :generated_card + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). + sig { returns(T::Boolean) } + attr_reader :incremental_authorization_supported + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :network + # This is used by the financial networks to identify a transaction. Visa calls this the Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the Acquirer Reference Data. The first three digits of the Trace ID is the Financial Network Code, the next 6 digits is the Banknet Reference Number, and the last 4 digits represent the date (MM/DD). This field will be available for successful Visa, Mastercard, or American Express transactions and always null for other card brands. + sig { returns(T.nilable(String)) } + attr_reader :network_transaction_id + # Details about payments collected offline. + sig { returns(T.nilable(Offline)) } + attr_reader :offline + # Defines whether the authorized amount can be over-captured or not + sig { returns(T::Boolean) } + attr_reader :overcapture_supported + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + # A collection of fields required to be displayed on receipts. Only required for EMV transactions. + sig { returns(T.nilable(Receipt)) } + attr_reader :receipt + # Attribute for field wallet + sig { returns(Wallet) } + attr_reader :wallet + end + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. + sig { returns(String) } + attr_reader :type + end + # The charge that created this object. + sig { returns(T.nilable(String)) } + attr_reader :charge + # Transaction-specific details of the payment method used in the payment. + sig { returns(T.nilable(PaymentMethodDetails)) } + attr_reader :payment_method_details + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + sig { returns(T.nilable(T.any(String, Stripe::SetupAttempt))) } + attr_reader :setup_attempt + end + class Networks < Stripe::StripeObject + # All available networks for the card. + sig { returns(T::Array[String]) } + attr_reader :available + # The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + class ThreeDSecureUsage < Stripe::StripeObject + # Whether 3D Secure is supported on this card. + sig { returns(T::Boolean) } + attr_reader :supported + end + class Wallet < Stripe::StripeObject + class AmexExpressCheckout < Stripe::StripeObject; end + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + class Masterpass < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(BillingAddress)) } + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + class SamsungPay < Stripe::StripeObject; end + class VisaCheckout < Stripe::StripeObject + class BillingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class ShippingAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(BillingAddress)) } + attr_reader :billing_address + # Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(ShippingAddress)) } + attr_reader :shipping_address + end + # Attribute for field amex_express_checkout + sig { returns(AmexExpressCheckout) } + attr_reader :amex_express_checkout + # Attribute for field apple_pay + sig { returns(ApplePay) } + attr_reader :apple_pay + # (For tokenized numbers only.) The last four digits of the device account number. + sig { returns(T.nilable(String)) } + attr_reader :dynamic_last4 + # Attribute for field google_pay + sig { returns(GooglePay) } + attr_reader :google_pay + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field masterpass + sig { returns(Masterpass) } + attr_reader :masterpass + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + # The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + sig { returns(String) } + attr_reader :type + # Attribute for field visa_checkout + sig { returns(VisaCheckout) } + attr_reader :visa_checkout + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(String) } + attr_reader :brand + # Checks on Card address and CVC if provided. + sig { returns(T.nilable(Checks)) } + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. + sig { returns(T.nilable(String)) } + attr_reader :display_brand + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(String) } + attr_reader :funding + # Details of the original PaymentMethod that created this object. + sig { returns(T.nilable(GeneratedFrom)) } + attr_reader :generated_from + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(String) } + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # Contains details on how this Card may be used for 3D Secure authentication. + sig { returns(T.nilable(ThreeDSecureUsage)) } + attr_reader :three_d_secure_usage + # If this Card is part of a card wallet, this contains the details of the card wallet. + sig { returns(T.nilable(Wallet)) } + attr_reader :wallet + end + class CardPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + sig { returns(T::Array[String]) } + attr_reader :available + # The preferred network for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + sig { returns(T.nilable(Integer)) } + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Wallet < Stripe::StripeObject + # The type of mobile wallet, one of `apple_pay`, `google_pay`, `samsung_pay`, or `unknown`. + sig { returns(String) } + attr_reader :type + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The [product code](https://stripe.com/docs/card-product-codes) that identifies the specific program or product associated with a card. + sig { returns(T.nilable(String)) } + attr_reader :brand_product + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # Details about payment methods collected offline. + sig { returns(T.nilable(Offline)) } + attr_reader :offline + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + # Attribute for field wallet + sig { returns(Wallet) } + attr_reader :wallet + end + class Cashapp < Stripe::StripeObject + # A unique and immutable identifier assigned by Cash App to every buyer. + sig { returns(T.nilable(String)) } + attr_reader :buyer_id + # A public identifier for buyers using Cash App. + sig { returns(T.nilable(String)) } + attr_reader :cashtag + end + class CustomerBalance < Stripe::StripeObject; end + class Eps < Stripe::StripeObject + # The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. + sig { returns(T.nilable(String)) } + attr_reader :bank + end + class Fpx < Stripe::StripeObject + # Account holder type, if provided. Can be one of `individual` or `company`. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. + sig { returns(String) } + attr_reader :bank + end + class Giropay < Stripe::StripeObject; end + class Gopay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject; end + class IdBankTransfer < Stripe::StripeObject + # Attribute for field bank + sig { returns(T.nilable(String)) } + attr_reader :bank + # Attribute for field bank_code + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field display_name + sig { returns(T.nilable(String)) } + attr_reader :display_name + end + class Ideal < Stripe::StripeObject + # The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + sig { returns(T.nilable(String)) } + attr_reader :bank + # The Bank Identifier Code of the customer's bank, if the bank was provided. + sig { returns(T.nilable(String)) } + attr_reader :bic + end + class InteracPresent < Stripe::StripeObject + class Networks < Stripe::StripeObject + # All available networks for the card. + sig { returns(T::Array[String]) } + attr_reader :available + # The preferred network for the card. + sig { returns(T.nilable(String)) } + attr_reader :preferred + end + # Card brand. Can be `interac`, `mastercard` or `visa`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. + sig { returns(T.nilable(String)) } + attr_reader :cardholder_name + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Two-digit number representing the card's expiration month. + sig { returns(Integer) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(Integer) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Contains information about card networks that can be used to process the payment. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :preferred_locales + # How card details were read in this transaction. + sig { returns(T.nilable(String)) } + attr_reader :read_method + end + class KakaoPay < Stripe::StripeObject; end + class Klarna < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # The month of birth, between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year of birth. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + # The customer's date of birth, if provided. + sig { returns(T.nilable(Dob)) } + attr_reader :dob + end + class Konbini < Stripe::StripeObject; end + class KrCard < Stripe::StripeObject + # The local credit or debit card brand. + sig { returns(T.nilable(String)) } + attr_reader :brand + # The last four digits of the card. This may not be present for American Express cards. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class Link < Stripe::StripeObject + # Account owner's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # [Deprecated] This is a legacy parameter that no longer has any function. + sig { returns(String) } + attr_reader :persistent_token + end + class MbWay < Stripe::StripeObject; end + class Mobilepay < Stripe::StripeObject; end + class Multibanco < Stripe::StripeObject; end + class NaverPay < Stripe::StripeObject + # Whether to fund this transaction with Naver Pay points or a card. + sig { returns(String) } + attr_reader :funding + end + class Oxxo < Stripe::StripeObject; end + class P24 < Stripe::StripeObject + # The customer's bank, if provided. + sig { returns(T.nilable(String)) } + attr_reader :bank + end + class Payco < Stripe::StripeObject; end + class Paynow < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject + # Uniquely identifies this particular PayPal account. You can use this attribute to check whether two PayPal accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Owner's email. Values are provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :payer_email + # PayPal account PayerID. This identifier uniquely identifies the PayPal customer. + sig { returns(T.nilable(String)) } + attr_reader :payer_id + # Owner's verified email. Values are verified or provided by PayPal directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_email + end + class Payto < Stripe::StripeObject + # Bank-State-Branch number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # The PayID alias for the bank account. + sig { returns(T.nilable(String)) } + attr_reader :pay_id + end + class Pix < Stripe::StripeObject; end + class Promptpay < Stripe::StripeObject; end + class Qris < Stripe::StripeObject; end + class RadarOptions < Stripe::StripeObject + # A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. + sig { returns(String) } + attr_reader :session + end + class Rechnung < Stripe::StripeObject + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + sig { returns(Integer) } + attr_reader :day + # The month of birth, between 1 and 12. + sig { returns(Integer) } + attr_reader :month + # The four-digit year of birth. + sig { returns(Integer) } + attr_reader :year + end + # Attribute for field dob + sig { returns(Dob) } + attr_reader :dob + end + class RevolutPay < Stripe::StripeObject; end + class SamsungPay < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject + class GeneratedFrom < Stripe::StripeObject + # The ID of the Charge that generated this PaymentMethod, if any. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :charge + # The ID of the SetupAttempt that generated this PaymentMethod, if any. + sig { returns(T.nilable(T.any(String, Stripe::SetupAttempt))) } + attr_reader :setup_attempt + end + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Branch code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :branch_code + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Information about the object that generated this PaymentMethod. + sig { returns(T.nilable(GeneratedFrom)) } + attr_reader :generated_from + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class Shopeepay < Stripe::StripeObject; end + class Sofort < Stripe::StripeObject + # Two-letter ISO code representing the country the bank account is located in. + sig { returns(T.nilable(String)) } + attr_reader :country + end + class Swish < Stripe::StripeObject; end + class Twint < Stripe::StripeObject; end + class UsBankAccount < Stripe::StripeObject + class Networks < Stripe::StripeObject + # The preferred network. + sig { returns(T.nilable(String)) } + attr_reader :preferred + # All supported networks. + sig { returns(T::Array[String]) } + attr_reader :supported + end + class StatusDetails < Stripe::StripeObject + class Blocked < Stripe::StripeObject + # The ACH network code that resulted in this block. + sig { returns(T.nilable(String)) } + attr_reader :network_code + # The reason why this PaymentMethod's fingerprint has been blocked + sig { returns(T.nilable(String)) } + attr_reader :reason + end + # Attribute for field blocked + sig { returns(Blocked) } + attr_reader :blocked + end + # Account holder type: individual or company. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Account number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :account_number + # Account type: checkings or savings. Defaults to checking if omitted. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # The name of the bank. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # The ID of the Financial Connections Account used to create the payment method. + sig { returns(T.nilable(String)) } + attr_reader :financial_connections_account + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Contains information about US bank account networks that can be used. + sig { returns(T.nilable(Networks)) } + attr_reader :networks + # Routing number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + # Contains information about the future reusability of this PaymentMethod. + sig { returns(T.nilable(StatusDetails)) } + attr_reader :status_details + end + class WechatPay < Stripe::StripeObject; end + class Zip < Stripe::StripeObject; end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + + # This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. + sig { returns(String) } + attr_reader :allow_redisplay + + # Attribute for field alma + sig { returns(Alma) } + attr_reader :alma + + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + + # Attribute for field blik + sig { returns(Blik) } + attr_reader :blik + + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + + # Attribute for field card + sig { returns(Card) } + attr_reader :card + + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + + # Attribute for field fpx + sig { returns(Fpx) } + attr_reader :fpx + + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + + # Attribute for field gopay + sig { returns(Gopay) } + attr_reader :gopay + + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + + # Attribute for field interac_present + sig { returns(InteracPresent) } + attr_reader :interac_present + + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + + # Attribute for field konbini + sig { returns(Konbini) } + attr_reader :konbini + + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + + # Attribute for field link + sig { returns(Link) } + attr_reader :link + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Attribute for field mb_way + sig { returns(MbWay) } + attr_reader :mb_way + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Attribute for field mobilepay + sig { returns(Mobilepay) } + attr_reader :mobilepay + + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + + # Attribute for field naver_pay + sig { returns(NaverPay) } + attr_reader :naver_pay + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + + # Attribute for field payco + sig { returns(Payco) } + attr_reader :payco + + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + + # Attribute for field pix + sig { returns(Pix) } + attr_reader :pix + + # Attribute for field promptpay + sig { returns(Promptpay) } + attr_reader :promptpay + + # Attribute for field qris + sig { returns(Qris) } + attr_reader :qris + + # Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. + sig { returns(RadarOptions) } + attr_reader :radar_options + + # Attribute for field rechnung + sig { returns(Rechnung) } + attr_reader :rechnung + + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + + # Attribute for field samsung_pay + sig { returns(SamsungPay) } + attr_reader :samsung_pay + + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + + # Attribute for field shopeepay + sig { returns(Shopeepay) } + attr_reader :shopeepay + + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + + # Attribute for field twint + sig { returns(Twint) } + attr_reader :twint + + # The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + sig { returns(String) } + attr_reader :type + + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + + # Attribute for field zip + sig { returns(Zip) } + attr_reader :zip + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_method_configuration.rbi b/rbi/stripe/resources/payment_method_configuration.rbi new file mode 100644 index 000000000..4f06c0830 --- /dev/null +++ b/rbi/stripe/resources/payment_method_configuration.rbi @@ -0,0 +1,1111 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios. + # + # There are two types of PaymentMethodConfigurations. Which is used depends on the [charge type](https://stripe.com/docs/connect/charges): + # + # **Direct** configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect. + # + # **Child** configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter. + # + # Child configurations have a `parent` that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account's associated child configuration. Parent configurations are [managed in the dashboard](https://dashboard.stripe.com/settings/payment_methods/connected_accounts) and are not available in this API. + # + # Related guides: + # - [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations) + # - [Multiple configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs) + # - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations) + class PaymentMethodConfiguration < APIResource + class AcssDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Affirm < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class AfterpayClearpay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Alipay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Alma < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class AmazonPay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class ApplePay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class AuBecsDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class BacsDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Bancontact < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Blik < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Boleto < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Card < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class CartesBancaires < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Cashapp < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class CustomerBalance < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Eps < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Fpx < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Giropay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class GooglePay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Gopay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Grabpay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class IdBankTransfer < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Ideal < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Jcb < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Klarna < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Konbini < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Link < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Mobilepay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Multibanco < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Oxxo < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class P24 < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Paynow < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Paypal < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Payto < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Promptpay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Qris < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class RevolutPay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class SepaDebit < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Shopeepay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Sofort < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Swish < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Twint < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class UsBankAccount < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class WechatPay < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + class Zip < Stripe::StripeObject + class DisplayPreference < Stripe::StripeObject + # For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :overridable + # The account's display preference. + sig { returns(String) } + attr_reader :preference + # The effective display preference value. + sig { returns(String) } + attr_reader :value + end + # Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. + sig { returns(T::Boolean) } + attr_reader :available + # Attribute for field display_preference + sig { returns(DisplayPreference) } + attr_reader :display_preference + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + + # Whether the configuration can be used for new payments. + sig { returns(T::Boolean) } + attr_reader :active + + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + + # Attribute for field alma + sig { returns(Alma) } + attr_reader :alma + + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + + # Attribute for field apple_pay + sig { returns(ApplePay) } + attr_reader :apple_pay + + # For child configs, the Connect application associated with the configuration. + sig { returns(T.nilable(String)) } + attr_reader :application + + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + + # Attribute for field blik + sig { returns(Blik) } + attr_reader :blik + + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + + # Attribute for field card + sig { returns(Card) } + attr_reader :card + + # Attribute for field cartes_bancaires + sig { returns(CartesBancaires) } + attr_reader :cartes_bancaires + + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + + # Attribute for field customer_balance + sig { returns(CustomerBalance) } + attr_reader :customer_balance + + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + + # Attribute for field fpx + sig { returns(Fpx) } + attr_reader :fpx + + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + + # Attribute for field google_pay + sig { returns(GooglePay) } + attr_reader :google_pay + + # Attribute for field gopay + sig { returns(Gopay) } + attr_reader :gopay + + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + + # The default configuration is used whenever a payment method configuration is not specified. + sig { returns(T::Boolean) } + attr_reader :is_default + + # Attribute for field jcb + sig { returns(Jcb) } + attr_reader :jcb + + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + + # Attribute for field konbini + sig { returns(Konbini) } + attr_reader :konbini + + # Attribute for field link + sig { returns(Link) } + attr_reader :link + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Attribute for field mobilepay + sig { returns(Mobilepay) } + attr_reader :mobilepay + + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + + # The configuration's name. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field oxxo + sig { returns(Oxxo) } + attr_reader :oxxo + + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + + # For child configs, the configuration's parent configuration. + sig { returns(T.nilable(String)) } + attr_reader :parent + + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + + # Attribute for field promptpay + sig { returns(Promptpay) } + attr_reader :promptpay + + # Attribute for field qris + sig { returns(Qris) } + attr_reader :qris + + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + + # Attribute for field shopeepay + sig { returns(Shopeepay) } + attr_reader :shopeepay + + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + + # Attribute for field twint + sig { returns(Twint) } + attr_reader :twint + + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + + # Attribute for field zip + sig { returns(Zip) } + attr_reader :zip + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_method_domain.rbi b/rbi/stripe/resources/payment_method_domain.rbi new file mode 100644 index 000000000..520de023d --- /dev/null +++ b/rbi/stripe/resources/payment_method_domain.rbi @@ -0,0 +1,120 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A payment method domain represents a web domain that you have registered with Stripe. + # Stripe Elements use registered payment method domains to control where certain payment methods are shown. + # + # Related guide: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). + class PaymentMethodDomain < APIResource + class AmazonPay < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + sig { returns(String) } + attr_reader :error_message + end + # The status of the payment method on the domain. + sig { returns(String) } + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + sig { returns(StatusDetails) } + attr_reader :status_details + end + class ApplePay < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + sig { returns(String) } + attr_reader :error_message + end + # The status of the payment method on the domain. + sig { returns(String) } + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + sig { returns(StatusDetails) } + attr_reader :status_details + end + class GooglePay < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + sig { returns(String) } + attr_reader :error_message + end + # The status of the payment method on the domain. + sig { returns(String) } + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + sig { returns(StatusDetails) } + attr_reader :status_details + end + class Link < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + sig { returns(String) } + attr_reader :error_message + end + # The status of the payment method on the domain. + sig { returns(String) } + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + sig { returns(StatusDetails) } + attr_reader :status_details + end + class Paypal < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + # The error message associated with the status of the payment method on the domain. + sig { returns(String) } + attr_reader :error_message + end + # The status of the payment method on the domain. + sig { returns(String) } + attr_reader :status + # Contains additional details about the status of a payment method for a specific payment method domain. + sig { returns(StatusDetails) } + attr_reader :status_details + end + # Indicates the status of a specific payment method on a payment method domain. + sig { returns(AmazonPay) } + attr_reader :amazon_pay + + # Indicates the status of a specific payment method on a payment method domain. + sig { returns(ApplePay) } + attr_reader :apple_pay + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The domain name that this payment method domain object represents. + sig { returns(String) } + attr_reader :domain_name + + # Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. + sig { returns(T::Boolean) } + attr_reader :enabled + + # Indicates the status of a specific payment method on a payment method domain. + sig { returns(GooglePay) } + attr_reader :google_pay + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Indicates the status of a specific payment method on a payment method domain. + sig { returns(Link) } + attr_reader :link + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Indicates the status of a specific payment method on a payment method domain. + sig { returns(Paypal) } + attr_reader :paypal + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payment_record.rbi b/rbi/stripe/resources/payment_record.rbi new file mode 100644 index 000000000..13c5db4c8 --- /dev/null +++ b/rbi/stripe/resources/payment_record.rbi @@ -0,0 +1,220 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A Payment Record is a resource that allows you to represent payments that occur on- or off-Stripe. + # For example, you can create a Payment Record to model a payment made on a different payment processor, + # in order to mark an Invoice as paid and a Subscription as active. Payment Records consist of one or + # more Payment Attempt Records, which represent individual attempts made on a payment network. + class PaymentRecord < APIResource + class AmountCanceled < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountFailed < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountGuaranteed < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountRefunded < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class AmountRequested < Stripe::StripeObject + # 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). + sig { returns(String) } + attr_reader :currency + # A positive integer representing the amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) e.g., 100 cents for $1.00 or 100 for ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :value + end + class CustomerDetails < Stripe::StripeObject + # ID of the Stripe Customer associated with this payment. + sig { returns(T.nilable(String)) } + attr_reader :customer + # The customer's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # The customer's name. + sig { returns(T.nilable(String)) } + attr_reader :name + # The customer's phone number. + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class PaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # A representation of a physical address. + sig { returns(Address) } + attr_reader :address + # The billing email associated with the method of payment. + sig { returns(T.nilable(String)) } + attr_reader :email + # The billing name associated with the method of payment. + sig { returns(T.nilable(String)) } + attr_reader :name + # The billing phone number associated with the method of payment. + sig { returns(T.nilable(String)) } + attr_reader :phone + end + class Custom < Stripe::StripeObject + # Display name for the custom (user-defined) payment method type used to make this payment. + sig { returns(String) } + attr_reader :display_name + # The custom payment method type associated with this payment. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # The billing details associated with the method of payment. + sig { returns(T.nilable(BillingDetails)) } + attr_reader :billing_details + # Information about the custom (user-defined) payment method used to make this payment. + sig { returns(T.nilable(Custom)) } + attr_reader :custom + # ID of the Stripe PaymentMethod used to make this payment. + sig { returns(T.nilable(String)) } + attr_reader :payment_method + # The type of Payment Method used for this payment attempt. + sig { returns(String) } + attr_reader :type + end + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # A representation of a physical address. + sig { returns(Address) } + attr_reader :address + # The shipping recipient's name. + sig { returns(T.nilable(String)) } + attr_reader :name + # The shipping recipient's phone number. + sig { returns(T.nilable(String)) } + attr_reader :phone + end + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountCanceled) } + attr_reader :amount_canceled + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountFailed) } + attr_reader :amount_failed + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountGuaranteed) } + attr_reader :amount_guaranteed + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountRefunded) } + attr_reader :amount_refunded + + # A representation of an amount of money, consisting of an amount and a currency. + sig { returns(AmountRequested) } + attr_reader :amount_requested + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Customer information for this payment. + sig { returns(T.nilable(CustomerDetails)) } + attr_reader :customer_details + + # Indicates whether the customer was present in your checkout flow during this payment. + sig { returns(T.nilable(String)) } + attr_reader :customer_presence + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # ID of the latest Payment Attempt Record attached to this Payment Record. + sig { returns(String) } + attr_reader :latest_payment_attempt_record + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Information about the Payment Method debited for this payment. + sig { returns(T.nilable(PaymentMethodDetails)) } + attr_reader :payment_method_details + + # An opaque string for manual reconciliation of this payment, for example a check number or a payment processor ID. + sig { returns(T.nilable(String)) } + attr_reader :payment_reference + + # Shipping information for this payment. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/payout.rbi b/rbi/stripe/resources/payout.rbi new file mode 100644 index 000000000..81a0341af --- /dev/null +++ b/rbi/stripe/resources/payout.rbi @@ -0,0 +1,127 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A `Payout` object is created when you receive funds from Stripe, or when you + # initiate a payout to either a bank account or debit card of a [connected + # Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, + # and list all payouts. Payouts are made on [varying + # schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and + # industry. + # + # Related guide: [Receiving payouts](https://stripe.com/docs/payouts) + class Payout < APIResource + class TraceId < Stripe::StripeObject + # Possible values are `pending`, `supported`, and `unsupported`. When `payout.status` is `pending` or `in_transit`, this will be `pending`. When the payout transitions to `paid`, `failed`, or `canceled`, this status will become `supported` or `unsupported` shortly after in most cases. In some cases, this may appear as `pending` for up to 10 days after `arrival_date` until transitioning to `supported` or `unsupported`. + sig { returns(String) } + attr_reader :status + # The trace ID value if `trace_id.status` is `supported`, otherwise `nil`. + sig { returns(T.nilable(String)) } + attr_reader :value + end + # The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. + sig { returns(Integer) } + attr_reader :amount + + # The application fee (if any) for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + sig { returns(T.nilable(T.any(String, Stripe::ApplicationFee))) } + attr_reader :application_fee + + # The amount of the application fee (if any) requested for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays. + sig { returns(Integer) } + attr_reader :arrival_date + + # Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). + sig { returns(T::Boolean) } + attr_reader :automatic + + # ID of the balance transaction that describes the impact of this payout on your account balance. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # ID of the bank account or card the payout is sent to. + sig { returns(T.nilable(T.any(String, T.any(Stripe::BankAccount, Stripe::Card)))) } + attr_reader :destination + + # If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :failure_balance_transaction + + # Error code that provides a reason for a payout failure, if available. View our [list of failure codes](https://stripe.com/docs/api#payout_failures). + sig { returns(T.nilable(String)) } + attr_reader :failure_code + + # Message that provides the reason for a payout failure, if available. + sig { returns(T.nilable(String)) } + attr_reader :failure_message + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). + sig { returns(String) } + attr_reader :method + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # If the payout reverses another, this is the ID of the original payout. + sig { returns(T.nilable(T.any(String, Stripe::Payout))) } + attr_reader :original_payout + + # If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. + sig { returns(String) } + attr_reader :reconciliation_status + + # If the payout reverses, this is the ID of the payout that reverses this payout. + sig { returns(T.nilable(T.any(String, Stripe::Payout))) } + attr_reader :reversed_by + + # The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. + sig { returns(String) } + attr_reader :source_type + + # Extra information about a payout that displays on the user's bank statement. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`. + sig { returns(String) } + attr_reader :status + + # A value that generates from the beneficiary's bank that allows users to track payouts with their bank. Banks might call this a "reference number" or something similar. + sig { returns(T.nilable(TraceId)) } + attr_reader :trace_id + + # Can be `bank_account` or `card`. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/person.rbi b/rbi/stripe/resources/person.rbi new file mode 100644 index 000000000..927f934c9 --- /dev/null +++ b/rbi/stripe/resources/person.rbi @@ -0,0 +1,402 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # This is an object representing a person associated with a Stripe account. + # + # A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. + # + # See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). + class Person < APIResource + class AdditionalTosAcceptances < Stripe::StripeObject + class Account < Stripe::StripeObject + # The Unix timestamp marking when the legal guardian accepted the service agreement. + sig { returns(T.nilable(Integer)) } + attr_reader :date + # The IP address from which the legal guardian accepted the service agreement. + sig { returns(T.nilable(String)) } + attr_reader :ip + # The user agent of the browser from which the legal guardian accepted the service agreement. + sig { returns(T.nilable(String)) } + attr_reader :user_agent + end + # Details on the legal guardian's acceptance of the main Stripe service agreement. + sig { returns(T.nilable(Account)) } + attr_reader :account + end + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class AddressKana < Stripe::StripeObject + # City/Ward. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Block/Building number. + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Building details. + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # Prefecture. + sig { returns(T.nilable(String)) } + attr_reader :state + # Town/cho-me. + sig { returns(T.nilable(String)) } + attr_reader :town + end + class AddressKanji < Stripe::StripeObject + # City/Ward. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Block/Building number. + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Building details. + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # Prefecture. + sig { returns(T.nilable(String)) } + attr_reader :state + # Town/cho-me. + sig { returns(T.nilable(String)) } + attr_reader :town + end + class Dob < Stripe::StripeObject + # The day of birth, between 1 and 31. + sig { returns(T.nilable(Integer)) } + attr_reader :day + # The month of birth, between 1 and 12. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The four-digit year of birth. + sig { returns(T.nilable(Integer)) } + attr_reader :year + end + class FutureRequirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :original_fields_due + end + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + sig { returns(T.nilable(T::Array[Alternative])) } + attr_reader :alternatives + # Fields that need to be collected to keep the person's account enabled. If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. + sig { returns(T::Array[String]) } + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T::Array[Error]) } + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. + sig { returns(T::Array[String]) } + attr_reader :eventually_due + # Fields that weren't collected by the account's `requirements.current_deadline`. These fields need to be collected to enable the person's account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. + sig { returns(T::Array[String]) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T::Array[String]) } + attr_reader :pending_verification + end + class RegisteredAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class Relationship < Stripe::StripeObject + # Whether the person is the authorizer of the account's representative. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :authorizer + # Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :director + # Whether the person has significant responsibility to control, manage, or direct the organization. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :executive + # Whether the person is the legal guardian of the account's representative. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :legal_guardian + # Whether the person is an owner of the account’s legal entity. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :owner + # The percent owned by the person of the account's legal entity. + sig { returns(T.nilable(Float)) } + attr_reader :percent_ownership + # Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :representative + # The person's title (e.g., CEO, Support Engineer). + sig { returns(T.nilable(String)) } + attr_reader :title + end + class Requirements < Stripe::StripeObject + class Alternative < Stripe::StripeObject + # Fields that can be provided to satisfy all fields in `original_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :alternative_fields_due + # Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. + sig { returns(T::Array[String]) } + attr_reader :original_fields_due + end + class Error < Stripe::StripeObject + # The code for the type of error. + sig { returns(String) } + attr_reader :code + # An informative message that indicates the error type and provides additional details about the error. + sig { returns(String) } + attr_reader :reason + # The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. + sig { returns(String) } + attr_reader :requirement + end + # Fields that are due and can be satisfied by providing the corresponding alternative fields instead. + sig { returns(T.nilable(T::Array[Alternative])) } + attr_reader :alternatives + # Fields that need to be collected to keep the person's account enabled. If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. + sig { returns(T::Array[String]) } + attr_reader :currently_due + # Fields that are `currently_due` and need to be collected again because validation or verification failed. + sig { returns(T::Array[Error]) } + attr_reader :errors + # Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. + sig { returns(T::Array[String]) } + attr_reader :eventually_due + # Fields that weren't collected by the account's `current_deadline`. These fields need to be collected to enable the person's account. + sig { returns(T::Array[String]) } + attr_reader :past_due + # Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. + sig { returns(T::Array[String]) } + attr_reader :pending_verification + end + class Verification < Stripe::StripeObject + class AdditionalDocument < Stripe::StripeObject + # The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :back + # A user-displayable string describing the verification state of this document. For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". + sig { returns(T.nilable(String)) } + attr_reader :details + # One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. A machine-readable code specifying the verification state for this document. + sig { returns(T.nilable(String)) } + attr_reader :details_code + # The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :front + end + class Document < Stripe::StripeObject + # The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :back + # A user-displayable string describing the verification state of this document. For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". + sig { returns(T.nilable(String)) } + attr_reader :details + # One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. A machine-readable code specifying the verification state for this document. + sig { returns(T.nilable(String)) } + attr_reader :details_code + # The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. + sig { returns(T.nilable(T.any(String, Stripe::File))) } + attr_reader :front + end + # A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. + sig { returns(T.nilable(AdditionalDocument)) } + attr_reader :additional_document + # A user-displayable string describing the verification state for the person. For example, this may say "Provided identity information could not be verified". + sig { returns(T.nilable(String)) } + attr_reader :details + # One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. A machine-readable code specifying the verification state for the person. + sig { returns(T.nilable(String)) } + attr_reader :details_code + # Attribute for field document + sig { returns(Document) } + attr_reader :document + # The state of verification for the person. Possible values are `unverified`, `pending`, or `verified`. + sig { returns(String) } + attr_reader :status + end + # The account the person is associated with. + sig { returns(String) } + attr_reader :account + + # Attribute for field additional_tos_acceptances + sig { returns(AdditionalTosAcceptances) } + attr_reader :additional_tos_acceptances + + # Attribute for field address + sig { returns(Address) } + attr_reader :address + + # The Kana variation of the person's address (Japan only). + sig { returns(T.nilable(AddressKana)) } + attr_reader :address_kana + + # The Kanji variation of the person's address (Japan only). + sig { returns(T.nilable(AddressKanji)) } + attr_reader :address_kanji + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Attribute for field dob + sig { returns(Dob) } + attr_reader :dob + + # The person's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + + # The person's first name. + sig { returns(T.nilable(String)) } + attr_reader :first_name + + # The Kana variation of the person's first name (Japan only). + sig { returns(T.nilable(String)) } + attr_reader :first_name_kana + + # The Kanji variation of the person's first name (Japan only). + sig { returns(T.nilable(String)) } + attr_reader :first_name_kanji + + # A list of alternate names or aliases that the person is known by. + sig { returns(T::Array[String]) } + attr_reader :full_name_aliases + + # Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. + sig { returns(T.nilable(FutureRequirements)) } + attr_reader :future_requirements + + # The person's gender. + sig { returns(T.nilable(String)) } + attr_reader :gender + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Whether the person's `id_number` was provided. True if either the full ID number was provided or if only the required part of the ID number was provided (ex. last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). + sig { returns(T::Boolean) } + attr_reader :id_number_provided + + # Whether the person's `id_number_secondary` was provided. + sig { returns(T::Boolean) } + attr_reader :id_number_secondary_provided + + # The person's last name. + sig { returns(T.nilable(String)) } + attr_reader :last_name + + # The Kana variation of the person's last name (Japan only). + sig { returns(T.nilable(String)) } + attr_reader :last_name_kana + + # The Kanji variation of the person's last name (Japan only). + sig { returns(T.nilable(String)) } + attr_reader :last_name_kanji + + # The person's maiden name. + sig { returns(T.nilable(String)) } + attr_reader :maiden_name + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The country where the person is a national. + sig { returns(T.nilable(String)) } + attr_reader :nationality + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The person's phone number. + sig { returns(T.nilable(String)) } + attr_reader :phone + + # Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + sig { returns(String) } + attr_reader :political_exposure + + # Attribute for field registered_address + sig { returns(RegisteredAddress) } + attr_reader :registered_address + + # Attribute for field relationship + sig { returns(Relationship) } + attr_reader :relationship + + # Information about the requirements for this person, including what information needs to be collected, and by when. + sig { returns(T.nilable(Requirements)) } + attr_reader :requirements + + # Whether the last four digits of the person's Social Security number have been provided (U.S. only). + sig { returns(T::Boolean) } + attr_reader :ssn_last_4_provided + + # Attribute for field verification + sig { returns(Verification) } + attr_reader :verification + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/plan.rbi b/rbi/stripe/resources/plan.rbi new file mode 100644 index 000000000..a25bcdb97 --- /dev/null +++ b/rbi/stripe/resources/plan.rbi @@ -0,0 +1,128 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + # + # Plans define the base price, currency, and billing cycle for recurring purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). + class Plan < APIResource + class Tier < Stripe::StripeObject + # Price for the entire tier. + sig { returns(T.nilable(Integer)) } + attr_reader :flat_amount + # Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :flat_amount_decimal + # Per unit price for units relevant to the tier. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + # Up to and including to this quantity will be contained in the tier. + sig { returns(T.nilable(Integer)) } + attr_reader :up_to + end + class TransformUsage < Stripe::StripeObject + # Divide usage by this number. + sig { returns(Integer) } + attr_reader :divide_by + # After division, either round the result `up` or `down`. + sig { returns(String) } + attr_reader :round + end + # Whether the plan can be used for new purchases. + sig { returns(T::Boolean) } + attr_reader :active + + # Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. + sig { returns(T.nilable(String)) } + attr_reader :aggregate_usage + + # The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + # The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + sig { returns(T.nilable(String)) } + attr_reader :amount_decimal + + # Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + sig { returns(String) } + attr_reader :billing_scheme + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + + # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. + sig { returns(Integer) } + attr_reader :interval_count + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # The meter tracking the usage of a metered price + sig { returns(T.nilable(String)) } + attr_reader :meter + + # A brief description of the plan, hidden from customers. + sig { returns(T.nilable(String)) } + attr_reader :nickname + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The product whose pricing this plan determines. + sig { returns(T.nilable(T.any(String, Stripe::Product))) } + attr_reader :product + + # Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + sig { returns(T::Array[Tier]) } + attr_reader :tiers + + # Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. + sig { returns(T.nilable(String)) } + attr_reader :tiers_mode + + # Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. + sig { returns(T.nilable(TransformUsage)) } + attr_reader :transform_usage + + # Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + sig { returns(T.nilable(Integer)) } + attr_reader :trial_period_days + + # Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + sig { returns(String) } + attr_reader :usage_type + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/price.rbi b/rbi/stripe/resources/price.rbi new file mode 100644 index 000000000..59d7228ac --- /dev/null +++ b/rbi/stripe/resources/price.rbi @@ -0,0 +1,217 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). + class Price < APIResource + class CurrencyOptions < Stripe::StripeObject + class CustomUnitAmount < Stripe::StripeObject + # The maximum unit amount the customer can specify for this item. + sig { returns(T.nilable(Integer)) } + attr_reader :maximum + # The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + sig { returns(T.nilable(Integer)) } + attr_reader :minimum + # The starting unit amount which can be updated by the customer. + sig { returns(T.nilable(Integer)) } + attr_reader :preset + end + class Tier < Stripe::StripeObject + # Price for the entire tier. + sig { returns(T.nilable(Integer)) } + attr_reader :flat_amount + # Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :flat_amount_decimal + # Per unit price for units relevant to the tier. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + # Up to and including to this quantity will be contained in the tier. + sig { returns(T.nilable(Integer)) } + attr_reader :up_to + end + # When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + sig { returns(T.nilable(CustomUnitAmount)) } + attr_reader :custom_unit_amount + # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + sig { returns(T.nilable(String)) } + attr_reader :tax_behavior + # Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + sig { returns(T::Array[Tier]) } + attr_reader :tiers + # The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + # The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + end + class CustomUnitAmount < Stripe::StripeObject + # The maximum unit amount the customer can specify for this item. + sig { returns(T.nilable(Integer)) } + attr_reader :maximum + # The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. + sig { returns(T.nilable(Integer)) } + attr_reader :minimum + # The starting unit amount which can be updated by the customer. + sig { returns(T.nilable(Integer)) } + attr_reader :preset + end + class MigrateTo < Stripe::StripeObject + # The behavior controlling at what point in the subscription lifecycle to migrate the price + sig { returns(String) } + attr_reader :behavior + # The unix timestamp after at which subscriptions will start to migrate to the new price. + sig { returns(Integer) } + attr_reader :effective_after + # The id of the price being migrated to + sig { returns(String) } + attr_reader :price + end + class Recurring < Stripe::StripeObject + # Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. + sig { returns(T.nilable(String)) } + attr_reader :aggregate_usage + # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. + sig { returns(Integer) } + attr_reader :interval_count + # The meter tracking the usage of a metered price + sig { returns(T.nilable(String)) } + attr_reader :meter + # Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). + sig { returns(T.nilable(Integer)) } + attr_reader :trial_period_days + # Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. + sig { returns(String) } + attr_reader :usage_type + end + class Tier < Stripe::StripeObject + # Price for the entire tier. + sig { returns(T.nilable(Integer)) } + attr_reader :flat_amount + # Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :flat_amount_decimal + # Per unit price for units relevant to the tier. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + # Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + # Up to and including to this quantity will be contained in the tier. + sig { returns(T.nilable(Integer)) } + attr_reader :up_to + end + class TransformQuantity < Stripe::StripeObject + # Divide usage by this number. + sig { returns(Integer) } + attr_reader :divide_by + # After division, either round the result `up` or `down`. + sig { returns(String) } + attr_reader :round + end + # Whether the price can be used for new purchases. + sig { returns(T::Boolean) } + attr_reader :active + + # Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. + sig { returns(String) } + attr_reader :billing_scheme + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + sig { returns(T::Hash[String, CurrencyOptions]) } + attr_reader :currency_options + + # When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. + sig { returns(T.nilable(CustomUnitAmount)) } + attr_reader :custom_unit_amount + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. + sig { returns(T.nilable(String)) } + attr_reader :lookup_key + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Subscriptions using this price will be migrated to use the new referenced price. + sig { returns(T.nilable(MigrateTo)) } + attr_reader :migrate_to + + # A brief description of the price, hidden from customers. + sig { returns(T.nilable(String)) } + attr_reader :nickname + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ID of the product this price is associated with. + sig { returns(T.any(String, Stripe::Product)) } + attr_reader :product + + # The recurring components of a price such as `interval` and `usage_type`. + sig { returns(T.nilable(Recurring)) } + attr_reader :recurring + + # Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. + sig { returns(T.nilable(String)) } + attr_reader :tax_behavior + + # Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. + sig { returns(T::Array[Tier]) } + attr_reader :tiers + + # Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. + sig { returns(T.nilable(String)) } + attr_reader :tiers_mode + + # Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. + sig { returns(T.nilable(TransformQuantity)) } + attr_reader :transform_quantity + + # One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + sig { returns(String) } + attr_reader :type + + # The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. + sig { returns(T.nilable(Integer)) } + attr_reader :unit_amount + + # The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. + sig { returns(T.nilable(String)) } + attr_reader :unit_amount_decimal + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/product.rbi b/rbi/stripe/resources/product.rbi new file mode 100644 index 000000000..3bae61c88 --- /dev/null +++ b/rbi/stripe/resources/product.rbi @@ -0,0 +1,142 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Products describe the specific goods or services you offer to your customers. + # For example, you might offer a Standard and Premium version of your goods or service; each version would be a separate Product. + # They can be used in conjunction with [Prices](https://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), + # [share a Payment Link](https://stripe.com/docs/payment-links), + # [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), + # and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) + class Product < APIResource + class MarketingFeature < Stripe::StripeObject + # The marketing feature name. Up to 80 characters long. + sig { returns(String) } + attr_reader :name + end + class PackageDimensions < Stripe::StripeObject + # Height, in inches. + sig { returns(Float) } + attr_reader :height + # Length, in inches. + sig { returns(Float) } + attr_reader :length + # Weight, in ounces. + sig { returns(Float) } + attr_reader :weight + # Width, in inches. + sig { returns(Float) } + attr_reader :width + end + class Provisioning < Stripe::StripeObject + class GiftCard < Stripe::StripeObject + class FixedAmount < Stripe::StripeObject + # The initial amount with which the provisioned gift card will be created. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + end + # Attribute for field fixed_amount + sig { returns(T.nilable(FixedAmount)) } + attr_reader :fixed_amount + # The specific type of gift_card provisioning, only `fixed_amount` currently supported. + sig { returns(String) } + attr_reader :type + end + # Attribute for field gift_card + sig { returns(T.nilable(GiftCard)) } + attr_reader :gift_card + # The type of provisioning, only `gift_card` currently supported. + sig { returns(String) } + attr_reader :type + end + # Whether the product is currently available for purchase. + sig { returns(T::Boolean) } + attr_reader :active + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. + sig { returns(T.nilable(T.any(String, Stripe::Price))) } + attr_reader :default_price + + # The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + sig { returns(T::Array[String]) } + attr_reader :images + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). + sig { returns(T::Array[MarketingFeature]) } + attr_reader :marketing_features + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The product's name, meant to be displayable to the customer. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The dimensions of this product for shipping purposes. + sig { returns(T.nilable(PackageDimensions)) } + attr_reader :package_dimensions + + # Provisioning configuration for this product. + sig { returns(T.nilable(Provisioning)) } + attr_reader :provisioning + + # Whether this product is shipped (i.e., physical goods). + sig { returns(T.nilable(T::Boolean)) } + attr_reader :shippable + + # Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only used for subscription payments. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. + sig { returns(T.nilable(T.any(String, Stripe::TaxCode))) } + attr_reader :tax_code + + # The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. + sig { returns(String) } + attr_reader :type + + # A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. + sig { returns(T.nilable(String)) } + attr_reader :unit_label + + # Time at which the object was last updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + + # A URL of a publicly-accessible webpage for this product. + sig { returns(T.nilable(String)) } + attr_reader :url + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/product_feature.rbi b/rbi/stripe/resources/product_feature.rbi new file mode 100644 index 000000000..09ad339bd --- /dev/null +++ b/rbi/stripe/resources/product_feature.rbi @@ -0,0 +1,30 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A product_feature represents an attachment between a feature and a product. + # When a product is purchased that has a feature attached, Stripe will create an entitlement to the feature for the purchasing customer. + class ProductFeature < APIResource + # A feature represents a monetizable ability or functionality in your system. + # Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. + sig { returns(Stripe::Entitlements::Feature) } + attr_reader :entitlement_feature + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/promotion_code.rbi b/rbi/stripe/resources/promotion_code.rbi new file mode 100644 index 000000000..5e02944a0 --- /dev/null +++ b/rbi/stripe/resources/promotion_code.rbi @@ -0,0 +1,82 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to + # create multiple codes for a single coupon. + class PromotionCode < APIResource + class Restrictions < Stripe::StripeObject + class CurrencyOptions < Stripe::StripeObject + # Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + sig { returns(Integer) } + attr_reader :minimum_amount + end + # Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + sig { returns(T::Hash[String, CurrencyOptions]) } + attr_reader :currency_options + # A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices + sig { returns(T::Boolean) } + attr_reader :first_time_transaction + # Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). + sig { returns(T.nilable(Integer)) } + attr_reader :minimum_amount + # Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount + sig { returns(T.nilable(String)) } + attr_reader :minimum_amount_currency + end + # Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid. + sig { returns(T::Boolean) } + attr_reader :active + + # The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. Valid characters are lower case letters (a-z), upper case letters (A-Z), and digits (0-9). + sig { returns(String) } + attr_reader :code + + # A coupon contains information about a percent-off or amount-off discount you + # might want to apply to a customer. Coupons may be applied to [subscriptions](https://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), + # [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). + sig { returns(Stripe::Coupon) } + attr_reader :coupon + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The customer that this promotion code can be used by. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # Date at which the promotion code can no longer be redeemed. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Maximum number of times this promotion code can be redeemed. + sig { returns(T.nilable(Integer)) } + attr_reader :max_redemptions + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field restrictions + sig { returns(Restrictions) } + attr_reader :restrictions + + # Number of times this promotion code has been used. + sig { returns(Integer) } + attr_reader :times_redeemed + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/quote.rbi b/rbi/stripe/resources/quote.rbi new file mode 100644 index 000000000..e95cced4f --- /dev/null +++ b/rbi/stripe/resources/quote.rbi @@ -0,0 +1,732 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A Quote is a way to model prices that you'd like to provide to a customer. + # Once accepted, it will automatically create an invoice, subscription or subscription schedule. + class Quote < APIResource + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Automatically calculate taxes + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + # The status of the most recent automated tax calculation for this quote. + sig { returns(T.nilable(String)) } + attr_reader :status + end + class Computed < Stripe::StripeObject + class LastReestimationDetails < Stripe::StripeObject + class Failed < Stripe::StripeObject + # The failure `code` is more granular than the `reason` provided and may correspond to a Stripe error code. For automation errors, this field is one of: `reverse_api_failure`, `reverse_api_deadline_exceeeded`, or `reverse_api_response_validation_error`, which are Stripe error codes and map to the error `message` field. + sig { returns(T.nilable(String)) } + attr_reader :failure_code + # Information derived from the `failure_code` or a freeform message that explains the error as a human-readable English string. For example, "margin ID is not a valid ID". + sig { returns(T.nilable(String)) } + attr_reader :message + # The reason the reestimation failed. + sig { returns(String) } + attr_reader :reason + end + # When `status` is `failed`, provides details about the quote reestimation failure. + sig { returns(T.nilable(Failed)) } + attr_reader :failed + # Latest status of the reestimation. + sig { returns(String) } + attr_reader :status + end + class Recurring < Stripe::StripeObject + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + sig { returns(Integer) } + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + sig { returns(Stripe::Discount) } + attr_reader :discount + end + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The aggregated discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The aggregated tax amounts by rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + # This is the sum of all the discounts. + sig { returns(Integer) } + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + sig { returns(Integer) } + attr_reader :amount_tax + # Attribute for field breakdown + sig { returns(Breakdown) } + attr_reader :breakdown + end + # Total before any discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total after discounts and taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + # The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. + sig { returns(Integer) } + attr_reader :interval_count + # Attribute for field total_details + sig { returns(TotalDetails) } + attr_reader :total_details + end + class Upfront < Stripe::StripeObject + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + sig { returns(Integer) } + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + sig { returns(Stripe::Discount) } + attr_reader :discount + end + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The aggregated discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The aggregated tax amounts by rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + # This is the sum of all the discounts. + sig { returns(Integer) } + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + sig { returns(Integer) } + attr_reader :amount_tax + # Attribute for field breakdown + sig { returns(Breakdown) } + attr_reader :breakdown + end + # Total before any discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total after discounts and taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The line items that will appear on the next invoice after this quote is accepted. This does not include pending invoice items that exist on the customer but may still be included in the next invoice. + sig { returns(Stripe::ListObject) } + attr_reader :line_items + # Attribute for field total_details + sig { returns(TotalDetails) } + attr_reader :total_details + end + # Details of the most recent reestimate of the quote's preview schedules and upcoming invoices, including the status of Stripe's calculation. + sig { returns(T.nilable(LastReestimationDetails)) } + attr_reader :last_reestimation_details + # The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices. + sig { returns(T.nilable(Recurring)) } + attr_reader :recurring + # The time at which the quote's estimated schedules and upcoming invoices were generated. + sig { returns(T.nilable(Integer)) } + attr_reader :updated_at + # Attribute for field upfront + sig { returns(Upfront) } + attr_reader :upfront + end + class FromQuote < Stripe::StripeObject + # Whether this quote is a revision of a different quote. + sig { returns(T::Boolean) } + attr_reader :is_revision + # The quote that was cloned. + sig { returns(T.any(String, Stripe::Quote)) } + attr_reader :quote + end + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + end + class StatusDetails < Stripe::StripeObject + class Canceled < Stripe::StripeObject + # The reason this quote was marked as canceled. + sig { returns(T.nilable(String)) } + attr_reader :reason + # Time at which the quote was marked as canceled. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :transitioned_at + end + class Stale < Stripe::StripeObject + class LastReason < Stripe::StripeObject + class LinesInvalid < Stripe::StripeObject + # The timestamp at which the lines were marked as invalid. + sig { returns(Integer) } + attr_reader :invalid_at + # The list of lines that became invalid at the given timestamp. + sig { returns(T::Array[String]) } + attr_reader :lines + end + class SubscriptionChanged < Stripe::StripeObject + # The subscription's state before the quote was marked as stale. + sig { returns(T.nilable(Stripe::Subscription)) } + attr_reader :previous_subscription + end + class SubscriptionScheduleChanged < Stripe::StripeObject + # The subscription schedule's state before the quote was marked as stale. + sig { returns(T.nilable(Stripe::SubscriptionSchedule)) } + attr_reader :previous_subscription_schedule + end + # The ID of the line that is invalid if the stale reason type is `line_invalid`. + sig { returns(String) } + attr_reader :line_invalid + # The IDs of the lines that are invalid if the stale reason type is `lines_invalid`. + sig { returns(T::Array[LinesInvalid]) } + attr_reader :lines_invalid + # The user supplied mark stale reason. + sig { returns(T.nilable(String)) } + attr_reader :marked_stale + # The ID of the subscription that was canceled. + sig { returns(String) } + attr_reader :subscription_canceled + # Attribute for field subscription_changed + sig { returns(SubscriptionChanged) } + attr_reader :subscription_changed + # The ID of the subscription that was expired. + sig { returns(String) } + attr_reader :subscription_expired + # The ID of the subscription schedule that was canceled. + sig { returns(String) } + attr_reader :subscription_schedule_canceled + # Attribute for field subscription_schedule_changed + sig { returns(SubscriptionScheduleChanged) } + attr_reader :subscription_schedule_changed + # The ID of the subscription schedule that was released. + sig { returns(String) } + attr_reader :subscription_schedule_released + # The reason the quote was marked as stale. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Time at which the quote expires. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + # The most recent reason this quote was marked as stale. + sig { returns(T.nilable(LastReason)) } + attr_reader :last_reason + # Time at which the stale reason was updated. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :last_updated_at + # Time at which the quote was marked as stale. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :transitioned_at + end + # Attribute for field canceled + sig { returns(Canceled) } + attr_reader :canceled + # Attribute for field stale + sig { returns(Stale) } + attr_reader :stale + end + class StatusTransitions < Stripe::StripeObject + # The time that the quote was accepted. Measured in seconds since Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :accepted_at + # The time that the quote was canceled. Measured in seconds since Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # The time that the quote was finalized. Measured in seconds since Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :finalized_at + end + class SubscriptionData < Stripe::StripeObject + class BillOnAcceptance < Stripe::StripeObject + class BillFrom < Stripe::StripeObject + class LineStartsAt < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + end + # The materialized time. + sig { returns(T.nilable(Integer)) } + attr_reader :computed + # The timestamp the given line starts at. + sig { returns(T.nilable(LineStartsAt)) } + attr_reader :line_starts_at + # A precise Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The type of method to specify the `bill_from` time. + sig { returns(String) } + attr_reader :type + end + class BillUntil < Stripe::StripeObject + class Duration < Stripe::StripeObject + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + sig { returns(Integer) } + attr_reader :interval_count + end + class LineEndsAt < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + end + # The materialized time. + sig { returns(T.nilable(Integer)) } + attr_reader :computed + # Time span for the quote line starting from the `starts_at` date. + sig { returns(T.nilable(Duration)) } + attr_reader :duration + # The timestamp the given line ends at. + sig { returns(T.nilable(LineEndsAt)) } + attr_reader :line_ends_at + # A precise Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The type of method to specify the `bill_until` time. + sig { returns(String) } + attr_reader :type + end + # The start of the period to bill from when the Quote is accepted. + sig { returns(T.nilable(BillFrom)) } + attr_reader :bill_from + # The end of the period to bill until when the Quote is accepted. + sig { returns(T.nilable(BillUntil)) } + attr_reader :bill_until + end + class Prebilling < Stripe::StripeObject + # Attribute for field iterations + sig { returns(Integer) } + attr_reader :iterations + end + # Describes the period to bill for upon accepting the quote. + sig { returns(T.nilable(BillOnAcceptance)) } + attr_reader :bill_on_acceptance + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + sig { returns(String) } + attr_reader :billing_behavior + # Whether the subscription will always start a new billing period when the quote is accepted. + sig { returns(T.nilable(String)) } + attr_reader :billing_cycle_anchor + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :effective_date + # Behavior of the subscription schedule and underlying subscription when it ends. + sig { returns(T.nilable(String)) } + attr_reader :end_behavior + # The id of the subscription that will be updated when the quote is accepted. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :from_subscription + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # If specified, the invoicing for the given billing cycle iterations will be processed when the quote is accepted. Cannot be used with `effective_date`. + sig { returns(T.nilable(Prebilling)) } + attr_reader :prebilling + # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + sig { returns(String) } + attr_reader :proration_behavior + # Integer representing the number of trial period days before the customer is charged for the first time. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_period_days + end + class SubscriptionDataOverride < Stripe::StripeObject + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + sig { returns(T.nilable(String)) } + attr_reader :new_reference + # The ID of the schedule the line applies to. + sig { returns(T.nilable(String)) } + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + sig { returns(String) } + attr_reader :type + end + class BillOnAcceptance < Stripe::StripeObject + class BillFrom < Stripe::StripeObject + class LineStartsAt < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + end + # The materialized time. + sig { returns(T.nilable(Integer)) } + attr_reader :computed + # The timestamp the given line starts at. + sig { returns(T.nilable(LineStartsAt)) } + attr_reader :line_starts_at + # A precise Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The type of method to specify the `bill_from` time. + sig { returns(String) } + attr_reader :type + end + class BillUntil < Stripe::StripeObject + class Duration < Stripe::StripeObject + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + sig { returns(Integer) } + attr_reader :interval_count + end + class LineEndsAt < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + end + # The materialized time. + sig { returns(T.nilable(Integer)) } + attr_reader :computed + # Time span for the quote line starting from the `starts_at` date. + sig { returns(T.nilable(Duration)) } + attr_reader :duration + # The timestamp the given line ends at. + sig { returns(T.nilable(LineEndsAt)) } + attr_reader :line_ends_at + # A precise Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The type of method to specify the `bill_until` time. + sig { returns(String) } + attr_reader :type + end + # The start of the period to bill from when the Quote is accepted. + sig { returns(T.nilable(BillFrom)) } + attr_reader :bill_from + # The end of the period to bill until when the Quote is accepted. + sig { returns(T.nilable(BillUntil)) } + attr_reader :bill_until + end + # Attribute for field applies_to + sig { returns(AppliesTo) } + attr_reader :applies_to + # Describes the period to bill for upon accepting the quote. + sig { returns(T.nilable(BillOnAcceptance)) } + attr_reader :bill_on_acceptance + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + sig { returns(String) } + attr_reader :billing_behavior + # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + sig { returns(T.nilable(String)) } + attr_reader :customer + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # Behavior of the subscription schedule and underlying subscription when it ends. + sig { returns(T.nilable(String)) } + attr_reader :end_behavior + # Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) when the quote is accepted. + sig { returns(T.nilable(String)) } + attr_reader :proration_behavior + end + class SubscriptionSchedule < Stripe::StripeObject + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + sig { returns(T.nilable(String)) } + attr_reader :new_reference + # The ID of the schedule the line applies to. + sig { returns(T.nilable(String)) } + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + sig { returns(String) } + attr_reader :type + end + # Attribute for field applies_to + sig { returns(AppliesTo) } + attr_reader :applies_to + # The subscription schedule that was created or updated from this quote. + sig { returns(String) } + attr_reader :subscription_schedule + end + class TotalDetails < Stripe::StripeObject + class Breakdown < Stripe::StripeObject + class Discount < Stripe::StripeObject + # The amount discounted. + sig { returns(Integer) } + attr_reader :amount + # A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/api#promotion_codes). + # It contains information about when the discount began, when it will end, and what it is applied to. + # + # Related guide: [Applying discounts to subscriptions](https://stripe.com/docs/billing/subscriptions/discounts) + sig { returns(Stripe::Discount) } + attr_reader :discount + end + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # The aggregated discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The aggregated tax amounts by rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + # This is the sum of all the discounts. + sig { returns(Integer) } + attr_reader :amount_discount + # This is the sum of all the shipping amounts. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_shipping + # This is the sum of all the tax amounts. + sig { returns(Integer) } + attr_reader :amount_tax + # Attribute for field breakdown + sig { returns(Breakdown) } + attr_reader :breakdown + end + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount will be transferred to the destination. + sig { returns(T.nilable(Float)) } + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # Allow quote lines to have `starts_at` in the past if collection is paused between `starts_at` and now. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :allow_backdated_lines + + # Total before any discounts or taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + + # Total after discounts and taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + + # ID of the Connect Application that created the quote. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. + sig { returns(String) } + attr_reader :collection_method + + # Attribute for field computed + sig { returns(Computed) } + attr_reader :computed + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(T.nilable(String)) } + attr_reader :currency + + # The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # The tax rates applied to this quote. + sig { returns(T::Array[T.any(String, Stripe::TaxRate)]) } + attr_reader :default_tax_rates + + # A description that will be displayed on the quote PDF. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The discounts applied to this quote. + sig { returns(T::Array[T.any(String, Stripe::Discount)]) } + attr_reader :discounts + + # The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :expires_at + + # A footer that will be displayed on the quote PDF. + sig { returns(T.nilable(String)) } + attr_reader :footer + + # Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. + sig { returns(T.nilable(FromQuote)) } + attr_reader :from_quote + + # A header that will be displayed on the quote PDF. + sig { returns(T.nilable(String)) } + attr_reader :header + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The invoice that was created from this quote. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :invoice + + # Attribute for field invoice_settings + sig { returns(InvoiceSettings) } + attr_reader :invoice_settings + + # A list of items the customer is being quoted for. + sig { returns(Stripe::ListObject) } + attr_reader :line_items + + # A list of [quote lines](https://docs.stripe.com/api/quote_lines) on the quote. These lines describe changes, in the order provided, that will be used to create new subscription schedules or update existing subscription schedules when the quote is accepted. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). + sig { returns(T.nilable(String)) } + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # The status of the quote. + sig { returns(String) } + attr_reader :status + + # Details on when and why a quote has been marked as stale or canceled. + sig { returns(T.nilable(StatusDetails)) } + attr_reader :status_details + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # The subscription that was created or updated from this quote. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # Attribute for field subscription_data + sig { returns(SubscriptionData) } + attr_reader :subscription_data + + # List representing overrides for `subscription_data` configurations for specific subscription schedules. + sig { returns(T.nilable(T::Array[SubscriptionDataOverride])) } + attr_reader :subscription_data_overrides + + # The subscription schedule that was created or updated from this quote. + sig { returns(T.nilable(T.any(String, Stripe::SubscriptionSchedule))) } + attr_reader :subscription_schedule + + # The subscription schedules that were created or updated from this quote. + sig { returns(T.nilable(T::Array[SubscriptionSchedule])) } + attr_reader :subscription_schedules + + # ID of the test clock this quote belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # Attribute for field total_details + sig { returns(TotalDetails) } + attr_reader :total_details + + # The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/quote_line.rbi b/rbi/stripe/resources/quote_line.rbi new file mode 100644 index 000000000..cde0f468c --- /dev/null +++ b/rbi/stripe/resources/quote_line.rbi @@ -0,0 +1,361 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A quote line defines a set of changes, in the order provided, that will be applied upon quote acceptance. + class QuoteLine < APIResource + class Action < Stripe::StripeObject + class AddDiscount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # The index, starting at 0, at which to position the new discount. When not supplied, Stripe defaults to appending the discount to the end of the `discounts` array. + sig { returns(T.nilable(Integer)) } + attr_reader :index + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class AddItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :converts_to + # Determines the type of trial for this item. + sig { returns(String) } + attr_reader :type + end + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # ID of the price to which the customer should be subscribed. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + sig { returns(Integer) } + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + sig { returns(T.nilable(Trial)) } + attr_reader :trial + end + class RemoveDiscount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class RemoveItem < Stripe::StripeObject + # ID of a price to remove. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + end + class SetDiscount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class SetItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :converts_to + # Determines the type of trial for this item. + sig { returns(String) } + attr_reader :type + end + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # ID of the price to which the customer should be subscribed. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + sig { returns(Integer) } + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + sig { returns(T.nilable(Trial)) } + attr_reader :trial + end + # Details for the `add_discount` type. + sig { returns(T.nilable(AddDiscount)) } + attr_reader :add_discount + # Details for the `add_item` type. + sig { returns(T.nilable(AddItem)) } + attr_reader :add_item + # Details for the `add_metadata` type: specify a hash of key-value pairs. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :add_metadata + # Details for the `remove_discount` type. + sig { returns(T.nilable(RemoveDiscount)) } + attr_reader :remove_discount + # Details for the `remove_item` type. + sig { returns(T.nilable(RemoveItem)) } + attr_reader :remove_item + # Details for the `remove_metadata` type: specify an array of metadata keys. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :remove_metadata + # Details for the `set_discounts` type. + sig { returns(T.nilable(T::Array[SetDiscount])) } + attr_reader :set_discounts + # Details for the `set_items` type. + sig { returns(T.nilable(T::Array[SetItem])) } + attr_reader :set_items + # Details for the `set_metadata` type: specify an array of key-value pairs. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :set_metadata + # The type of action the quote line performs. + sig { returns(String) } + attr_reader :type + end + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + sig { returns(T.nilable(String)) } + attr_reader :new_reference + # The ID of the schedule the line applies to. + sig { returns(T.nilable(String)) } + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + sig { returns(String) } + attr_reader :type + end + class CancelSubscriptionSchedule < Stripe::StripeObject + # Timestamp helper to cancel the underlying schedule on the accompanying line's start date. Must be set to `line_starts_at`. + sig { returns(String) } + attr_reader :cancel_at + # If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Boolean that defaults to `true`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :invoice_now + # If the subscription schedule is `active`, indicates if the cancellation should be prorated. Boolean that defaults to `true`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :prorate + end + class EndsAt < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The ID of a specific discount. + sig { returns(String) } + attr_reader :discount + end + class Duration < Stripe::StripeObject + # Specifies a type of interval unit. Either `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + # The number of intervals, as an whole number greater than 0. Stripe multiplies this by the interval type to get the overall duration. + sig { returns(Integer) } + attr_reader :interval_count + end + # The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `ends_at` field. For example, if `ends_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `ends_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `ends_at` is respecified. This field is guaranteed to be populated after quote acceptance. + sig { returns(T.nilable(Integer)) } + attr_reader :computed + # Use the `end` time of a given discount. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # Time span for the quote line starting from the `starts_at` date. + sig { returns(T.nilable(Duration)) } + attr_reader :duration + # A precise Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # Select a way to pass in `ends_at`. + sig { returns(String) } + attr_reader :type + end + class SetPauseCollection < Stripe::StripeObject + class Set < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + sig { returns(String) } + attr_reader :behavior + end + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + sig { returns(T.nilable(Set)) } + attr_reader :set + # Defines the type of the pause_collection behavior for the quote line. + sig { returns(String) } + attr_reader :type + end + class StartsAt < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The ID of a specific discount. + sig { returns(String) } + attr_reader :discount + end + class LineEndsAt < Stripe::StripeObject + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + end + # The timestamp value that will be used to determine when to make changes to the subscription schedule, as computed from the `starts_at` field. For example, if `starts_at[type]=upcoming_invoice`, the upcoming invoice date will be computed at the time the `starts_at` field was specified and saved. This field will not be recomputed upon future requests to update or finalize the quote unless `starts_at` is respecified. This field is guaranteed to be populated after quote acceptance. + sig { returns(T.nilable(Integer)) } + attr_reader :computed + # Use the `end` time of a given discount. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # The timestamp the given line ends at. + sig { returns(T.nilable(LineEndsAt)) } + attr_reader :line_ends_at + # A precise Unix timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # Select a way to pass in `starts_at`. + sig { returns(String) } + attr_reader :type + end + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + sig { returns(T.nilable(String)) } + attr_reader :prorate_up_front + end + # Defines how the subscription should behave when a trial ends. + sig { returns(T.nilable(EndBehavior)) } + attr_reader :end_behavior + end + # A list of items the customer is being quoted for. + sig { returns(T::Array[Action]) } + attr_reader :actions + + # Details to identify the subscription schedule the quote line applies to. + sig { returns(T.nilable(AppliesTo)) } + attr_reader :applies_to + + # For point-in-time quote lines (having no `ends_at` timestamp), this attribute lets you set or remove whether the subscription's billing cycle anchor is reset at the Quote Line `starts_at` timestamp.For time-span based quote lines (having both `starts_at` and `ends_at`), the only valid value is `automatic`, which removes any previously configured billing cycle anchor resets during the window of time spanning the quote line. + sig { returns(T.nilable(String)) } + attr_reader :billing_cycle_anchor + + # A point-in-time operation that cancels an existing subscription schedule at the line's starts_at timestamp. Currently only compatible with `quote_acceptance_date` for `starts_at`. When using cancel_subscription_schedule, the subscription schedule on the quote remains unalterable, except for modifications to the metadata, collection_method or invoice_settings. + sig { returns(T.nilable(CancelSubscriptionSchedule)) } + attr_reader :cancel_subscription_schedule + + # Details to identify the end of the time range modified by the proposed change. If not supplied, the quote line is considered a point-in-time operation that only affects the exact timestamp at `starts_at`, and a restricted set of attributes is supported on the quote line. + sig { returns(T.nilable(EndsAt)) } + attr_reader :ends_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Changes to how Stripe handles prorations during the quote line's time span. Affects if and how prorations are created when a future phase starts. + sig { returns(T.nilable(String)) } + attr_reader :proration_behavior + + # Details to modify the pause_collection behavior of the subscription schedule. + sig { returns(T.nilable(SetPauseCollection)) } + attr_reader :set_pause_collection + + # Timestamp helper to end the underlying schedule early, based on the acompanying line's start or end date. + sig { returns(T.nilable(String)) } + attr_reader :set_schedule_end + + # Details to identify the earliest timestamp where the proposed change should take effect. + sig { returns(T.nilable(StartsAt)) } + attr_reader :starts_at + + # Settings related to subscription trials. + sig { returns(T.nilable(TrialSettings)) } + attr_reader :trial_settings + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/quote_preview_invoice.rbi b/rbi/stripe/resources/quote_preview_invoice.rbi new file mode 100644 index 000000000..ce57043cd --- /dev/null +++ b/rbi/stripe/resources/quote_preview_invoice.rbi @@ -0,0 +1,928 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Invoices are statements of amounts owed by a customer, and are either + # generated one-off, or generated periodically from a subscription. + # + # They contain [invoice items](https://stripe.com/docs/api#invoiceitems), and proration adjustments + # that may be caused by subscription upgrades/downgrades (if necessary). + # + # If your invoice is configured to be billed through automatic charges, + # Stripe automatically finalizes your invoice and attempts payment. Note + # that finalizing the invoice, + # [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does + # not happen immediately as the invoice is created. Stripe waits + # until one hour after the last webhook was successfully sent (or the last + # webhook timed out after failing). If you (and the platforms you may have + # connected to) have no webhooks configured, Stripe waits one hour after + # creation to finalize the invoice. + # + # If your invoice is configured to be billed by sending an email, then based on your + # [email settings](https://dashboard.stripe.com/account/billing/automatic), + # Stripe will email the invoice to your customer and await payment. These + # emails can contain a link to a hosted page to pay the invoice. + # + # Stripe applies any customer credit on the account before determining the + # amount due for the invoice (i.e., the amount that will be actually + # charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge + # per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the + # invoice is automatically marked paid, and we add the amount due to the + # customer's credit balance which is applied to the next invoice. + # + # More details on the customer's credit balance are + # [here](https://stripe.com/docs/billing/customer/balance). + # + # Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending) + class QuotePreviewInvoice < APIResource + class AmountsDue < Stripe::StripeObject + # Incremental amount due for this payment in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + # The amount in cents (or local equivalent) that was paid for this payment. + sig { returns(Integer) } + attr_reader :amount_paid + # The difference between the payment’s amount and amount_paid, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount_remaining + # Number of days from when invoice is finalized until the payment is due. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + # Date on which a payment plan’s payment is due. + sig { returns(T.nilable(Integer)) } + attr_reader :due_date + # Timestamp when the payment was paid. + sig { returns(T.nilable(Integer)) } + attr_reader :paid_at + # The status of the payment, one of `open`, `paid`, or `past_due` + sig { returns(String) } + attr_reader :status + end + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + sig { returns(T.nilable(String)) } + attr_reader :new_reference + # The ID of the schedule the line applies to. + sig { returns(T.nilable(String)) } + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + sig { returns(String) } + attr_reader :type + end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + # The status of the most recent automated tax calculation for this invoice. + sig { returns(T.nilable(String)) } + attr_reader :status + end + class CustomField < Stripe::StripeObject + # The name of the custom field. + sig { returns(String) } + attr_reader :name + # The value of the custom field. + sig { returns(String) } + attr_reader :value + end + class CustomerAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class CustomerShipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class CustomerTaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(T.nilable(String)) } + attr_reader :value + end + class FromInvoice < Stripe::StripeObject + # The relation between this invoice and the cloned invoice + sig { returns(String) } + attr_reader :action + # The invoice that was cloned. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + end + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + class LastFinalizationError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + sig { returns(String) } + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + sig { returns(String) } + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + sig { returns(String) } + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + sig { returns(String) } + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + sig { returns(String) } + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + sig { returns(String) } + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + sig { returns(Stripe::PaymentIntent) } + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + sig { returns(Stripe::PaymentMethod) } + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + sig { returns(String) } + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + sig { returns(String) } + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + sig { returns(Stripe::SetupIntent) } + attr_reader :setup_intent + # Attribute for field source + sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) } + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + sig { returns(String) } + attr_reader :type + end + class PaymentSettings < Stripe::StripeObject + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + sig { returns(String) } + attr_reader :preferred_language + end + class Card < Stripe::StripeObject + class Installments < Stripe::StripeObject + # Whether Installments are enabled for this Invoice. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + end + # Attribute for field installments + sig { returns(Installments) } + attr_reader :installments + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + sig { returns(T.nilable(String)) } + attr_reader :request_three_d_secure + end + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + sig { returns(String) } + attr_reader :country + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :funding_type + end + class IdBankTransfer < Stripe::StripeObject; end + class Konbini < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + sig { returns(T::Array[String]) } + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + sig { returns(String) } + attr_reader :institution + end + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + # The list of permissions to request. The `payment_method` permission must be included. + sig { returns(T::Array[String]) } + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + end + # Attribute for field financial_connections + sig { returns(FinancialConnections) } + attr_reader :financial_connections + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + # If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(AcssDebit)) } + attr_reader :acss_debit + # If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Bancontact)) } + attr_reader :bancontact + # If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Card)) } + attr_reader :card + # If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(CustomerBalance)) } + attr_reader :customer_balance + # If paying by `id_bank_transfer`, this sub-hash contains details about the Indonesia bank transfer payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(IdBankTransfer)) } + attr_reader :id_bank_transfer + # If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(Konbini)) } + attr_reader :konbini + # If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(SepaDebit)) } + attr_reader :sepa_debit + # If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice’s PaymentIntent. + sig { returns(T.nilable(UsBankAccount)) } + attr_reader :us_bank_account + end + # ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. + sig { returns(T.nilable(String)) } + attr_reader :default_mandate + # Payment-method-specific configuration to provide to the invoice’s PaymentIntent. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + # The list of payment method types (e.g. card) to provide to the invoice’s PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + sig { returns(T.nilable(T::Array[String])) } + attr_reader :payment_method_types + end + class Rendering < Stripe::StripeObject + class Pdf < Stripe::StripeObject + # Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. + sig { returns(T.nilable(String)) } + attr_reader :page_size + end + # How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. + sig { returns(T.nilable(String)) } + attr_reader :amount_tax_display + # Invoice pdf rendering options + sig { returns(T.nilable(Pdf)) } + attr_reader :pdf + # ID of the rendering template that the invoice is formatted by. + sig { returns(T.nilable(String)) } + attr_reader :template + # Version of the rendering template that the invoice is using. + sig { returns(T.nilable(Integer)) } + attr_reader :template_version + end + class ShippingCost < Stripe::StripeObject + class Tax < Stripe::StripeObject + # Amount of tax applied for this rate. + sig { returns(Integer) } + attr_reader :amount + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + sig { returns(Stripe::TaxRate) } + attr_reader :rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + # Total shipping cost before any taxes are applied. + sig { returns(Integer) } + attr_reader :amount_subtotal + # Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. + sig { returns(Integer) } + attr_reader :amount_tax + # Total shipping cost after taxes are applied. + sig { returns(Integer) } + attr_reader :amount_total + # The ID of the ShippingRate for this invoice. + sig { returns(T.nilable(T.any(String, Stripe::ShippingRate))) } + attr_reader :shipping_rate + # The taxes applied to the shipping rate. + sig { returns(T::Array[Tax]) } + attr_reader :taxes + end + class ShippingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + class StatusTransitions < Stripe::StripeObject + # The time that the invoice draft was finalized. + sig { returns(T.nilable(Integer)) } + attr_reader :finalized_at + # The time that the invoice was marked uncollectible. + sig { returns(T.nilable(Integer)) } + attr_reader :marked_uncollectible_at + # The time that the invoice was paid. + sig { returns(T.nilable(Integer)) } + attr_reader :paid_at + # The time that the invoice was voided. + sig { returns(T.nilable(Integer)) } + attr_reader :voided_at + end + class SubscriptionDetails < Stripe::StripeObject + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + sig { returns(String) } + attr_reader :behavior + # The time after which the subscription will resume collecting payments. + sig { returns(T.nilable(Integer)) } + attr_reader :resumes_at + end + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. + # *Note: This attribute is populated only for invoices created on or after June 29, 2023.* + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + sig { returns(T.nilable(PauseCollection)) } + attr_reader :pause_collection + end + class ThresholdReason < Stripe::StripeObject + class ItemReason < Stripe::StripeObject + # The IDs of the line items that triggered the threshold invoice. + sig { returns(T::Array[String]) } + attr_reader :line_item_ids + # The quantity threshold boundary that applied to the given line item. + sig { returns(Integer) } + attr_reader :usage_gte + end + # The total invoice amount threshold boundary if it triggered the threshold invoice. + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates which line items triggered a threshold invoice. + sig { returns(T::Array[ItemReason]) } + attr_reader :item_reasons + end + class TotalDiscountAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the discount. + sig { returns(Integer) } + attr_reader :amount + # The discount that was applied to get this discount amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + end + class TotalMarginAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the reduction in line item amount. + sig { returns(Integer) } + attr_reader :amount + # The margin that was applied to get this margin amount. + sig { returns(T.any(String, Stripe::Margin)) } + attr_reader :margin + end + class TotalPretaxCreditAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the pretax credit amount. + sig { returns(Integer) } + attr_reader :amount + # The credit balance transaction that was applied to get this pretax credit amount. + sig { returns(T.nilable(T.any(String, Stripe::Billing::CreditBalanceTransaction))) } + attr_reader :credit_balance_transaction + # The discount that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Discount)) } + attr_reader :discount + # The margin that was applied to get this pretax credit amount. + sig { returns(T.any(String, Stripe::Margin)) } + attr_reader :margin + # Type of the pretax credit amount referenced. + sig { returns(String) } + attr_reader :type + end + class TotalTaxAmount < Stripe::StripeObject + # The amount, in cents (or local equivalent), of the tax. + sig { returns(Integer) } + attr_reader :amount + # Whether this tax amount is inclusive or exclusive. + sig { returns(T::Boolean) } + attr_reader :inclusive + # The tax rate that was applied to get this tax amount. + sig { returns(T.any(String, Stripe::TaxRate)) } + attr_reader :tax_rate + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(T.nilable(String)) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in cents (or local equivalent). + sig { returns(T.nilable(Integer)) } + attr_reader :taxable_amount + end + class TransferData < Stripe::StripeObject + # The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # The country of the business associated with this invoice, most often the business creating the invoice. + sig { returns(T.nilable(String)) } + attr_reader :account_country + + # The public name of the business associated with this invoice, most often the business creating the invoice. + sig { returns(T.nilable(String)) } + attr_reader :account_name + + # The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + + # Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. + sig { returns(Integer) } + attr_reader :amount_due + + # Amount that was overpaid on the invoice. Overpayments are debited to the customer's credit balance. + sig { returns(Integer) } + attr_reader :amount_overpaid + + # The amount, in cents (or local equivalent), that was paid. + sig { returns(Integer) } + attr_reader :amount_paid + + # The difference between amount_due and amount_paid, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount_remaining + + # This is the sum of all the shipping amounts. + sig { returns(Integer) } + attr_reader :amount_shipping + + # List of expected payments and corresponding due dates. This value will be null for invoices where collection_method=charge_automatically. + sig { returns(T.nilable(T::Array[AmountsDue])) } + attr_reader :amounts_due + + # ID of the Connect Application that created the invoice. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + sig { returns(T.nilable(Integer)) } + attr_reader :application_fee_amount + + # Attribute for field applies_to + sig { returns(AppliesTo) } + attr_reader :applies_to + + # Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. + sig { returns(Integer) } + attr_reader :attempt_count + + # Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. + sig { returns(T::Boolean) } + attr_reader :attempted + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # The time when this invoice is currently scheduled to be automatically finalized. The field will be `null` if the invoice is not scheduled to finalize in the future. If the invoice is not in the draft state, this field will always be `null` - see `finalized_at` for the time when an already-finalized invoice was finalized. + sig { returns(T.nilable(Integer)) } + attr_reader :automatically_finalizes_at + + # Indicates the reason why the invoice was created. + # + # * `manual`: Unrelated to a subscription, for example, created via the invoice editor. + # * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. + # * `subscription_create`: A new subscription was created. + # * `subscription_cycle`: A subscription advanced into a new period. + # * `subscription_threshold`: A subscription reached a billing threshold. + # * `subscription_update`: A subscription was updated. + # * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. + sig { returns(T.nilable(String)) } + attr_reader :billing_reason + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + sig { returns(String) } + attr_reader :collection_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Custom fields displayed on the invoice. + sig { returns(T.nilable(T::Array[CustomField])) } + attr_reader :custom_fields + + # The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(CustomerAddress)) } + attr_reader :customer_address + + # The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_email + + # The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_name + + # The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_phone + + # The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(CustomerShipping)) } + attr_reader :customer_shipping + + # The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(String)) } + attr_reader :customer_tax_exempt + + # The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. + sig { returns(T.nilable(T::Array[CustomerTaxId])) } + attr_reader :customer_tax_ids + + # The margins applied to the invoice. Can be overridden by line item `margins`. Use `expand[]=default_margins` to expand each margin. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::Margin)])) } + attr_reader :default_margins + + # ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + + # ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + sig { + returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)))) + } + attr_reader :default_source + + # The tax rates applied to this invoice, if any. + sig { returns(T::Array[Stripe::TaxRate]) } + attr_reader :default_tax_rates + + # An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + sig { returns(T.nilable(Stripe::Discount)) } + attr_reader :discount + + # The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[T.any(String, Stripe::Discount)]) } + attr_reader :discounts + + # The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :due_date + + # The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. + sig { returns(T.nilable(Integer)) } + attr_reader :effective_at + + # Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + sig { returns(T.nilable(Integer)) } + attr_reader :ending_balance + + # Footer displayed on the invoice. + sig { returns(T.nilable(String)) } + attr_reader :footer + + # Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. + sig { returns(T.nilable(FromInvoice)) } + attr_reader :from_invoice + + # Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. + sig { returns(String) } + attr_reader :id + + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + + # The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + sig { returns(T.nilable(LastFinalizationError)) } + attr_reader :last_finalization_error + + # The ID of the most recent non-draft revision of this invoice + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :latest_revision + + # The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. + sig { returns(Stripe::ListObject) } + attr_reader :lines + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`. + sig { returns(T.nilable(Integer)) } + attr_reader :next_payment_attempt + + # A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + sig { returns(T.nilable(String)) } + attr_reader :number + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + sig { returns(T::Boolean) } + attr_reader :paid + + # Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. + sig { returns(T::Boolean) } + attr_reader :paid_out_of_band + + # The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + + # Attribute for field payment_settings + sig { returns(PaymentSettings) } + attr_reader :payment_settings + + # Payments for this invoice + sig { returns(Stripe::ListObject) } + attr_reader :payments + + # End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + sig { returns(Integer) } + attr_reader :period_end + + # Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. + sig { returns(Integer) } + attr_reader :period_start + + # Total amount of all post-payment credit notes issued for this invoice. + sig { returns(Integer) } + attr_reader :post_payment_credit_notes_amount + + # Total amount of all pre-payment credit notes issued for this invoice. + sig { returns(Integer) } + attr_reader :pre_payment_credit_notes_amount + + # The quote this invoice was generated from. + sig { returns(T.nilable(T.any(String, Stripe::Quote))) } + attr_reader :quote + + # This is the transaction number that appears on email receipts sent for this invoice. + sig { returns(T.nilable(String)) } + attr_reader :receipt_number + + # The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. + sig { returns(T.nilable(Rendering)) } + attr_reader :rendering + + # The details of the cost of shipping, including the ShippingRate applied on the invoice. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. + sig { returns(T.nilable(ShippingDetails)) } + attr_reader :shipping_details + + # Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. + sig { returns(Integer) } + attr_reader :starting_balance + + # Extra information about an invoice for the customer's credit card statement. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) + sig { returns(T.nilable(String)) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # Attribute for field subscription + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # Details about the subscription that created this invoice. + sig { returns(T.nilable(SubscriptionDetails)) } + attr_reader :subscription_details + + # Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + sig { returns(Integer) } + attr_reader :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 + sig { returns(Integer) } + attr_reader :subtotal + + # The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + sig { returns(T.nilable(Integer)) } + attr_reader :subtotal_excluding_tax + + # The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + sig { returns(T.nilable(Integer)) } + attr_reader :tax + + # ID of the test clock this invoice belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # Attribute for field threshold_reason + sig { returns(ThresholdReason) } + attr_reader :threshold_reason + + # Total after discounts and taxes. + sig { returns(Integer) } + attr_reader :total + + # The aggregate amounts calculated per discount across all line items. + sig { returns(T.nilable(T::Array[TotalDiscountAmount])) } + attr_reader :total_discount_amounts + + # The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. + sig { returns(T.nilable(Integer)) } + attr_reader :total_excluding_tax + + # The aggregate amounts calculated per margin across all line items. + sig { returns(T.nilable(T::Array[TotalMarginAmount])) } + attr_reader :total_margin_amounts + + # Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this invoice. This is a combined list of total_pretax_credit_amounts across all invoice line items. + sig { returns(T.nilable(T::Array[TotalPretaxCreditAmount])) } + attr_reader :total_pretax_credit_amounts + + # The aggregate amounts calculated per tax rate for all line items. + sig { returns(T::Array[TotalTaxAmount]) } + attr_reader :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. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + + # Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + sig { returns(T.nilable(Integer)) } + attr_reader :webhooks_delivered_at + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/quote_preview_subscription_schedule.rbi b/rbi/stripe/resources/quote_preview_subscription_schedule.rbi new file mode 100644 index 000000000..cc8aceac1 --- /dev/null +++ b/rbi/stripe/resources/quote_preview_subscription_schedule.rbi @@ -0,0 +1,489 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class QuotePreviewSubscriptionSchedule < APIResource + class AppliesTo < Stripe::StripeObject + # A custom string that identifies a new subscription schedule being created upon quote acceptance. All quote lines with the same `new_reference` field will be applied to the creation of a new subscription schedule. + sig { returns(T.nilable(String)) } + attr_reader :new_reference + # The ID of the schedule the line applies to. + sig { returns(T.nilable(String)) } + attr_reader :subscription_schedule + # Describes whether the quote line is affecting a new schedule or an existing schedule. + sig { returns(String) } + attr_reader :type + end + class CurrentPhase < Stripe::StripeObject + # The end of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :end_date + # The start of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :start_date + end + class DefaultSettings < Stripe::StripeObject + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + end + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :reset_billing_cycle_anchor + end + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + end + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Float)) } + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + sig { returns(String) } + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + sig { returns(T.nilable(String)) } + attr_reader :collection_method + # ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # Attribute for field invoice_settings + sig { returns(InvoiceSettings) } + attr_reader :invoice_settings + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + end + class LastPriceMigrationError < Stripe::StripeObject + class FailedTransition < Stripe::StripeObject + # The original price to be migrated. + sig { returns(String) } + attr_reader :source_price + # The intended resulting price of the migration. + sig { returns(String) } + attr_reader :target_price + end + # The time at which the price migration encountered an error. + sig { returns(Integer) } + attr_reader :errored_at + # The involved price pairs in each failed transition. + sig { returns(T::Array[FailedTransition]) } + attr_reader :failed_transitions + # The type of error encountered by the price migration. + sig { returns(String) } + attr_reader :type + end + class Phase < Stripe::StripeObject + class AddInvoiceItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + # The stackable discounts that will be applied to the item. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # ID of the price used to generate the invoice item. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + # The quantity of the invoice item. + sig { returns(T.nilable(Integer)) } + attr_reader :quantity + # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + end + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :reset_billing_cycle_anchor + end + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + sig { returns(T.nilable(Issuer)) } + attr_reader :issuer + end + class Item < Stripe::StripeObject + class BillingThresholds < Stripe::StripeObject + # Usage threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :usage_gte + end + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :converts_to + # Determines the type of trial for this item. + sig { returns(String) } + attr_reader :type + end + # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # ID of the plan to which the customer should be subscribed. + sig { returns(T.any(String, Stripe::Plan)) } + attr_reader :plan + # ID of the price to which the customer should be subscribed. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + sig { returns(Integer) } + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + sig { returns(T.nilable(Trial)) } + attr_reader :trial + end + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + sig { returns(String) } + attr_reader :behavior + end + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Float)) } + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + sig { returns(T.nilable(String)) } + attr_reader :prorate_up_front + end + # Defines how the subscription should behave when a trial ends. + sig { returns(T.nilable(EndBehavior)) } + attr_reader :end_behavior + end + # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + sig { returns(T::Array[AddInvoiceItem]) } + attr_reader :add_invoice_items + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + sig { returns(T.nilable(String)) } + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + sig { returns(T.nilable(String)) } + attr_reader :collection_method + # ID of the coupon to use during this phase of the subscription schedule. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # 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). + sig { returns(String) } + attr_reader :currency + # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + # The default tax rates to apply to the subscription during this phase of the subscription schedule. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :default_tax_rates + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The end of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :end_date + # The invoice settings applicable during this phase. + sig { returns(T.nilable(InvoiceSettings)) } + attr_reader :invoice_settings + # Subscription items to configure the subscription to during this phase of the subscription schedule. + sig { returns(T::Array[Item]) } + attr_reader :items + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + sig { returns(T.nilable(PauseCollection)) } + attr_reader :pause_collection + # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. + sig { returns(String) } + attr_reader :proration_behavior + # The start of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :start_date + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + # Specify behavior of the trial when crossing schedule phase boundaries + sig { returns(T.nilable(String)) } + attr_reader :trial_continuation + # When the trial ends within the phase. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_end + # Settings related to any trials on the subscription during this phase. + sig { returns(T.nilable(TrialSettings)) } + attr_reader :trial_settings + end + class Prebilling < Stripe::StripeObject + # ID of the prebilling invoice. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + # The end of the last period for which the invoice pre-bills. + sig { returns(Integer) } + attr_reader :period_end + # The start of the first period for which the invoice pre-bills. + sig { returns(Integer) } + attr_reader :period_start + # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + sig { returns(String) } + attr_reader :update_behavior + end + # ID of the Connect Application that created the schedule. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # Attribute for field applies_to + sig { returns(AppliesTo) } + attr_reader :applies_to + + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + sig { returns(String) } + attr_reader :billing_behavior + + # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + + # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :completed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + sig { returns(T.nilable(CurrentPhase)) } + attr_reader :current_phase + + # ID of the customer who owns the subscription schedule. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # Attribute for field default_settings + sig { returns(DefaultSettings) } + attr_reader :default_settings + + # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + sig { returns(String) } + attr_reader :end_behavior + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Details of the most recent price migration that failed for the subscription schedule. + sig { returns(T.nilable(LastPriceMigrationError)) } + attr_reader :last_price_migration_error + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Configuration for the subscription schedule's phases. + sig { returns(T::Array[Phase]) } + attr_reader :phases + + # Time period and invoice for a Subscription billed in advance. + sig { returns(T.nilable(Prebilling)) } + attr_reader :prebilling + + # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :released_at + + # ID of the subscription once managed by the subscription schedule (if it is released). + sig { returns(T.nilable(String)) } + attr_reader :released_subscription + + # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + sig { returns(String) } + attr_reader :status + + # ID of the subscription managed by the subscription schedule. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # ID of the test clock this subscription schedule belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/radar/early_fraud_warning.rbi b/rbi/stripe/resources/radar/early_fraud_warning.rbi new file mode 100644 index 000000000..afeffa4e6 --- /dev/null +++ b/rbi/stripe/resources/radar/early_fraud_warning.rbi @@ -0,0 +1,45 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Radar + # An early fraud warning indicates that the card issuer has notified us that a + # charge may be fraudulent. + # + # Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings) + class EarlyFraudWarning < APIResource + # An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. + sig { returns(T::Boolean) } + attr_reader :actionable + + # ID of the charge this early fraud warning is for, optionally expanded. + sig { returns(T.any(String, Stripe::Charge)) } + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The type of fraud labelled by the issuer. One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`. + sig { returns(String) } + attr_reader :fraud_type + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the Payment Intent this early fraud warning is for, optionally expanded. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/radar/value_list.rbi b/rbi/stripe/resources/radar/value_list.rbi new file mode 100644 index 000000000..e0bc8afd4 --- /dev/null +++ b/rbi/stripe/resources/radar/value_list.rbi @@ -0,0 +1,56 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Radar + # Value lists allow you to group values together which can then be referenced in rules. + # + # Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items) + class ValueList < APIResource + # The name of the value list for use in rules. + sig { returns(String) } + attr_reader :alias + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The name or email address of the user who created this value list. + sig { returns(String) } + attr_reader :created_by + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. + sig { returns(String) } + attr_reader :item_type + + # List of items contained within this value list. + sig { returns(Stripe::ListObject) } + attr_reader :list_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The name of the value list. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/radar/value_list_item.rbi b/rbi/stripe/resources/radar/value_list_item.rbi new file mode 100644 index 000000000..cc54eeaf9 --- /dev/null +++ b/rbi/stripe/resources/radar/value_list_item.rbi @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Radar + # Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. + # + # Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items) + class ValueListItem < APIResource + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The name or email address of the user who added this item to the value list. + sig { returns(String) } + attr_reader :created_by + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The value of the item. + sig { returns(String) } + attr_reader :value + + # The identifier of the value list this item belongs to. + sig { returns(String) } + attr_reader :value_list + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/refund.rbi b/rbi/stripe/resources/refund.rbi new file mode 100644 index 000000000..2b174d4b3 --- /dev/null +++ b/rbi/stripe/resources/refund.rbi @@ -0,0 +1,352 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Refund objects allow you to refund a previously created charge that isn't + # refunded yet. Funds are refunded to the credit or debit card that's + # initially charged. + # + # Related guide: [Refunds](https://stripe.com/docs/refunds) + class Refund < APIResource + class DestinationDetails < Stripe::StripeObject + class Affirm < Stripe::StripeObject; end + class AfterpayClearpay < Stripe::StripeObject; end + class Alipay < Stripe::StripeObject; end + class Alma < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + class AuBankTransfer < Stripe::StripeObject; end + class Blik < Stripe::StripeObject + # For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. + sig { returns(T.nilable(String)) } + attr_reader :network_decline_code + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class BrBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class Card < Stripe::StripeObject + # Value of the reference number assigned to the refund. + sig { returns(String) } + attr_reader :reference + # Status of the reference number on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(String) } + attr_reader :reference_status + # Type of the reference number assigned to the refund. + sig { returns(String) } + attr_reader :reference_type + # The type of refund. This can be `refund`, `reversal`, or `pending`. + sig { returns(String) } + attr_reader :type + end + class Cashapp < Stripe::StripeObject; end + class CustomerCashBalance < Stripe::StripeObject; end + class Eps < Stripe::StripeObject; end + class EuBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class GbBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class Giropay < Stripe::StripeObject; end + class Grabpay < Stripe::StripeObject; end + class IdBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class JpBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class Klarna < Stripe::StripeObject; end + class Multibanco < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class MxBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class P24 < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class Paynow < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject; end + class Pix < Stripe::StripeObject; end + class Revolut < Stripe::StripeObject; end + class Sofort < Stripe::StripeObject; end + class Swish < Stripe::StripeObject + # For refunds declined by the network, a decline code provided by the network which indicates the reason the refund failed. + sig { returns(T.nilable(String)) } + attr_reader :network_decline_code + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class ThBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class UsBankTransfer < Stripe::StripeObject + # The reference assigned to the refund. + sig { returns(T.nilable(String)) } + attr_reader :reference + # Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. + sig { returns(T.nilable(String)) } + attr_reader :reference_status + end + class WechatPay < Stripe::StripeObject; end + class Zip < Stripe::StripeObject; end + # Attribute for field affirm + sig { returns(Affirm) } + attr_reader :affirm + # Attribute for field afterpay_clearpay + sig { returns(AfterpayClearpay) } + attr_reader :afterpay_clearpay + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + # Attribute for field alma + sig { returns(Alma) } + attr_reader :alma + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_bank_transfer + sig { returns(AuBankTransfer) } + attr_reader :au_bank_transfer + # Attribute for field blik + sig { returns(Blik) } + attr_reader :blik + # Attribute for field br_bank_transfer + sig { returns(BrBankTransfer) } + attr_reader :br_bank_transfer + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # Attribute for field customer_cash_balance + sig { returns(CustomerCashBalance) } + attr_reader :customer_cash_balance + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # Attribute for field gb_bank_transfer + sig { returns(GbBankTransfer) } + attr_reader :gb_bank_transfer + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + # Attribute for field grabpay + sig { returns(Grabpay) } + attr_reader :grabpay + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + # Attribute for field jp_bank_transfer + sig { returns(JpBankTransfer) } + attr_reader :jp_bank_transfer + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + # Attribute for field mx_bank_transfer + sig { returns(MxBankTransfer) } + attr_reader :mx_bank_transfer + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + # Attribute for field paynow + sig { returns(Paynow) } + attr_reader :paynow + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field pix + sig { returns(Pix) } + attr_reader :pix + # Attribute for field revolut + sig { returns(Revolut) } + attr_reader :revolut + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # Attribute for field swish + sig { returns(Swish) } + attr_reader :swish + # Attribute for field th_bank_transfer + sig { returns(ThBankTransfer) } + attr_reader :th_bank_transfer + # The type of transaction-specific details of the payment method used in the refund (e.g., `card`). An additional hash is included on `destination_details` with a name matching this value. It contains information specific to the refund transaction. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_transfer + sig { returns(UsBankTransfer) } + attr_reader :us_bank_transfer + # Attribute for field wechat_pay + sig { returns(WechatPay) } + attr_reader :wechat_pay + # Attribute for field zip + sig { returns(Zip) } + attr_reader :zip + end + class NextAction < Stripe::StripeObject + class DisplayDetails < Stripe::StripeObject + class EmailSent < Stripe::StripeObject + # The timestamp when the email was sent. + sig { returns(Integer) } + attr_reader :email_sent_at + # The recipient's email address. + sig { returns(String) } + attr_reader :email_sent_to + end + # Attribute for field email_sent + sig { returns(EmailSent) } + attr_reader :email_sent + # The expiry timestamp. + sig { returns(Integer) } + attr_reader :expires_at + end + # Attribute for field display_details + sig { returns(DisplayDetails) } + attr_reader :display_details + # Type of the next action to perform. + sig { returns(String) } + attr_reader :type + end + # Amount, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # Balance transaction that describes the impact on your account balance. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # ID of the charge that's refunded. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :charge + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. You can use this for displaying to users (available on non-card refunds only). + sig { returns(String) } + attr_reader :description + + # Attribute for field destination_details + sig { returns(DestinationDetails) } + attr_reader :destination_details + + # After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + sig { returns(T.any(String, Stripe::BalanceTransaction)) } + attr_reader :failure_balance_transaction + + # Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. + sig { returns(String) } + attr_reader :failure_reason + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. + sig { returns(String) } + attr_reader :instructions_email + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Attribute for field next_action + sig { returns(NextAction) } + attr_reader :next_action + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the PaymentIntent that's refunded. + sig { returns(T.nilable(T.any(String, Stripe::PaymentIntent))) } + attr_reader :payment_intent + + # Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). + sig { returns(T.nilable(String)) } + attr_reader :reason + + # This is the transaction number that appears on email receipts sent for this refund. + sig { returns(T.nilable(String)) } + attr_reader :receipt_number + + # The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. + sig { returns(T.nilable(T.any(String, Stripe::Reversal))) } + attr_reader :source_transfer_reversal + + # Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). + sig { returns(T.nilable(String)) } + attr_reader :status + + # This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. + sig { returns(T.nilable(T.any(String, Stripe::Reversal))) } + attr_reader :transfer_reversal + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/reporting/report_run.rbi b/rbi/stripe/resources/reporting/report_run.rbi new file mode 100644 index 000000000..9c395519d --- /dev/null +++ b/rbi/stripe/resources/reporting/report_run.rbi @@ -0,0 +1,88 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Reporting + # The Report Run object represents an instance of a report type generated with + # specific run parameters. Once the object is created, Stripe begins processing the report. + # When the report has finished running, it will give you a reference to a file + # where you can retrieve your results. For an overview, see + # [API Access to Reports](https://stripe.com/docs/reporting/statements/api). + # + # Note that certain report types can only be run based on your live-mode data (not test-mode + # data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). + class ReportRun < APIResource + class Parameters < Stripe::StripeObject + # The set of output columns requested for inclusion in the report run. + sig { returns(T::Array[String]) } + attr_reader :columns + # Connected account ID by which to filter the report run. + sig { returns(String) } + attr_reader :connected_account + # Currency of objects to be included in the report run. + sig { returns(String) } + attr_reader :currency + # Ending timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. + sig { returns(Integer) } + attr_reader :interval_end + # Starting timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. + sig { returns(Integer) } + attr_reader :interval_start + # Payout ID by which to filter the report run. + sig { returns(String) } + attr_reader :payout + # Category of balance transactions to be included in the report run. + sig { returns(String) } + attr_reader :reporting_category + # Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. + sig { returns(String) } + attr_reader :timezone + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # If something should go wrong during the run, a message about the failure (populated when + # `status=failed`). + sig { returns(T.nilable(String)) } + attr_reader :error + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # `true` if the report is run on live mode data and `false` if it is run on test mode data. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field parameters + sig { returns(Parameters) } + attr_reader :parameters + + # The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. + sig { returns(String) } + attr_reader :report_type + + # The file object representing the result of the report run (populated when + # `status=succeeded`). + sig { returns(T.nilable(Stripe::File)) } + attr_reader :result + + # Status of this report run. This will be `pending` when the run is initially created. + # When the run finishes, this will be set to `succeeded` and the `result` field will be populated. + # Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. + sig { returns(String) } + attr_reader :status + + # Timestamp at which this run successfully finished (populated when + # `status=succeeded`). Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :succeeded_at + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/reporting/report_type.rbi b/rbi/stripe/resources/reporting/report_type.rbi new file mode 100644 index 000000000..adaa3dfdb --- /dev/null +++ b/rbi/stripe/resources/reporting/report_type.rbi @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Reporting + # The Report Type resource corresponds to a particular type of report, such as + # the "Activity summary" or "Itemized payouts" reports. These objects are + # identified by an ID belonging to a set of enumerated values. See + # [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api) + # for those Report Type IDs, along with required and optional parameters. + # + # Note that certain report types can only be run based on your live-mode data (not test-mode + # data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). + class ReportType < APIResource + # Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :data_available_end + + # Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :data_available_start + + # List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the `columns` parameter, this will be null.) + sig { returns(T.nilable(T::Array[String])) } + attr_reader :default_columns + + # The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Human-readable name of the Report Type + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # When this Report Type was latest updated. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :updated + + # Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + sig { returns(Integer) } + attr_reader :version + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/reserve_transaction.rbi b/rbi/stripe/resources/reserve_transaction.rbi new file mode 100644 index 000000000..d6676f703 --- /dev/null +++ b/rbi/stripe/resources/reserve_transaction.rbi @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class ReserveTransaction < APIResource + # Attribute for field amount + sig { returns(Integer) } + attr_reader :amount + + # 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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/reversal.rbi b/rbi/stripe/resources/reversal.rbi new file mode 100644 index 000000000..04a7e5537 --- /dev/null +++ b/rbi/stripe/resources/reversal.rbi @@ -0,0 +1,60 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a + # connected account, either entirely or partially, and can also specify whether + # to refund any related application fees. Transfer reversals add to the + # platform's balance and subtract from the destination account's balance. + # + # Reversing a transfer that was made for a [destination + # charge](https://stripe.com/docs/connect/destination-charges) is allowed only up to the amount of + # the charge. It is possible to reverse a + # [transfer_group](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) + # transfer only if the destination account has enough balance to cover the + # reversal. + # + # Related guide: [Reverse transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reverse-transfers) + class Reversal < APIResource + # Amount, in cents (or local equivalent). + sig { returns(Integer) } + attr_reader :amount + + # Balance transaction that describes the impact on your account balance. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Linked payment refund for the transfer reversal. + sig { returns(T.nilable(T.any(String, Stripe::Refund))) } + attr_reader :destination_payment_refund + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # ID of the refund responsible for the transfer reversal. + sig { returns(T.nilable(T.any(String, Stripe::Refund))) } + attr_reader :source_refund + + # ID of the transfer that was reversed. + sig { returns(T.any(String, Stripe::Transfer)) } + attr_reader :transfer + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/review.rbi b/rbi/stripe/resources/review.rbi new file mode 100644 index 000000000..da7ab09f2 --- /dev/null +++ b/rbi/stripe/resources/review.rbi @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Reviews can be used to supplement automated fraud detection with human expertise. + # + # Learn more about [Radar](https://stripe.com/radar) and reviewing payments + # [here](https://stripe.com/docs/radar/reviews). + class Review < APIResource + class IpAddressLocation < Stripe::StripeObject + # The city where the payment originated. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter ISO code representing the country where the payment originated. + sig { returns(T.nilable(String)) } + attr_reader :country + # The geographic latitude where the payment originated. + sig { returns(T.nilable(Float)) } + attr_reader :latitude + # The geographic longitude where the payment originated. + sig { returns(T.nilable(Float)) } + attr_reader :longitude + # The state/county/province/region where the payment originated. + sig { returns(T.nilable(String)) } + attr_reader :region + end + class Session < Stripe::StripeObject + # The browser used in this browser session (e.g., `Chrome`). + sig { returns(T.nilable(String)) } + attr_reader :browser + # Information about the device used for the browser session (e.g., `Samsung SM-G930T`). + sig { returns(T.nilable(String)) } + attr_reader :device + # The platform for the browser session (e.g., `Macintosh`). + sig { returns(T.nilable(String)) } + attr_reader :platform + # The version for the browser session (e.g., `61.0.3163.100`). + sig { returns(T.nilable(String)) } + attr_reader :version + end + # The ZIP or postal code of the card used, if applicable. + sig { returns(T.nilable(String)) } + attr_reader :billing_zip + + # The charge associated with this review. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :charge + + # The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + sig { returns(T.nilable(String)) } + attr_reader :closed_reason + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The IP address where the payment originated. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + + # Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + sig { returns(T.nilable(IpAddressLocation)) } + attr_reader :ip_address_location + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # If `true`, the review needs action. + sig { returns(T::Boolean) } + attr_reader :open + + # The reason the review was opened. One of `rule` or `manual`. + sig { returns(String) } + attr_reader :opened_reason + + # The PaymentIntent ID associated with this review, if one exists. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + + # The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. + sig { returns(String) } + attr_reader :reason + + # Information related to the browsing session of the user who initiated the payment. + sig { returns(T.nilable(Session)) } + attr_reader :session + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/setup_attempt.rbi b/rbi/stripe/resources/setup_attempt.rbi new file mode 100644 index 000000000..7ab5b6ea4 --- /dev/null +++ b/rbi/stripe/resources/setup_attempt.rbi @@ -0,0 +1,440 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A SetupAttempt describes one attempted confirmation of a SetupIntent, + # whether that confirmation is successful or unsuccessful. You can use + # SetupAttempts to inspect details of a specific attempt at setting up a + # payment method using a SetupIntent. + class SetupAttempt < APIResource + class PaymentMethodDetails < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject; end + class AmazonPay < Stripe::StripeObject; end + class AuBecsDebit < Stripe::StripeObject; end + class BacsDebit < Stripe::StripeObject; end + class Bancontact < Stripe::StripeObject + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Preferred language of the Bancontact authorization page that the customer is redirected to. + # Can be one of `en`, `de`, `fr`, or `nl` + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by Bancontact directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class Boleto < Stripe::StripeObject; end + class Card < Stripe::StripeObject + class Checks < Stripe::StripeObject + # If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + # If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :address_postal_code_check + # If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + end + class ThreeDSecure < Stripe::StripeObject + # For authenticated transactions: how the customer was authenticated by + # the issuing bank. + sig { returns(T.nilable(String)) } + attr_reader :authentication_flow + # The Electronic Commerce Indicator (ECI). A protocol-level field + # indicating what degree of authentication was performed. + sig { returns(T.nilable(String)) } + attr_reader :electronic_commerce_indicator + # Indicates the outcome of 3D Secure authentication. + sig { returns(T.nilable(String)) } + attr_reader :result + # Additional information about why 3D Secure succeeded or failed based + # on the `result`. + sig { returns(T.nilable(String)) } + attr_reader :result_reason + # The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID + # (dsTransId) for this payment. + sig { returns(T.nilable(String)) } + attr_reader :transaction_id + # The version of 3D Secure that was used. + sig { returns(T.nilable(String)) } + attr_reader :version + end + class Wallet < Stripe::StripeObject + class ApplePay < Stripe::StripeObject; end + class GooglePay < Stripe::StripeObject; end + # Attribute for field apple_pay + sig { returns(ApplePay) } + attr_reader :apple_pay + # Attribute for field google_pay + sig { returns(GooglePay) } + attr_reader :google_pay + # The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. + sig { returns(String) } + attr_reader :type + end + # Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :brand + # Check results by Card networks on Card address and CVC at the time of authorization + sig { returns(T.nilable(Checks)) } + attr_reader :checks + # Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + sig { returns(T.nilable(String)) } + attr_reader :country + # A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :description + # Two-digit number representing the card's expiration month. + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Four-digit number representing the card's expiration year. + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + # + # *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :funding + # Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :iin + # The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) + sig { returns(T.nilable(String)) } + attr_reader :issuer + # The last four digits of the card. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `link`, `mastercard`, `unionpay`, `visa`, or `unknown`. + sig { returns(T.nilable(String)) } + attr_reader :network + # Populated if this authorization used 3D Secure authentication. + sig { returns(T.nilable(ThreeDSecure)) } + attr_reader :three_d_secure + # If this Card is part of a card wallet, this contains the details of the card wallet. + sig { returns(T.nilable(Wallet)) } + attr_reader :wallet + end + class CardPresent < Stripe::StripeObject + class Offline < Stripe::StripeObject + # Time at which the payment was collected while offline + sig { returns(T.nilable(Integer)) } + attr_reader :stored_at + # The method used to process this payment method offline. Only deferred is allowed. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # The ID of the Card PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_card + # Details about payments collected offline. + sig { returns(T.nilable(Offline)) } + attr_reader :offline + end + class Cashapp < Stripe::StripeObject; end + class IdBankTransfer < Stripe::StripeObject + # Bank where the account is located. + sig { returns(T.nilable(String)) } + attr_reader :bank + # Local bank code of the bank. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Merchant name and billing details name, for the customer to check for the correct merchant when performing the bank transfer. + sig { returns(T.nilable(String)) } + attr_reader :display_name + end + class Ideal < Stripe::StripeObject + # The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. + sig { returns(T.nilable(String)) } + attr_reader :bank + # The Bank Identifier Code of the customer's bank. + sig { returns(T.nilable(String)) } + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Owner's verified full name. Values are verified or provided by iDEAL directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class KakaoPay < Stripe::StripeObject; end + class Klarna < Stripe::StripeObject; end + class KrCard < Stripe::StripeObject; end + class Link < Stripe::StripeObject; end + class Paypal < Stripe::StripeObject; end + class Payto < Stripe::StripeObject; end + class RevolutPay < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + class Sofort < Stripe::StripeObject + # Bank code of bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Bank Identifier Code of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bic + # The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :generated_sepa_debit + # The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :generated_sepa_debit_mandate + # Last four characters of the IBAN. + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Preferred language of the Sofort authorization page that the customer is redirected to. + # Can be one of `en`, `de`, `fr`, or `nl` + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Owner's verified full name. Values are verified or provided by Sofort directly + # (if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + class UsBankAccount < Stripe::StripeObject; end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + # Attribute for field boleto + sig { returns(Boleto) } + attr_reader :boleto + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # Attribute for field cashapp + sig { returns(Cashapp) } + attr_reader :cashapp + # Attribute for field id_bank_transfer + sig { returns(IdBankTransfer) } + attr_reader :id_bank_transfer + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + # Attribute for field kakao_pay + sig { returns(KakaoPay) } + attr_reader :kakao_pay + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + # Attribute for field kr_card + sig { returns(KrCard) } + attr_reader :kr_card + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field revolut_pay + sig { returns(RevolutPay) } + attr_reader :revolut_pay + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + # The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class SetupError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + sig { returns(String) } + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + sig { returns(String) } + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + sig { returns(String) } + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + sig { returns(String) } + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + sig { returns(String) } + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + sig { returns(String) } + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + sig { returns(Stripe::PaymentIntent) } + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + sig { returns(Stripe::PaymentMethod) } + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + sig { returns(String) } + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + sig { returns(String) } + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + sig { returns(Stripe::SetupIntent) } + attr_reader :setup_intent + # Attribute for field source + sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) } + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + sig { returns(String) } + attr_reader :type + end + # The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + # + # It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + sig { returns(T::Boolean) } + attr_reader :attach_to_self + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # Indicates the directions of money movement for which this payment method is intended to be used. + # + # Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :flow_directions + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # ID of the payment method used with this SetupAttempt. + sig { returns(T.any(String, Stripe::PaymentMethod)) } + attr_reader :payment_method + + # Attribute for field payment_method_details + sig { returns(PaymentMethodDetails) } + attr_reader :payment_method_details + + # The error encountered during this attempt to confirm the SetupIntent, if any. + sig { returns(T.nilable(SetupError)) } + attr_reader :setup_error + + # ID of the SetupIntent that this attempt belongs to. + sig { returns(T.any(String, Stripe::SetupIntent)) } + attr_reader :setup_intent + + # Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. + sig { returns(String) } + attr_reader :status + + # The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. + sig { returns(String) } + attr_reader :usage + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/setup_intent.rbi b/rbi/stripe/resources/setup_intent.rbi new file mode 100644 index 000000000..314181d3e --- /dev/null +++ b/rbi/stripe/resources/setup_intent.rbi @@ -0,0 +1,502 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + class SetupIntent < APIResource + class AutomaticPaymentMethods < Stripe::StripeObject + # Controls whether this SetupIntent will accept redirect-based payment methods. + # + # Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. + sig { returns(String) } + attr_reader :allow_redirects + # Automatically calculates compatible payment methods + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + end + class LastSetupError < Stripe::StripeObject + # For card errors, the ID of the failed charge. + sig { returns(String) } + attr_reader :charge + # For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :code + # For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. + sig { returns(String) } + attr_reader :decline_code + # A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. + sig { returns(String) } + attr_reader :doc_url + # A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. + sig { returns(String) } + attr_reader :message + # For card errors resulting from a card issuer decline, a 2 digit code which indicates the advice given to merchant by the card network on how to proceed with an error. + sig { returns(String) } + attr_reader :network_advice_code + # For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code which indicates the reason the authorization failed. + sig { returns(String) } + attr_reader :network_decline_code + # If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. + sig { returns(String) } + attr_reader :param + # A PaymentIntent guides you through the process of collecting a payment from your customer. + # We recommend that you create exactly one PaymentIntent for each order or + # customer session in your system. You can reference the PaymentIntent later to + # see the history of payment attempts for a particular session. + # + # A PaymentIntent transitions through + # [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) + # throughout its lifetime as it interfaces with Stripe.js to perform + # authentication flows and ultimately creates at most one successful charge. + # + # Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) + sig { returns(Stripe::PaymentIntent) } + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + sig { returns(Stripe::PaymentMethod) } + attr_reader :payment_method + # If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. + sig { returns(String) } + attr_reader :payment_method_type + # A URL to the request log entry in your dashboard. + sig { returns(String) } + attr_reader :request_log_url + # A SetupIntent guides you through the process of setting up and saving a customer's payment credentials for future payments. + # For example, you can use a SetupIntent to set up and save your customer's card without immediately collecting a payment. + # Later, you can use [PaymentIntents](https://stripe.com/docs/api#payment_intents) to drive the payment flow. + # + # Create a SetupIntent when you're ready to collect your customer's payment credentials. + # Don't maintain long-lived, unconfirmed SetupIntents because they might not be valid. + # The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides + # you through the setup process. + # + # Successful SetupIntents result in payment credentials that are optimized for future payments. + # For example, cardholders in [certain regions](https://stripe.com/guides/strong-customer-authentication) might need to be run through + # [Strong Customer Authentication](https://docs.stripe.com/strong-customer-authentication) during payment method collection + # to streamline later [off-session payments](https://docs.stripe.com/payments/setup-intents). + # If you use the SetupIntent with a [Customer](https://stripe.com/docs/api#setup_intent_object-customer), + # it automatically attaches the resulting payment method to that Customer after successful setup. + # We recommend using SetupIntents or [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage) on + # PaymentIntents to save payment methods to prevent saving invalid or unoptimized payment methods. + # + # By using SetupIntents, you can reduce friction for your customers, even as regulations change over time. + # + # Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) + sig { returns(Stripe::SetupIntent) } + attr_reader :setup_intent + # Attribute for field source + sig { returns(T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)) } + attr_reader :source + # The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` + sig { returns(String) } + attr_reader :type + end + class NextAction < Stripe::StripeObject + class CashappHandleRedirectOrDisplayQrCode < Stripe::StripeObject + class QrCode < Stripe::StripeObject + # The date (unix timestamp) when the QR code expires. + sig { returns(Integer) } + attr_reader :expires_at + # The image_url_png string used to render QR code + sig { returns(String) } + attr_reader :image_url_png + # The image_url_svg string used to render QR code + sig { returns(String) } + attr_reader :image_url_svg + end + # The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. + sig { returns(String) } + attr_reader :hosted_instructions_url + # The url for mobile redirect based auth + sig { returns(String) } + attr_reader :mobile_auth_url + # Attribute for field qr_code + sig { returns(QrCode) } + attr_reader :qr_code + end + class RedirectToUrl < Stripe::StripeObject + # If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. + sig { returns(T.nilable(String)) } + attr_reader :return_url + # The URL you must redirect your customer to in order to authenticate. + sig { returns(T.nilable(String)) } + attr_reader :url + end + class VerifyWithMicrodeposits < Stripe::StripeObject + # The timestamp when the microdeposits are expected to land. + sig { returns(Integer) } + attr_reader :arrival_date + # The URL for the hosted verification page, which allows customers to verify their bank account. + sig { returns(String) } + attr_reader :hosted_verification_url + # The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. + sig { returns(T.nilable(String)) } + attr_reader :microdeposit_type + end + # Attribute for field cashapp_handle_redirect_or_display_qr_code + sig { returns(CashappHandleRedirectOrDisplayQrCode) } + attr_reader :cashapp_handle_redirect_or_display_qr_code + # Attribute for field redirect_to_url + sig { returns(RedirectToUrl) } + attr_reader :redirect_to_url + # Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. + sig { returns(String) } + attr_reader :type + # When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. + sig { returns(T::Hash[String, T.untyped]) } + attr_reader :use_stripe_sdk + # Attribute for field verify_with_microdeposits + sig { returns(VerifyWithMicrodeposits) } + attr_reader :verify_with_microdeposits + end + class PaymentMethodConfigurationDetails < Stripe::StripeObject + # ID of the payment method configuration used. + sig { returns(String) } + attr_reader :id + # ID of the parent payment method configuration used. + sig { returns(T.nilable(String)) } + attr_reader :parent + end + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # A URL for custom mandate text + sig { returns(String) } + attr_reader :custom_mandate_url + # List of Stripe products where this mandate can be selected automatically. + sig { returns(T::Array[String]) } + attr_reader :default_for + # Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. + sig { returns(T.nilable(String)) } + attr_reader :interval_description + # Payment schedule for the mandate. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Currency supported by the bank account + sig { returns(T.nilable(String)) } + attr_reader :currency + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class AmazonPay < Stripe::StripeObject; end + class BacsDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + end + class Card < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount to be charged for future payments. + sig { returns(Integer) } + attr_reader :amount + # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + sig { returns(String) } + attr_reader :amount_type + # 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). + sig { returns(String) } + attr_reader :currency + # A description of the mandate or subscription that is meant to be displayed to the customer. + sig { returns(T.nilable(String)) } + attr_reader :description + # End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. + sig { returns(T.nilable(Integer)) } + attr_reader :end_date + # Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. + sig { returns(String) } + attr_reader :interval + # The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. + sig { returns(T.nilable(Integer)) } + attr_reader :interval_count + # Unique identifier for the mandate or subscription. + sig { returns(String) } + attr_reader :reference + # Start date of the mandate or subscription. Start date should not be lesser than yesterday. + sig { returns(Integer) } + attr_reader :start_date + # Specifies the type of mandates supported. Possible values are `india`. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :supported_types + end + # Configuration options for setting up an eMandate for cards issued in India. + sig { returns(T.nilable(MandateOptions)) } + attr_reader :mandate_options + # Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. + sig { returns(T.nilable(String)) } + attr_reader :network + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. If not provided, this value defaults to `automatic`. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + sig { returns(T.nilable(String)) } + attr_reader :request_three_d_secure + end + class CardPresent < Stripe::StripeObject; end + class Link < Stripe::StripeObject + # [Deprecated] This is a legacy parameter that no longer has any function. + sig { returns(T.nilable(String)) } + attr_reader :persistent_token + end + class Paypal < Stripe::StripeObject + # The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. + sig { returns(T.nilable(String)) } + attr_reader :billing_agreement_id + # 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). + sig { returns(T.nilable(String)) } + attr_reader :currency + # The Stripe connected account IDs of the sellers on the platform for this transaction (optional). Only allowed when [separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) are used. + sig { returns(T::Array[String]) } + attr_reader :subsellers + end + class Payto < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount that will be collected. It is required when `amount_type` is `fixed`. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # The type of amount that will be collected. The amount charged must be exact or up to the value of `amount` param for `fixed` or `maximum` type respectively. + sig { returns(T.nilable(String)) } + attr_reader :amount_type + # Date, in YYYY-MM-DD format, after which payments will not be collected. Defaults to no end date. + sig { returns(T.nilable(String)) } + attr_reader :end_date + # The periodicity at which payments will be collected. + sig { returns(T.nilable(String)) } + attr_reader :payment_schedule + # The number of payments that will be made during a payment period. Defaults to 1 except for when `payment_schedule` is `adhoc`. In that case, it defaults to no limit. + sig { returns(T.nilable(Integer)) } + attr_reader :payments_per_period + # The purpose for which payments are made. Defaults to retail. + sig { returns(T.nilable(String)) } + attr_reader :purpose + # Date, in YYYY-MM-DD format, from which payments will be collected. Defaults to confirmation time. + sig { returns(T.nilable(String)) } + attr_reader :start_date + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + end + class SepaDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject; end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + end + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + sig { returns(T::Array[String]) } + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + sig { returns(String) } + attr_reader :institution + end + class ManualEntry < Stripe::StripeObject + # Settings for configuring manual entry of account details. + sig { returns(String) } + attr_reader :mode + end + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + # Attribute for field manual_entry + sig { returns(ManualEntry) } + attr_reader :manual_entry + # The list of permissions to request. The `payment_method` permission must be included. + sig { returns(T::Array[String]) } + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + # For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. + sig { returns(String) } + attr_reader :return_url + end + class MandateOptions < Stripe::StripeObject + # Mandate collection method + sig { returns(String) } + attr_reader :collection_method + end + # Attribute for field financial_connections + sig { returns(FinancialConnections) } + attr_reader :financial_connections + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + # Attribute for field amazon_pay + sig { returns(AmazonPay) } + attr_reader :amazon_pay + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + # Attribute for field card + sig { returns(Card) } + attr_reader :card + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + # Attribute for field link + sig { returns(Link) } + attr_reader :link + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + # Attribute for field payto + sig { returns(Payto) } + attr_reader :payto + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + # ID of the Connect application that created the SetupIntent. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. + # + # It can only be used for this Stripe Account’s own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. + sig { returns(T::Boolean) } + attr_reader :attach_to_self + + # Settings for dynamic payment methods compatible with this Setup Intent + sig { returns(T.nilable(AutomaticPaymentMethods)) } + attr_reader :automatic_payment_methods + + # Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. + sig { returns(T.nilable(String)) } + attr_reader :cancellation_reason + + # The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. + # + # The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. + sig { returns(T.nilable(String)) } + attr_reader :client_secret + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # ID of the Customer this SetupIntent belongs to, if one exists. + # + # If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Indicates the directions of money movement for which this payment method is intended to be used. + # + # Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :flow_directions + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The error encountered in the previous SetupIntent confirmation. + sig { returns(T.nilable(LastSetupError)) } + attr_reader :last_setup_error + + # The most recent SetupAttempt for this SetupIntent. + sig { returns(T.nilable(T.any(String, Stripe::SetupAttempt))) } + attr_reader :latest_attempt + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # ID of the multi use Mandate generated by the SetupIntent. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :mandate + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + sig { returns(T.nilable(NextAction)) } + attr_reader :next_action + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) for which the setup is intended. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # ID of the payment method used with this SetupIntent. If the payment method is `card_present` and isn't a digital wallet, then the [generated_card](https://docs.stripe.com/api/setup_attempts/object#setup_attempt_object-payment_method_details-card_present-generated_card) associated with the `latest_attempt` is attached to the Customer instead. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :payment_method + + # Information about the [payment method configuration](https://stripe.com/docs/api/payment_method_configurations) used for this Setup Intent. + sig { returns(T.nilable(PaymentMethodConfigurationDetails)) } + attr_reader :payment_method_configuration_details + + # Payment method-specific configuration for this SetupIntent. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + + # The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + sig { returns(T::Array[String]) } + attr_reader :payment_method_types + + # ID of the single_use Mandate generated by the SetupIntent. + sig { returns(T.nilable(T.any(String, Stripe::Mandate))) } + attr_reader :single_use_mandate + + # [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. + sig { returns(String) } + attr_reader :status + + # Indicates how the payment method is intended to be used in the future. + # + # Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`. + sig { returns(String) } + attr_reader :usage + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/shipping_rate.rbi b/rbi/stripe/resources/shipping_rate.rbi new file mode 100644 index 000000000..afdcd928c --- /dev/null +++ b/rbi/stripe/resources/shipping_rate.rbi @@ -0,0 +1,100 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Shipping rates describe the price of shipping presented to your customers and + # applied to a purchase. For more information, see [Charge for shipping](https://stripe.com/docs/payments/during-payment/charge-shipping). + class ShippingRate < APIResource + class DeliveryEstimate < Stripe::StripeObject + class Maximum < Stripe::StripeObject + # A unit of time. + sig { returns(String) } + attr_reader :unit + # Must be greater than 0. + sig { returns(Integer) } + attr_reader :value + end + class Minimum < Stripe::StripeObject + # A unit of time. + sig { returns(String) } + attr_reader :unit + # Must be greater than 0. + sig { returns(Integer) } + attr_reader :value + end + # The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. + sig { returns(T.nilable(Maximum)) } + attr_reader :maximum + # The lower bound of the estimated range. If empty, represents no lower bound. + sig { returns(T.nilable(Minimum)) } + attr_reader :minimum + end + class FixedAmount < Stripe::StripeObject + class CurrencyOptions < Stripe::StripeObject + # A non-negative integer in cents representing how much to charge. + sig { returns(Integer) } + attr_reader :amount + # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + sig { returns(String) } + attr_reader :tax_behavior + end + # A non-negative integer in cents representing how much to charge. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). + sig { returns(T::Hash[String, CurrencyOptions]) } + attr_reader :currency_options + end + # Whether the shipping rate can be used for new purchases. Defaults to `true`. + sig { returns(T::Boolean) } + attr_reader :active + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. + sig { returns(T.nilable(DeliveryEstimate)) } + attr_reader :delivery_estimate + + # The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + # Attribute for field fixed_amount + sig { returns(FixedAmount) } + attr_reader :fixed_amount + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. + sig { returns(T.nilable(String)) } + attr_reader :tax_behavior + + # A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. + sig { returns(T.nilable(T.any(String, Stripe::TaxCode))) } + attr_reader :tax_code + + # The type of calculation to use on the shipping rate. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/sigma/scheduled_query_run.rbi b/rbi/stripe/resources/sigma/scheduled_query_run.rbi new file mode 100644 index 000000000..8e12a1c57 --- /dev/null +++ b/rbi/stripe/resources/sigma/scheduled_query_run.rbi @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Sigma + # If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll + # receive a `sigma.scheduled_query_run.created` webhook each time the query + # runs. The webhook contains a `ScheduledQueryRun` object, which you can use to + # retrieve the query results. + class ScheduledQueryRun < APIResource + class Error < Stripe::StripeObject + # Information about the run failure. + sig { returns(String) } + attr_reader :message + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # When the query was run, Sigma contained a snapshot of your Stripe data at this time. + sig { returns(Integer) } + attr_reader :data_load_time + + # Attribute for field error + sig { returns(Error) } + attr_reader :error + + # The file object representing the results of the query. + sig { returns(T.nilable(Stripe::File)) } + attr_reader :file + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Time at which the result expires and is no longer available for download. + sig { returns(Integer) } + attr_reader :result_available_until + + # SQL for the query. + sig { returns(String) } + attr_reader :sql + + # The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. + sig { returns(String) } + attr_reader :status + + # Title of the query. + sig { returns(String) } + attr_reader :title + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/source.rbi b/rbi/stripe/resources/source.rbi new file mode 100644 index 000000000..8ae072ca0 --- /dev/null +++ b/rbi/stripe/resources/source.rbi @@ -0,0 +1,944 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # `Source` objects allow you to accept a variety of payment methods. They + # represent a customer's payment instrument, and can be used with the Stripe API + # just like a `Card` object: once chargeable, they can be charged, or can be + # attached to customers. + # + # Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). + # We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). + # This newer API provides access to our latest features and payment method types. + # + # Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). + class Source < APIResource + class AchCreditTransfer < Stripe::StripeObject + # Attribute for field account_number + sig { returns(T.nilable(String)) } + attr_reader :account_number + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field fingerprint + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Attribute for field refund_account_holder_name + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_name + # Attribute for field refund_account_holder_type + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_type + # Attribute for field refund_routing_number + sig { returns(T.nilable(String)) } + attr_reader :refund_routing_number + # Attribute for field routing_number + sig { returns(T.nilable(String)) } + attr_reader :routing_number + # Attribute for field swift_code + sig { returns(T.nilable(String)) } + attr_reader :swift_code + end + class AchDebit < Stripe::StripeObject + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field fingerprint + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Attribute for field routing_number + sig { returns(T.nilable(String)) } + attr_reader :routing_number + # Attribute for field type + sig { returns(T.nilable(String)) } + attr_reader :type + end + class AcssDebit < Stripe::StripeObject + # Attribute for field bank_address_city + sig { returns(T.nilable(String)) } + attr_reader :bank_address_city + # Attribute for field bank_address_line_1 + sig { returns(T.nilable(String)) } + attr_reader :bank_address_line_1 + # Attribute for field bank_address_line_2 + sig { returns(T.nilable(String)) } + attr_reader :bank_address_line_2 + # Attribute for field bank_address_postal_code + sig { returns(T.nilable(String)) } + attr_reader :bank_address_postal_code + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field category + sig { returns(T.nilable(String)) } + attr_reader :category + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field fingerprint + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Attribute for field routing_number + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + class Alipay < Stripe::StripeObject + # Attribute for field data_string + sig { returns(T.nilable(String)) } + attr_reader :data_string + # Attribute for field native_url + sig { returns(T.nilable(String)) } + attr_reader :native_url + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class AuBecsDebit < Stripe::StripeObject + # Attribute for field bsb_number + sig { returns(T.nilable(String)) } + attr_reader :bsb_number + # Attribute for field fingerprint + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + end + class Bancontact < Stripe::StripeObject + # Attribute for field bank_code + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field bic + sig { returns(T.nilable(String)) } + attr_reader :bic + # Attribute for field iban_last4 + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Attribute for field preferred_language + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class Card < Stripe::StripeObject + # Attribute for field address_line1_check + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + # Attribute for field address_zip_check + sig { returns(T.nilable(String)) } + attr_reader :address_zip_check + # Attribute for field brand + sig { returns(T.nilable(String)) } + attr_reader :brand + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field cvc_check + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + # Attribute for field description + sig { returns(String) } + attr_reader :description + # Attribute for field dynamic_last4 + sig { returns(T.nilable(String)) } + attr_reader :dynamic_last4 + # Attribute for field exp_month + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Attribute for field exp_year + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # Attribute for field fingerprint + sig { returns(String) } + attr_reader :fingerprint + # Attribute for field funding + sig { returns(T.nilable(String)) } + attr_reader :funding + # Attribute for field iin + sig { returns(String) } + attr_reader :iin + # Attribute for field issuer + sig { returns(String) } + attr_reader :issuer + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Attribute for field name + sig { returns(T.nilable(String)) } + attr_reader :name + # Attribute for field three_d_secure + sig { returns(String) } + attr_reader :three_d_secure + # Attribute for field tokenization_method + sig { returns(T.nilable(String)) } + attr_reader :tokenization_method + end + class CardPresent < Stripe::StripeObject + # Attribute for field application_cryptogram + sig { returns(String) } + attr_reader :application_cryptogram + # Attribute for field application_preferred_name + sig { returns(String) } + attr_reader :application_preferred_name + # Attribute for field authorization_code + sig { returns(T.nilable(String)) } + attr_reader :authorization_code + # Attribute for field authorization_response_code + sig { returns(String) } + attr_reader :authorization_response_code + # Attribute for field brand + sig { returns(T.nilable(String)) } + attr_reader :brand + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field cvm_type + sig { returns(String) } + attr_reader :cvm_type + # Attribute for field data_type + sig { returns(T.nilable(String)) } + attr_reader :data_type + # Attribute for field dedicated_file_name + sig { returns(String) } + attr_reader :dedicated_file_name + # Attribute for field description + sig { returns(String) } + attr_reader :description + # Attribute for field emv_auth_data + sig { returns(String) } + attr_reader :emv_auth_data + # Attribute for field evidence_customer_signature + sig { returns(T.nilable(String)) } + attr_reader :evidence_customer_signature + # Attribute for field evidence_transaction_certificate + sig { returns(T.nilable(String)) } + attr_reader :evidence_transaction_certificate + # Attribute for field exp_month + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Attribute for field exp_year + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # Attribute for field fingerprint + sig { returns(String) } + attr_reader :fingerprint + # Attribute for field funding + sig { returns(T.nilable(String)) } + attr_reader :funding + # Attribute for field iin + sig { returns(String) } + attr_reader :iin + # Attribute for field issuer + sig { returns(String) } + attr_reader :issuer + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Attribute for field pos_device_id + sig { returns(T.nilable(String)) } + attr_reader :pos_device_id + # Attribute for field pos_entry_mode + sig { returns(String) } + attr_reader :pos_entry_mode + # Attribute for field read_method + sig { returns(T.nilable(String)) } + attr_reader :read_method + # Attribute for field reader + sig { returns(T.nilable(String)) } + attr_reader :reader + # Attribute for field terminal_verification_results + sig { returns(String) } + attr_reader :terminal_verification_results + # Attribute for field transaction_status_information + sig { returns(String) } + attr_reader :transaction_status_information + end + class CodeVerification < Stripe::StripeObject + # The number of attempts remaining to authenticate the source object with a verification code. + sig { returns(Integer) } + attr_reader :attempts_remaining + # The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). + sig { returns(String) } + attr_reader :status + end + class Eps < Stripe::StripeObject + # Attribute for field reference + sig { returns(T.nilable(String)) } + attr_reader :reference + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class Giropay < Stripe::StripeObject + # Attribute for field bank_code + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field bic + sig { returns(T.nilable(String)) } + attr_reader :bic + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class Ideal < Stripe::StripeObject + # Attribute for field bank + sig { returns(T.nilable(String)) } + attr_reader :bank + # Attribute for field bic + sig { returns(T.nilable(String)) } + attr_reader :bic + # Attribute for field iban_last4 + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class Klarna < Stripe::StripeObject + # Attribute for field background_image_url + sig { returns(String) } + attr_reader :background_image_url + # Attribute for field client_token + sig { returns(T.nilable(String)) } + attr_reader :client_token + # Attribute for field first_name + sig { returns(String) } + attr_reader :first_name + # Attribute for field last_name + sig { returns(String) } + attr_reader :last_name + # Attribute for field locale + sig { returns(String) } + attr_reader :locale + # Attribute for field logo_url + sig { returns(String) } + attr_reader :logo_url + # Attribute for field page_title + sig { returns(String) } + attr_reader :page_title + # Attribute for field pay_later_asset_urls_descriptive + sig { returns(String) } + attr_reader :pay_later_asset_urls_descriptive + # Attribute for field pay_later_asset_urls_standard + sig { returns(String) } + attr_reader :pay_later_asset_urls_standard + # Attribute for field pay_later_name + sig { returns(String) } + attr_reader :pay_later_name + # Attribute for field pay_later_redirect_url + sig { returns(String) } + attr_reader :pay_later_redirect_url + # Attribute for field pay_now_asset_urls_descriptive + sig { returns(String) } + attr_reader :pay_now_asset_urls_descriptive + # Attribute for field pay_now_asset_urls_standard + sig { returns(String) } + attr_reader :pay_now_asset_urls_standard + # Attribute for field pay_now_name + sig { returns(String) } + attr_reader :pay_now_name + # Attribute for field pay_now_redirect_url + sig { returns(String) } + attr_reader :pay_now_redirect_url + # Attribute for field pay_over_time_asset_urls_descriptive + sig { returns(String) } + attr_reader :pay_over_time_asset_urls_descriptive + # Attribute for field pay_over_time_asset_urls_standard + sig { returns(String) } + attr_reader :pay_over_time_asset_urls_standard + # Attribute for field pay_over_time_name + sig { returns(String) } + attr_reader :pay_over_time_name + # Attribute for field pay_over_time_redirect_url + sig { returns(String) } + attr_reader :pay_over_time_redirect_url + # Attribute for field payment_method_categories + sig { returns(String) } + attr_reader :payment_method_categories + # Attribute for field purchase_country + sig { returns(String) } + attr_reader :purchase_country + # Attribute for field purchase_type + sig { returns(String) } + attr_reader :purchase_type + # Attribute for field redirect_url + sig { returns(String) } + attr_reader :redirect_url + # Attribute for field shipping_delay + sig { returns(Integer) } + attr_reader :shipping_delay + # Attribute for field shipping_first_name + sig { returns(String) } + attr_reader :shipping_first_name + # Attribute for field shipping_last_name + sig { returns(String) } + attr_reader :shipping_last_name + end + class Multibanco < Stripe::StripeObject + # Attribute for field entity + sig { returns(T.nilable(String)) } + attr_reader :entity + # Attribute for field reference + sig { returns(T.nilable(String)) } + attr_reader :reference + # Attribute for field refund_account_holder_address_city + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_city + # Attribute for field refund_account_holder_address_country + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_country + # Attribute for field refund_account_holder_address_line1 + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_line1 + # Attribute for field refund_account_holder_address_line2 + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_line2 + # Attribute for field refund_account_holder_address_postal_code + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_postal_code + # Attribute for field refund_account_holder_address_state + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_state + # Attribute for field refund_account_holder_name + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_name + # Attribute for field refund_iban + sig { returns(T.nilable(String)) } + attr_reader :refund_iban + end + class Owner < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class VerifiedAddress < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Owner's address. + sig { returns(T.nilable(Address)) } + attr_reader :address + # Owner's email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Owner's full name. + sig { returns(T.nilable(String)) } + attr_reader :name + # Owner's phone number (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # Verified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(VerifiedAddress)) } + attr_reader :verified_address + # Verified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_email + # Verified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + # Verified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. + sig { returns(T.nilable(String)) } + attr_reader :verified_phone + end + class P24 < Stripe::StripeObject + # Attribute for field reference + sig { returns(T.nilable(String)) } + attr_reader :reference + end + class Paypal < Stripe::StripeObject + # Attribute for field billing_agreement + sig { returns(T.nilable(String)) } + attr_reader :billing_agreement + # Attribute for field fingerprint + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Attribute for field payer_id + sig { returns(T.nilable(String)) } + attr_reader :payer_id + # Attribute for field reference_id + sig { returns(String) } + attr_reader :reference_id + # Attribute for field reference_transaction_amount + sig { returns(String) } + attr_reader :reference_transaction_amount + # Attribute for field reference_transaction_charged + sig { returns(T::Boolean) } + attr_reader :reference_transaction_charged + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + # Attribute for field transaction_id + sig { returns(String) } + attr_reader :transaction_id + # Attribute for field verified_email + sig { returns(T.nilable(String)) } + attr_reader :verified_email + end + class Receiver < Stripe::StripeObject + # The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. + sig { returns(T.nilable(String)) } + attr_reader :address + # The total amount that was moved to your balance. This is almost always equal to the amount charged. In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. The amount charged is expressed in the source's currency. + sig { returns(Integer) } + attr_reader :amount_charged + # The total amount received by the receiver source. `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. The amount received is expressed in the source's currency. + sig { returns(Integer) } + attr_reader :amount_received + # The total amount that was returned to the customer. The amount returned is expressed in the source's currency. + sig { returns(Integer) } + attr_reader :amount_returned + # Type of refund attribute method, one of `email`, `manual`, or `none`. + sig { returns(String) } + attr_reader :refund_attributes_method + # Type of refund attribute status, one of `missing`, `requested`, or `available`. + sig { returns(String) } + attr_reader :refund_attributes_status + end + class Redirect < Stripe::StripeObject + # The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. + sig { returns(T.nilable(String)) } + attr_reader :failure_reason + # The URL you provide to redirect the customer to after they authenticated their payment. + sig { returns(String) } + attr_reader :return_url + # The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). + sig { returns(String) } + attr_reader :status + # The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. + sig { returns(String) } + attr_reader :url + end + class SepaCreditTransfer < Stripe::StripeObject + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field bic + sig { returns(T.nilable(String)) } + attr_reader :bic + # Attribute for field iban + sig { returns(T.nilable(String)) } + attr_reader :iban + # Attribute for field refund_account_holder_address_city + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_city + # Attribute for field refund_account_holder_address_country + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_country + # Attribute for field refund_account_holder_address_line1 + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_line1 + # Attribute for field refund_account_holder_address_line2 + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_line2 + # Attribute for field refund_account_holder_address_postal_code + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_postal_code + # Attribute for field refund_account_holder_address_state + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_address_state + # Attribute for field refund_account_holder_name + sig { returns(T.nilable(String)) } + attr_reader :refund_account_holder_name + # Attribute for field refund_iban + sig { returns(T.nilable(String)) } + attr_reader :refund_iban + end + class SepaDebit < Stripe::StripeObject + # Attribute for field bank_code + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Attribute for field branch_code + sig { returns(T.nilable(String)) } + attr_reader :branch_code + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field fingerprint + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Attribute for field mandate_reference + sig { returns(T.nilable(String)) } + attr_reader :mandate_reference + # Attribute for field mandate_url + sig { returns(T.nilable(String)) } + attr_reader :mandate_url + end + class Sofort < Stripe::StripeObject + # Attribute for field bank_code + sig { returns(T.nilable(String)) } + attr_reader :bank_code + # Attribute for field bank_name + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Attribute for field bic + sig { returns(T.nilable(String)) } + attr_reader :bic + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field iban_last4 + sig { returns(T.nilable(String)) } + attr_reader :iban_last4 + # Attribute for field preferred_language + sig { returns(T.nilable(String)) } + attr_reader :preferred_language + # Attribute for field statement_descriptor + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + end + class SourceOrder < Stripe::StripeObject + class Item < Stripe::StripeObject + # The amount (price) for this order item. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # This currency of this order item. Required when `amount` is present. + sig { returns(T.nilable(String)) } + attr_reader :currency + # Human-readable description for this order item. + sig { returns(T.nilable(String)) } + attr_reader :description + # The ID of the associated object for this line item. Expandable if not null (e.g., expandable to a SKU). + sig { returns(T.nilable(String)) } + attr_reader :parent + # The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. + sig { returns(Integer) } + attr_reader :quantity + # The type of this order item. Must be `sku`, `tax`, or `shipping`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + class Shipping < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. + sig { returns(T.nilable(String)) } + attr_reader :carrier + # Recipient name. + sig { returns(String) } + attr_reader :name + # Recipient phone (including extension). + sig { returns(T.nilable(String)) } + attr_reader :phone + # The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. + sig { returns(T.nilable(String)) } + attr_reader :tracking_number + end + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + sig { returns(Integer) } + attr_reader :amount + # 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). + sig { returns(String) } + attr_reader :currency + # The email address of the customer placing the order. + sig { returns(String) } + attr_reader :email + # List of items constituting the order. + sig { returns(T.nilable(T::Array[Item])) } + attr_reader :items + # Attribute for field shipping + sig { returns(Shipping) } + attr_reader :shipping + end + class ThreeDSecure < Stripe::StripeObject + # Attribute for field address_line1_check + sig { returns(T.nilable(String)) } + attr_reader :address_line1_check + # Attribute for field address_zip_check + sig { returns(T.nilable(String)) } + attr_reader :address_zip_check + # Attribute for field authenticated + sig { returns(T.nilable(T::Boolean)) } + attr_reader :authenticated + # Attribute for field brand + sig { returns(T.nilable(String)) } + attr_reader :brand + # Attribute for field card + sig { returns(T.nilable(String)) } + attr_reader :card + # Attribute for field country + sig { returns(T.nilable(String)) } + attr_reader :country + # Attribute for field customer + sig { returns(T.nilable(String)) } + attr_reader :customer + # Attribute for field cvc_check + sig { returns(T.nilable(String)) } + attr_reader :cvc_check + # Attribute for field description + sig { returns(String) } + attr_reader :description + # Attribute for field dynamic_last4 + sig { returns(T.nilable(String)) } + attr_reader :dynamic_last4 + # Attribute for field exp_month + sig { returns(T.nilable(Integer)) } + attr_reader :exp_month + # Attribute for field exp_year + sig { returns(T.nilable(Integer)) } + attr_reader :exp_year + # Attribute for field fingerprint + sig { returns(String) } + attr_reader :fingerprint + # Attribute for field funding + sig { returns(T.nilable(String)) } + attr_reader :funding + # Attribute for field iin + sig { returns(String) } + attr_reader :iin + # Attribute for field issuer + sig { returns(String) } + attr_reader :issuer + # Attribute for field last4 + sig { returns(T.nilable(String)) } + attr_reader :last4 + # Attribute for field name + sig { returns(T.nilable(String)) } + attr_reader :name + # Attribute for field three_d_secure + sig { returns(String) } + attr_reader :three_d_secure + # Attribute for field tokenization_method + sig { returns(T.nilable(String)) } + attr_reader :tokenization_method + end + class Wechat < Stripe::StripeObject + # Attribute for field prepay_id + sig { returns(String) } + attr_reader :prepay_id + # Attribute for field qr_code_url + sig { returns(T.nilable(String)) } + attr_reader :qr_code_url + # Attribute for field statement_descriptor + sig { returns(String) } + attr_reader :statement_descriptor + end + # Attribute for field ach_credit_transfer + sig { returns(AchCreditTransfer) } + attr_reader :ach_credit_transfer + + # Attribute for field ach_debit + sig { returns(AchDebit) } + attr_reader :ach_debit + + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + + # Attribute for field alipay + sig { returns(Alipay) } + attr_reader :alipay + + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + # Attribute for field au_becs_debit + sig { returns(AuBecsDebit) } + attr_reader :au_becs_debit + + # Attribute for field bancontact + sig { returns(Bancontact) } + attr_reader :bancontact + + # Attribute for field card + sig { returns(Card) } + attr_reader :card + + # Attribute for field card_present + sig { returns(CardPresent) } + attr_reader :card_present + + # The client secret of the source. Used for client-side retrieval using a publishable key. + sig { returns(String) } + attr_reader :client_secret + + # Attribute for field code_verification + sig { returns(CodeVerification) } + attr_reader :code_verification + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources. + sig { returns(T.nilable(String)) } + attr_reader :currency + + # The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + sig { returns(String) } + attr_reader :customer + + # Attribute for field eps + sig { returns(Eps) } + attr_reader :eps + + # The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. + sig { returns(String) } + attr_reader :flow + + # Attribute for field giropay + sig { returns(Giropay) } + attr_reader :giropay + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field ideal + sig { returns(Ideal) } + attr_reader :ideal + + # Attribute for field klarna + sig { returns(Klarna) } + attr_reader :klarna + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Attribute for field multibanco + sig { returns(Multibanco) } + attr_reader :multibanco + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Information about the owner of the payment instrument that may be used or required by particular source types. + sig { returns(T.nilable(Owner)) } + attr_reader :owner + + # Attribute for field p24 + sig { returns(P24) } + attr_reader :p24 + + # Attribute for field paypal + sig { returns(Paypal) } + attr_reader :paypal + + # Attribute for field receiver + sig { returns(Receiver) } + attr_reader :receiver + + # Attribute for field redirect + sig { returns(Redirect) } + attr_reader :redirect + + # Attribute for field sepa_credit_transfer + sig { returns(SepaCreditTransfer) } + attr_reader :sepa_credit_transfer + + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + + # Attribute for field sofort + sig { returns(Sofort) } + attr_reader :sofort + + # Attribute for field source_order + sig { returns(SourceOrder) } + attr_reader :source_order + + # Extra information about a source. This will appear on your customer's statement every time you charge the source. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. + sig { returns(String) } + attr_reader :status + + # Attribute for field three_d_secure + sig { returns(ThreeDSecure) } + attr_reader :three_d_secure + + # The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. + sig { returns(String) } + attr_reader :type + + # Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + sig { returns(T.nilable(String)) } + attr_reader :usage + + # Attribute for field wechat + sig { returns(Wechat) } + attr_reader :wechat + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/source_mandate_notification.rbi b/rbi/stripe/resources/source_mandate_notification.rbi new file mode 100644 index 000000000..c998cb439 --- /dev/null +++ b/rbi/stripe/resources/source_mandate_notification.rbi @@ -0,0 +1,88 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Source mandate notifications should be created when a notification related to + # a source mandate must be sent to the payer. They will trigger a webhook or + # deliver an email to the customer. + class SourceMandateNotification < APIResource + class AcssDebit < Stripe::StripeObject + # The statement descriptor associate with the debit. + sig { returns(String) } + attr_reader :statement_descriptor + end + class BacsDebit < Stripe::StripeObject + # Last 4 digits of the account number associated with the debit. + sig { returns(String) } + attr_reader :last4 + end + class SepaDebit < Stripe::StripeObject + # SEPA creditor ID. + sig { returns(String) } + attr_reader :creditor_identifier + # Last 4 digits of the account number associated with the debit. + sig { returns(String) } + attr_reader :last4 + # Mandate reference associated with the debit. + sig { returns(String) } + attr_reader :mandate_reference + end + # Attribute for field acss_debit + sig { returns(AcssDebit) } + attr_reader :acss_debit + + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. The amount is expressed in the currency of the underlying source. Required if the notification type is `debit_initiated`. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + + # Attribute for field bacs_debit + sig { returns(BacsDebit) } + attr_reader :bacs_debit + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The reason of the mandate notification. Valid reasons are `mandate_confirmed` or `debit_initiated`. + sig { returns(String) } + attr_reader :reason + + # Attribute for field sepa_debit + sig { returns(SepaDebit) } + attr_reader :sepa_debit + + # `Source` objects allow you to accept a variety of payment methods. They + # represent a customer's payment instrument, and can be used with the Stripe API + # just like a `Card` object: once chargeable, they can be charged, or can be + # attached to customers. + # + # Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). + # We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). + # This newer API provides access to our latest features and payment method types. + # + # Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). + sig { returns(Stripe::Source) } + attr_reader :source + + # The status of the mandate notification. Valid statuses are `pending` or `submitted`. + sig { returns(String) } + attr_reader :status + + # The type of source this mandate notification is attached to. Should be the source type identifier code for the payment method, such as `three_d_secure`. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/source_transaction.rbi b/rbi/stripe/resources/source_transaction.rbi new file mode 100644 index 000000000..c16822192 --- /dev/null +++ b/rbi/stripe/resources/source_transaction.rbi @@ -0,0 +1,140 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Some payment methods have no required amount that a customer must send. + # Customers can be instructed to send any amount, and it can be made up of + # multiple transactions. As such, sources can have multiple associated + # transactions. + class SourceTransaction < StripeObject + class AchCreditTransfer < Stripe::StripeObject + # Customer data associated with the transfer. + sig { returns(String) } + attr_reader :customer_data + # Bank account fingerprint associated with the transfer. + sig { returns(String) } + attr_reader :fingerprint + # Last 4 digits of the account number associated with the transfer. + sig { returns(String) } + attr_reader :last4 + # Routing number associated with the transfer. + sig { returns(String) } + attr_reader :routing_number + end + class ChfCreditTransfer < Stripe::StripeObject + # Reference associated with the transfer. + sig { returns(String) } + attr_reader :reference + # Sender's country address. + sig { returns(String) } + attr_reader :sender_address_country + # Sender's line 1 address. + sig { returns(String) } + attr_reader :sender_address_line1 + # Sender's bank account IBAN. + sig { returns(String) } + attr_reader :sender_iban + # Sender's name. + sig { returns(String) } + attr_reader :sender_name + end + class GbpCreditTransfer < Stripe::StripeObject + # Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. + sig { returns(String) } + attr_reader :fingerprint + # The credit transfer rails the sender used to push this transfer. The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. Currently only Faster Payments is supported. + sig { returns(String) } + attr_reader :funding_method + # Last 4 digits of sender account number associated with the transfer. + sig { returns(String) } + attr_reader :last4 + # Sender entered arbitrary information about the transfer. + sig { returns(String) } + attr_reader :reference + # Sender account number associated with the transfer. + sig { returns(String) } + attr_reader :sender_account_number + # Sender name associated with the transfer. + sig { returns(String) } + attr_reader :sender_name + # Sender sort code associated with the transfer. + sig { returns(String) } + attr_reader :sender_sort_code + end + class PaperCheck < Stripe::StripeObject + # Time at which the deposited funds will be available for use. Measured in seconds since the Unix epoch. + sig { returns(String) } + attr_reader :available_at + # Comma-separated list of invoice IDs associated with the paper check. + sig { returns(String) } + attr_reader :invoices + end + class SepaCreditTransfer < Stripe::StripeObject + # Reference associated with the transfer. + sig { returns(String) } + attr_reader :reference + # Sender's bank account IBAN. + sig { returns(String) } + attr_reader :sender_iban + # Sender's name. + sig { returns(String) } + attr_reader :sender_name + end + # Attribute for field ach_credit_transfer + sig { returns(AchCreditTransfer) } + attr_reader :ach_credit_transfer + + # A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. + sig { returns(Integer) } + attr_reader :amount + + # Attribute for field chf_credit_transfer + sig { returns(ChfCreditTransfer) } + attr_reader :chf_credit_transfer + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # Attribute for field gbp_credit_transfer + sig { returns(GbpCreditTransfer) } + attr_reader :gbp_credit_transfer + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field paper_check + sig { returns(PaperCheck) } + attr_reader :paper_check + + # Attribute for field sepa_credit_transfer + sig { returns(SepaCreditTransfer) } + attr_reader :sepa_credit_transfer + + # The ID of the source this transaction is attached to. + sig { returns(String) } + attr_reader :source + + # The status of the transaction, one of `succeeded`, `pending`, or `failed`. + sig { returns(String) } + attr_reader :status + + # The type of source this transaction is attached to. + sig { returns(String) } + attr_reader :type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/subscription.rbi b/rbi/stripe/resources/subscription.rbi new file mode 100644 index 000000000..5e44d61ff --- /dev/null +++ b/rbi/stripe/resources/subscription.rbi @@ -0,0 +1,497 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Subscriptions allow you to charge a customer on a recurring basis. + # + # Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating) + class Subscription < APIResource + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on this subscription. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + end + class BillingCycleAnchorConfig < Stripe::StripeObject + # The day of the month of the billing_cycle_anchor. + sig { returns(Integer) } + attr_reader :day_of_month + # The hour of the day of the billing_cycle_anchor. + sig { returns(T.nilable(Integer)) } + attr_reader :hour + # The minute of the hour of the billing_cycle_anchor. + sig { returns(T.nilable(Integer)) } + attr_reader :minute + # The month to start full cycle billing periods. + sig { returns(T.nilable(Integer)) } + attr_reader :month + # The second of the minute of the billing_cycle_anchor. + sig { returns(T.nilable(Integer)) } + attr_reader :second + end + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :reset_billing_cycle_anchor + end + class CancellationDetails < Stripe::StripeObject + # Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. + sig { returns(T.nilable(String)) } + attr_reader :comment + # The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. + sig { returns(T.nilable(String)) } + attr_reader :feedback + # Why this subscription was canceled. + sig { returns(T.nilable(String)) } + attr_reader :reason + end + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + end + class LastPriceMigrationError < Stripe::StripeObject + class FailedTransition < Stripe::StripeObject + # The original price to be migrated. + sig { returns(String) } + attr_reader :source_price + # The intended resulting price of the migration. + sig { returns(String) } + attr_reader :target_price + end + # The time at which the price migration encountered an error. + sig { returns(Integer) } + attr_reader :errored_at + # The involved price pairs in each failed transition. + sig { returns(T::Array[FailedTransition]) } + attr_reader :failed_transitions + # The type of error encountered by the price migration. + sig { returns(String) } + attr_reader :type + end + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + sig { returns(String) } + attr_reader :behavior + # The time after which the subscription will resume collecting payments. + sig { returns(T.nilable(Integer)) } + attr_reader :resumes_at + end + class PaymentSettings < Stripe::StripeObject + class PaymentMethodOptions < Stripe::StripeObject + class AcssDebit < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Transaction type of the mandate. + sig { returns(T.nilable(String)) } + attr_reader :transaction_type + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + class Bancontact < Stripe::StripeObject + # Preferred language of the Bancontact authorization page that the customer is redirected to. + sig { returns(String) } + attr_reader :preferred_language + end + class Card < Stripe::StripeObject + class MandateOptions < Stripe::StripeObject + # Amount to be charged for future payments. + sig { returns(T.nilable(Integer)) } + attr_reader :amount + # One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. + sig { returns(T.nilable(String)) } + attr_reader :amount_type + # A description of the mandate or subscription that is meant to be displayed to the customer. + sig { returns(T.nilable(String)) } + attr_reader :description + end + # Attribute for field mandate_options + sig { returns(MandateOptions) } + attr_reader :mandate_options + # Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. + sig { returns(T.nilable(String)) } + attr_reader :network + # We strongly recommend that you rely on our SCA Engine to automatically prompt your customers for authentication based on risk level and [other requirements](https://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. + sig { returns(T.nilable(String)) } + attr_reader :request_three_d_secure + end + class CustomerBalance < Stripe::StripeObject + class BankTransfer < Stripe::StripeObject + class EuBankTransfer < Stripe::StripeObject + # The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. + sig { returns(String) } + attr_reader :country + end + # Attribute for field eu_bank_transfer + sig { returns(EuBankTransfer) } + attr_reader :eu_bank_transfer + # The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :type + end + # Attribute for field bank_transfer + sig { returns(BankTransfer) } + attr_reader :bank_transfer + # The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. + sig { returns(T.nilable(String)) } + attr_reader :funding_type + end + class IdBankTransfer < Stripe::StripeObject; end + class Konbini < Stripe::StripeObject; end + class SepaDebit < Stripe::StripeObject; end + class UsBankAccount < Stripe::StripeObject + class FinancialConnections < Stripe::StripeObject + class Filters < Stripe::StripeObject + # The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. + sig { returns(T::Array[String]) } + attr_reader :account_subcategories + # The institution to use to filter for possible accounts to link. + sig { returns(String) } + attr_reader :institution + end + # Attribute for field filters + sig { returns(Filters) } + attr_reader :filters + # The list of permissions to request. The `payment_method` permission must be included. + sig { returns(T::Array[String]) } + attr_reader :permissions + # Data features requested to be retrieved upon account creation. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :prefetch + end + # Attribute for field financial_connections + sig { returns(FinancialConnections) } + attr_reader :financial_connections + # Bank account verification method. + sig { returns(String) } + attr_reader :verification_method + end + # This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(AcssDebit)) } + attr_reader :acss_debit + # This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(Bancontact)) } + attr_reader :bancontact + # This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(Card)) } + attr_reader :card + # This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(CustomerBalance)) } + attr_reader :customer_balance + # This sub-hash contains details about the Indonesia bank transfer payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(IdBankTransfer)) } + attr_reader :id_bank_transfer + # This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(Konbini)) } + attr_reader :konbini + # This sub-hash contains details about the SEPA Direct Debit payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(SepaDebit)) } + attr_reader :sepa_debit + # This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. + sig { returns(T.nilable(UsBankAccount)) } + attr_reader :us_bank_account + end + # Payment-method-specific configuration to provide to invoices created by the subscription. + sig { returns(T.nilable(PaymentMethodOptions)) } + attr_reader :payment_method_options + # The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice’s default payment method, the subscription’s default payment method, the customer’s default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). + sig { returns(T.nilable(T::Array[String])) } + attr_reader :payment_method_types + # Configure whether Stripe updates `subscription.default_payment_method` when payment succeeds. Defaults to `off`. + sig { returns(T.nilable(String)) } + attr_reader :save_default_payment_method + end + class PendingInvoiceItemInterval < Stripe::StripeObject + # Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. + sig { returns(String) } + attr_reader :interval + # The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). + sig { returns(Integer) } + attr_reader :interval_count + end + class PendingUpdate < Stripe::StripeObject + # If the update is applied, determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format. + sig { returns(T.nilable(Integer)) } + attr_reader :billing_cycle_anchor + # The point after which the changes reflected by this update will be discarded and no longer applied. + sig { returns(Integer) } + attr_reader :expires_at + # The number of iterations of prebilling to apply. + sig { returns(T.nilable(Integer)) } + attr_reader :prebilling_iterations + # List of subscription items, each with an attached plan, that will be set if the update is applied. + sig { returns(T.nilable(T::Array[Stripe::SubscriptionItem])) } + attr_reader :subscription_items + # Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_end + # Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :trial_from_plan + end + class Prebilling < Stripe::StripeObject + # ID of the prebilling invoice. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + # The end of the last period for which the invoice pre-bills. + sig { returns(Integer) } + attr_reader :period_end + # The start of the first period for which the invoice pre-bills. + sig { returns(Integer) } + attr_reader :period_start + # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + sig { returns(String) } + attr_reader :update_behavior + end + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Float)) } + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Indicates how the subscription should change when the trial ends if the user did not provide a payment method. + sig { returns(String) } + attr_reader :missing_payment_method + end + # Defines how a subscription behaves when a free trial ends. + sig { returns(EndBehavior) } + attr_reader :end_behavior + end + # ID of the Connect Application that created the subscription. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + + # The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format. + sig { returns(Integer) } + attr_reader :billing_cycle_anchor + + # The fixed values used to calculate the `billing_cycle_anchor`. + sig { returns(T.nilable(BillingCycleAnchorConfig)) } + attr_reader :billing_cycle_anchor_config + + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + + # A date in the future at which the subscription will automatically get canceled + sig { returns(T.nilable(Integer)) } + attr_reader :cancel_at + + # Whether this subscription will (if `status=active`) or did (if `status=canceled`) cancel at the end of the current billing period. + sig { returns(T::Boolean) } + attr_reader :cancel_at_period_end + + # If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + + # Details about why this subscription was cancelled + sig { returns(T.nilable(CancellationDetails)) } + attr_reader :cancellation_details + + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + sig { returns(String) } + attr_reader :collection_method + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. + sig { returns(Integer) } + attr_reader :current_period_end + + # Start of the current period that the subscription has been invoiced for. + sig { returns(Integer) } + attr_reader :current_period_start + + # ID of the customer who owns the subscription. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + + # ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + + # ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). + sig { + returns(T.nilable(T.any(String, T.any(Stripe::Account, Stripe::BankAccount, Stripe::Card, Stripe::Source)))) + } + attr_reader :default_source + + # The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :default_tax_rates + + # The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. + sig { returns(T.nilable(Stripe::Discount)) } + attr_reader :discount + + # The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[T.any(String, Stripe::Discount)]) } + attr_reader :discounts + + # If the subscription has ended, the date the subscription ended. + sig { returns(T.nilable(Integer)) } + attr_reader :ended_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field invoice_settings + sig { returns(InvoiceSettings) } + attr_reader :invoice_settings + + # List of subscription items, each with an attached price. + sig { returns(Stripe::ListObject) } + attr_reader :items + + # Details of the most recent price migration that failed for the subscription. + sig { returns(T.nilable(LastPriceMigrationError)) } + attr_reader :last_price_migration_error + + # The most recent invoice this subscription has generated. + sig { returns(T.nilable(T.any(String, Stripe::Invoice))) } + attr_reader :latest_invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. + sig { returns(T.nilable(Integer)) } + attr_reader :next_pending_invoice_item_invoice + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + sig { returns(T.nilable(PauseCollection)) } + attr_reader :pause_collection + + # Payment settings passed on to invoices created by the subscription. + sig { returns(T.nilable(PaymentSettings)) } + attr_reader :payment_settings + + # Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. + sig { returns(T.nilable(PendingInvoiceItemInterval)) } + attr_reader :pending_invoice_item_interval + + # You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). + sig { returns(T.nilable(T.any(String, Stripe::SetupIntent))) } + attr_reader :pending_setup_intent + + # If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. + sig { returns(T.nilable(PendingUpdate)) } + attr_reader :pending_update + + # Time period and invoice for a Subscription billed in advance. + sig { returns(T.nilable(Prebilling)) } + attr_reader :prebilling + + # The schedule attached to the subscription + sig { returns(T.nilable(T.any(String, Stripe::SubscriptionSchedule))) } + attr_reader :schedule + + # Date when the subscription was first created. The date might differ from the `created` date due to backdating. + sig { returns(Integer) } + attr_reader :start_date + + # Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. + # + # For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. + # + # A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. + # + # A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/docs/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. + # + # If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). + # + # If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. + sig { returns(String) } + attr_reader :status + + # ID of the test clock this subscription belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + + # The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + + # If the subscription has a trial, the end of that trial. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_end + + # Settings related to subscription trials. + sig { returns(T.nilable(TrialSettings)) } + attr_reader :trial_settings + + # If the subscription has a trial, the beginning of that trial. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_start + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/subscription_item.rbi b/rbi/stripe/resources/subscription_item.rbi new file mode 100644 index 000000000..b03485b30 --- /dev/null +++ b/rbi/stripe/resources/subscription_item.rbi @@ -0,0 +1,86 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Subscription items allow you to create customer subscriptions with more than + # one plan, making it easy to represent complex billing relationships. + class SubscriptionItem < APIResource + class BillingThresholds < Stripe::StripeObject + # Usage threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :usage_gte + end + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :converts_to + # Determines the type of trial for this item. + sig { returns(String) } + attr_reader :type + end + # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[T.any(String, Stripe::Discount)]) } + attr_reader :discounts + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. + # + # Plans define the base price, currency, and billing cycle for recurring purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). + sig { returns(Stripe::Plan) } + attr_reader :plan + + # Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. + # [Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme. + # + # For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once. + # + # Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). + sig { returns(Stripe::Price) } + attr_reader :price + + # The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. + sig { returns(Integer) } + attr_reader :quantity + + # The `subscription` this `subscription_item` belongs to. + sig { returns(String) } + attr_reader :subscription + + # The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + + # Options that configure the trial on the subscription item. + sig { returns(T.nilable(Trial)) } + attr_reader :trial + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/subscription_schedule.rbi b/rbi/stripe/resources/subscription_schedule.rbi new file mode 100644 index 000000000..eda81647a --- /dev/null +++ b/rbi/stripe/resources/subscription_schedule.rbi @@ -0,0 +1,477 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. + # + # Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules) + class SubscriptionSchedule < APIResource + class CurrentPhase < Stripe::StripeObject + # The end of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :end_date + # The start of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :start_date + end + class DefaultSettings < Stripe::StripeObject + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + end + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :reset_billing_cycle_anchor + end + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # Attribute for field issuer + sig { returns(Issuer) } + attr_reader :issuer + end + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Float)) } + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + sig { returns(String) } + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + sig { returns(T.nilable(String)) } + attr_reader :collection_method + # ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # Attribute for field invoice_settings + sig { returns(InvoiceSettings) } + attr_reader :invoice_settings + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + end + class LastPriceMigrationError < Stripe::StripeObject + class FailedTransition < Stripe::StripeObject + # The original price to be migrated. + sig { returns(String) } + attr_reader :source_price + # The intended resulting price of the migration. + sig { returns(String) } + attr_reader :target_price + end + # The time at which the price migration encountered an error. + sig { returns(Integer) } + attr_reader :errored_at + # The involved price pairs in each failed transition. + sig { returns(T::Array[FailedTransition]) } + attr_reader :failed_transitions + # The type of error encountered by the price migration. + sig { returns(String) } + attr_reader :type + end + class Phase < Stripe::StripeObject + class AddInvoiceItem < Stripe::StripeObject + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + # The stackable discounts that will be applied to the item. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # ID of the price used to generate the invoice item. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + # The quantity of the invoice item. + sig { returns(T.nilable(Integer)) } + attr_reader :quantity + # The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + end + class AutomaticTax < Stripe::StripeObject + class Liability < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # Whether Stripe automatically computes tax on invoices created during this phase. + sig { returns(T::Boolean) } + attr_reader :enabled + # The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. + sig { returns(T.nilable(Liability)) } + attr_reader :liability + end + class BillingThresholds < Stripe::StripeObject + # Monetary threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :amount_gte + # Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :reset_billing_cycle_anchor + end + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class InvoiceSettings < Stripe::StripeObject + class Issuer < Stripe::StripeObject + # The connected account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # Type of the account referenced. + sig { returns(String) } + attr_reader :type + end + # The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. + sig { returns(T.nilable(T::Array[T.any(String, Stripe::TaxId)])) } + attr_reader :account_tax_ids + # Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. + sig { returns(T.nilable(Integer)) } + attr_reader :days_until_due + # The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. + sig { returns(T.nilable(Issuer)) } + attr_reader :issuer + end + class Item < Stripe::StripeObject + class BillingThresholds < Stripe::StripeObject + # Usage threshold that triggers the subscription to create an invoice + sig { returns(T.nilable(Integer)) } + attr_reader :usage_gte + end + class Discount < Stripe::StripeObject + class DiscountEnd < Stripe::StripeObject + # The discount end timestamp. + sig { returns(T.nilable(Integer)) } + attr_reader :timestamp + # The discount end type. + sig { returns(String) } + attr_reader :type + end + # ID of the coupon to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # ID of an existing discount on the object (or one of its ancestors) to reuse. + sig { returns(T.nilable(T.any(String, Stripe::Discount))) } + attr_reader :discount + # Details to determine how long the discount should be applied for. + sig { returns(T.nilable(DiscountEnd)) } + attr_reader :discount_end + # ID of the promotion code to create a new discount for. + sig { returns(T.nilable(T.any(String, Stripe::PromotionCode))) } + attr_reader :promotion_code + end + class Trial < Stripe::StripeObject + # List of price IDs which, if present on the subscription following a paid trial, constitute opting-in to the paid trial. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :converts_to + # Determines the type of trial for this item. + sig { returns(String) } + attr_reader :type + end + # Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + # The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # ID of the plan to which the customer should be subscribed. + sig { returns(T.any(String, Stripe::Plan)) } + attr_reader :plan + # ID of the price to which the customer should be subscribed. + sig { returns(T.any(String, Stripe::Price)) } + attr_reader :price + # Quantity of the plan to which the customer should be subscribed. + sig { returns(Integer) } + attr_reader :quantity + # The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :tax_rates + # Options that configure the trial on the subscription item. + sig { returns(T.nilable(Trial)) } + attr_reader :trial + end + class PauseCollection < Stripe::StripeObject + # The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. + sig { returns(String) } + attr_reader :behavior + end + class TransferData < Stripe::StripeObject + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. + sig { returns(T.nilable(Float)) } + attr_reader :amount_percent + # The account where funds from the payment will be transferred to upon payment success. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :destination + end + class TrialSettings < Stripe::StripeObject + class EndBehavior < Stripe::StripeObject + # Configure how an opt-in following a paid trial is billed when using `billing_behavior: prorate_up_front`. + sig { returns(T.nilable(String)) } + attr_reader :prorate_up_front + end + # Defines how the subscription should behave when a trial ends. + sig { returns(T.nilable(EndBehavior)) } + attr_reader :end_behavior + end + # A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. + sig { returns(T::Array[AddInvoiceItem]) } + attr_reader :add_invoice_items + # A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. + sig { returns(T.nilable(Float)) } + attr_reader :application_fee_percent + # Attribute for field automatic_tax + sig { returns(AutomaticTax) } + attr_reader :automatic_tax + # Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). + sig { returns(T.nilable(String)) } + attr_reader :billing_cycle_anchor + # Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + sig { returns(T.nilable(BillingThresholds)) } + attr_reader :billing_thresholds + # Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. + sig { returns(T.nilable(String)) } + attr_reader :collection_method + # ID of the coupon to use during this phase of the subscription schedule. + sig { returns(T.nilable(T.any(String, Stripe::Coupon))) } + attr_reader :coupon + # 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). + sig { returns(String) } + attr_reader :currency + # ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. + sig { returns(T.nilable(T.any(String, Stripe::PaymentMethod))) } + attr_reader :default_payment_method + # The default tax rates to apply to the subscription during this phase of the subscription schedule. + sig { returns(T.nilable(T::Array[Stripe::TaxRate])) } + attr_reader :default_tax_rates + # Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. + sig { returns(T.nilable(String)) } + attr_reader :description + # The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. + sig { returns(T::Array[Discount]) } + attr_reader :discounts + # The end of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :end_date + # The invoice settings applicable during this phase. + sig { returns(T.nilable(InvoiceSettings)) } + attr_reader :invoice_settings + # Subscription items to configure the subscription to during this phase of the subscription schedule. + sig { returns(T::Array[Item]) } + attr_reader :items + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + # The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :on_behalf_of + # If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/docs/billing/subscriptions/pause-payment). + sig { returns(T.nilable(PauseCollection)) } + attr_reader :pause_collection + # If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. + sig { returns(String) } + attr_reader :proration_behavior + # The start of this phase of the subscription schedule. + sig { returns(Integer) } + attr_reader :start_date + # The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. + sig { returns(T.nilable(TransferData)) } + attr_reader :transfer_data + # Specify behavior of the trial when crossing schedule phase boundaries + sig { returns(T.nilable(String)) } + attr_reader :trial_continuation + # When the trial ends within the phase. + sig { returns(T.nilable(Integer)) } + attr_reader :trial_end + # Settings related to any trials on the subscription during this phase. + sig { returns(T.nilable(TrialSettings)) } + attr_reader :trial_settings + end + class Prebilling < Stripe::StripeObject + # ID of the prebilling invoice. + sig { returns(T.any(String, Stripe::Invoice)) } + attr_reader :invoice + # The end of the last period for which the invoice pre-bills. + sig { returns(Integer) } + attr_reader :period_end + # The start of the first period for which the invoice pre-bills. + sig { returns(Integer) } + attr_reader :period_start + # Whether to cancel or preserve `prebilling` if the subscription is updated during the prebilled period. + sig { returns(String) } + attr_reader :update_behavior + end + # ID of the Connect Application that created the schedule. + sig { returns(T.nilable(T.any(String, Stripe::Application))) } + attr_reader :application + + # Configures when the subscription schedule generates prorations for phase transitions. Possible values are `prorate_on_next_phase` or `prorate_up_front` with the default being `prorate_on_next_phase`. `prorate_on_next_phase` will apply phase changes and generate prorations at transition time. `prorate_up_front` will bill for all phases within the current billing cycle up front. + sig { returns(String) } + attr_reader :billing_behavior + + # Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + + # Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :completed_at + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. + sig { returns(T.nilable(CurrentPhase)) } + attr_reader :current_phase + + # ID of the customer who owns the subscription schedule. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + + # Attribute for field default_settings + sig { returns(DefaultSettings) } + attr_reader :default_settings + + # Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. + sig { returns(String) } + attr_reader :end_behavior + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Details of the most recent price migration that failed for the subscription schedule. + sig { returns(T.nilable(LastPriceMigrationError)) } + attr_reader :last_price_migration_error + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Configuration for the subscription schedule's phases. + sig { returns(T::Array[Phase]) } + attr_reader :phases + + # Time period and invoice for a Subscription billed in advance. + sig { returns(T.nilable(Prebilling)) } + attr_reader :prebilling + + # Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :released_at + + # ID of the subscription once managed by the subscription schedule (if it is released). + sig { returns(T.nilable(String)) } + attr_reader :released_subscription + + # The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). + sig { returns(String) } + attr_reader :status + + # ID of the subscription managed by the subscription schedule. + sig { returns(T.nilable(T.any(String, Stripe::Subscription))) } + attr_reader :subscription + + # ID of the test clock this subscription schedule belongs to. + sig { returns(T.nilable(T.any(String, Stripe::TestHelpers::TestClock))) } + attr_reader :test_clock + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/association.rbi b/rbi/stripe/resources/tax/association.rbi new file mode 100644 index 000000000..2ce5aa4ce --- /dev/null +++ b/rbi/stripe/resources/tax/association.rbi @@ -0,0 +1,84 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + # A Tax Association exposes the Tax Transactions that Stripe attempted to create on your behalf based on the PaymentIntent input + class Association < APIResource + class StatusDetails < Stripe::StripeObject + class Committed < Stripe::StripeObject + class Reversal < Stripe::StripeObject + class StatusDetails < Stripe::StripeObject + class Committed < Stripe::StripeObject + # The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + sig { returns(String) } + attr_reader :transaction + end + class Errored < Stripe::StripeObject + # Details on why we could not commit the reversal Tax Transaction + sig { returns(String) } + attr_reader :reason + # The [Refund](https://stripe.com/docs/api/refunds/object) ID that should have created a tax reversal. + sig { returns(String) } + attr_reader :refund_id + end + # Attribute for field committed + sig { returns(Committed) } + attr_reader :committed + # Attribute for field errored + sig { returns(Errored) } + attr_reader :errored + end + # Status of the attempted Tax Transaction reversal. + sig { returns(String) } + attr_reader :status + # Attribute for field status_details + sig { returns(StatusDetails) } + attr_reader :status_details + end + # Attempts to create Tax Transaction reversals + sig { returns(T::Array[Reversal]) } + attr_reader :reversals + # The [Tax Transaction](https://stripe.com/docs/api/tax/transaction/object) + sig { returns(String) } + attr_reader :transaction + end + class Errored < Stripe::StripeObject + # Details on why we could not commit the Tax Transaction + sig { returns(String) } + attr_reader :reason + end + # Attribute for field committed + sig { returns(Committed) } + attr_reader :committed + # Attribute for field errored + sig { returns(Errored) } + attr_reader :errored + end + # The [Tax Calculation](https://stripe.com/docs/api/tax/calculations/object) that was included in PaymentIntent. + sig { returns(String) } + attr_reader :calculation + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The [PaymentIntent](https://stripe.com/docs/api/payment_intents/object) that this Tax Association is tracking. + sig { returns(String) } + attr_reader :payment_intent + + # Status of the Tax Association. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_details + sig { returns(StatusDetails) } + attr_reader :status_details + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/calculation.rbi b/rbi/stripe/resources/tax/calculation.rbi new file mode 100644 index 000000000..1a067f224 --- /dev/null +++ b/rbi/stripe/resources/tax/calculation.rbi @@ -0,0 +1,252 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + # A Tax Calculation allows you to calculate the tax to collect from your customer. + # + # Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom) + class Calculation < APIResource + class CustomerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + sig { returns(T.nilable(String)) } + attr_reader :state + end + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(String) } + attr_reader :value + end + # The customer's postal address (for example, home or business location). + sig { returns(T.nilable(Address)) } + attr_reader :address + # The type of customer address provided. + sig { returns(T.nilable(String)) } + attr_reader :address_source + # The customer's IP address (IPv4 or IPv6). + sig { returns(T.nilable(String)) } + attr_reader :ip_address + # The customer's tax IDs (for example, EU VAT numbers). + sig { returns(T::Array[TaxId]) } + attr_reader :tax_ids + # The taxability override used for taxation. + sig { returns(String) } + attr_reader :taxability_override + end + class ShipFromDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + end + class ShippingCost < Stripe::StripeObject + class TaxBreakdown < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # A human-readable name for the jurisdiction imposing the tax. + sig { returns(String) } + attr_reader :display_name + # Indicates the level of the jurisdiction imposing the tax. + sig { returns(String) } + attr_reader :level + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class TaxRateDetails < Stripe::StripeObject + # A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + sig { returns(String) } + attr_reader :display_name + # The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + sig { returns(String) } + attr_reader :percentage_decimal + # The tax type, such as `vat` or `sales_tax`. + sig { returns(String) } + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Attribute for field jurisdiction + sig { returns(Jurisdiction) } + attr_reader :jurisdiction + # Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + sig { returns(String) } + attr_reader :sourcing + # Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + sig { returns(T.nilable(TaxRateDetails)) } + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(String) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :taxable_amount + end + # The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + sig { returns(Integer) } + attr_reader :amount + # The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount_tax + # The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + sig { returns(String) } + attr_reader :shipping_rate + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + sig { returns(String) } + attr_reader :tax_behavior + # Detailed account of taxes relevant to shipping cost. + sig { returns(T::Array[TaxBreakdown]) } + attr_reader :tax_breakdown + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + sig { returns(String) } + attr_reader :tax_code + end + class TaxBreakdown < Stripe::StripeObject + class TaxRateDetails < Stripe::StripeObject + class FlatAmount < Stripe::StripeObject + # Amount of the tax when the `rate_type` is `flat_amount`. This positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + sig { returns(Integer) } + attr_reader :amount + # Three-letter ISO currency code, in lowercase. + sig { returns(String) } + attr_reader :currency + end + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate. + sig { returns(T.nilable(FlatAmount)) } + attr_reader :flat_amount + # The tax rate percentage as a string. For example, 8.5% is represented as `"8.5"`. + sig { returns(String) } + attr_reader :percentage_decimal + # Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + sig { returns(T.nilable(String)) } + attr_reader :rate_type + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + # The tax type, such as `vat` or `sales_tax`. + sig { returns(T.nilable(String)) } + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Specifies whether the tax amount is included in the line item amount. + sig { returns(T::Boolean) } + attr_reader :inclusive + # Attribute for field tax_rate_details + sig { returns(TaxRateDetails) } + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. We might extend the possible values for this field to support new tax rules. + sig { returns(String) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :taxable_amount + end + # Total amount after taxes in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount_total + + # 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). + sig { returns(String) } + attr_reader :currency + + # The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + sig { returns(T.nilable(String)) } + attr_reader :customer + + # Attribute for field customer_details + sig { returns(CustomerDetails) } + attr_reader :customer_details + + # Timestamp of date at which the tax calculation will expire. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # Unique identifier for the calculation. + sig { returns(T.nilable(String)) } + attr_reader :id + + # The list of items the customer is purchasing. + sig { returns(T.nilable(Stripe::ListObject)) } + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The details of the ship from location, such as the address. + sig { returns(T.nilable(ShipFromDetails)) } + attr_reader :ship_from_details + + # The shipping cost details for the calculation. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # The amount of tax to be collected on top of the line item prices. + sig { returns(Integer) } + attr_reader :tax_amount_exclusive + + # The amount of tax already included in the line item prices. + sig { returns(Integer) } + attr_reader :tax_amount_inclusive + + # Breakdown of individual tax amounts that add up to the total. + sig { returns(T::Array[TaxBreakdown]) } + attr_reader :tax_breakdown + + # Timestamp of date at which the tax rules and rates in effect applies for the calculation. + sig { returns(Integer) } + attr_reader :tax_date + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/calculation_line_item.rbi b/rbi/stripe/resources/tax/calculation_line_item.rbi new file mode 100644 index 000000000..571ebbf63 --- /dev/null +++ b/rbi/stripe/resources/tax/calculation_line_item.rbi @@ -0,0 +1,98 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + class CalculationLineItem < APIResource + class TaxBreakdown < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # A human-readable name for the jurisdiction imposing the tax. + sig { returns(String) } + attr_reader :display_name + # Indicates the level of the jurisdiction imposing the tax. + sig { returns(String) } + attr_reader :level + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class TaxRateDetails < Stripe::StripeObject + # A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + sig { returns(String) } + attr_reader :display_name + # The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + sig { returns(String) } + attr_reader :percentage_decimal + # The tax type, such as `vat` or `sales_tax`. + sig { returns(String) } + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Attribute for field jurisdiction + sig { returns(Jurisdiction) } + attr_reader :jurisdiction + # Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + sig { returns(String) } + attr_reader :sourcing + # Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + sig { returns(T.nilable(TaxRateDetails)) } + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(String) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :taxable_amount + end + # The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + sig { returns(Integer) } + attr_reader :amount + + # The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount_tax + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ID of an existing [Product](https://stripe.com/docs/api/products/object). + sig { returns(T.nilable(String)) } + attr_reader :product + + # The number of units of the item being purchased. For reversals, this is the quantity reversed. + sig { returns(Integer) } + attr_reader :quantity + + # A custom identifier for this line item. + sig { returns(T.nilable(String)) } + attr_reader :reference + + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + sig { returns(String) } + attr_reader :tax_behavior + + # Detailed account of taxes relevant to this line item. + sig { returns(T.nilable(T::Array[TaxBreakdown])) } + attr_reader :tax_breakdown + + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + sig { returns(String) } + attr_reader :tax_code + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/form.rbi b/rbi/stripe/resources/tax/form.rbi new file mode 100644 index 000000000..f403f3b29 --- /dev/null +++ b/rbi/stripe/resources/tax/form.rbi @@ -0,0 +1,164 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + # Tax forms are legal documents which are delivered to one or more tax authorities for information reporting purposes. + # + # Related guide: [US tax reporting for Connect platforms](https://stripe.com/docs/connect/tax-reporting) + class Form < APIResource + class AuSerr < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_start_date + end + class CaMrdp < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_start_date + end + class EuDac7 < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_start_date + end + class FilingStatus < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). Always `US`. + sig { returns(String) } + attr_reader :country + # Indicates the level of the jurisdiction where the form was filed. + sig { returns(String) } + attr_reader :level + # [ISO 3166-2 U.S. state code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix, if any. For example, "NY" for New York, United States. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Time when the filing status was updated. + sig { returns(Integer) } + attr_reader :effective_at + # Attribute for field jurisdiction + sig { returns(Jurisdiction) } + attr_reader :jurisdiction + # The current status of the filed form. + sig { returns(String) } + attr_reader :value + end + class GbMrdp < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_start_date + end + class NzMrdp < Stripe::StripeObject + # End date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_end_date + # Start date of the period represented by the information reported on the tax form. + sig { returns(String) } + attr_reader :reporting_period_start_date + end + class Payee < Stripe::StripeObject + # The ID of the payee's Stripe account. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :account + # The external reference to this payee. + sig { returns(T.nilable(String)) } + attr_reader :external_reference + # Either `account` or `external_reference`. + sig { returns(String) } + attr_reader :type + end + class Us1099K < Stripe::StripeObject + # Year represented by the information reported on the tax form. + sig { returns(Integer) } + attr_reader :reporting_year + end + class Us1099Misc < Stripe::StripeObject + # Year represented by the information reported on the tax form. + sig { returns(Integer) } + attr_reader :reporting_year + end + class Us1099Nec < Stripe::StripeObject + # Year represented by the information reported on the tax form. + sig { returns(Integer) } + attr_reader :reporting_year + end + # Attribute for field au_serr + sig { returns(AuSerr) } + attr_reader :au_serr + + # Attribute for field ca_mrdp + sig { returns(CaMrdp) } + attr_reader :ca_mrdp + + # The form that corrects this form, if any. + sig { returns(T.nilable(T.any(String, Stripe::Tax::Form))) } + attr_reader :corrected_by + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Attribute for field eu_dac7 + sig { returns(EuDac7) } + attr_reader :eu_dac7 + + # A list of tax filing statuses. Note that a filing status will only be included if the form has been filed directly with the jurisdiction’s tax authority. + sig { returns(T::Array[FilingStatus]) } + attr_reader :filing_statuses + + # Attribute for field gb_mrdp + sig { returns(GbMrdp) } + attr_reader :gb_mrdp + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Attribute for field nz_mrdp + sig { returns(NzMrdp) } + attr_reader :nz_mrdp + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field payee + sig { returns(Payee) } + attr_reader :payee + + # The type of the tax form. An additional hash is included on the tax form with a name matching this value. It contains additional information specific to the tax form type. + sig { returns(String) } + attr_reader :type + + # Attribute for field us_1099_k + sig { returns(Us1099K) } + attr_reader :us_1099_k + + # Attribute for field us_1099_misc + sig { returns(Us1099Misc) } + attr_reader :us_1099_misc + + # Attribute for field us_1099_nec + sig { returns(Us1099Nec) } + attr_reader :us_1099_nec + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/registration.rbi b/rbi/stripe/resources/tax/registration.rbi new file mode 100644 index 000000000..89587ba9d --- /dev/null +++ b/rbi/stripe/resources/tax/registration.rbi @@ -0,0 +1,831 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + # A Tax `Registration` lets us know that your business is registered to collect tax on payments within a region, enabling you to [automatically collect tax](https://stripe.com/docs/tax). + # + # Stripe doesn't register on your behalf with the relevant authorities when you create a Tax `Registration` object. For more information on how to register to collect tax, see [our guide](https://stripe.com/docs/tax/registering). + # + # Related guide: [Using the Registrations API](https://stripe.com/docs/tax/registrations-api) + class Registration < APIResource + class CountryOptions < Stripe::StripeObject + class Ae < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class At < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Au < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Be < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Bg < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Bh < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class By < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ca < Stripe::StripeObject + class ProvinceStandard < Stripe::StripeObject + # Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + sig { returns(String) } + attr_reader :province + end + # Attribute for field province_standard + sig { returns(ProvinceStandard) } + attr_reader :province_standard + # Type of registration in Canada. + sig { returns(String) } + attr_reader :type + end + class Ch < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Cl < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Co < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Cr < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Cy < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Cz < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class De < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Dk < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Ec < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ee < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Eg < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Es < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Fi < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Fr < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Gb < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ge < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Gr < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Hr < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Hu < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Id < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ie < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Is < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class It < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Jp < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ke < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Kr < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Kz < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Lt < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Lu < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Lv < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Ma < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Md < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Mt < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Mx < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class My < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ng < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Nl < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class No < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Nz < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Om < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Pl < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Pt < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Ro < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Rs < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Ru < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Sa < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Se < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Sg < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Si < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Sk < Stripe::StripeObject + class Standard < Stripe::StripeObject + # Place of supply scheme used in an EU standard registration. + sig { returns(String) } + attr_reader :place_of_supply_scheme + end + # Attribute for field standard + sig { returns(Standard) } + attr_reader :standard + # Type of registration in an EU country. + sig { returns(String) } + attr_reader :type + end + class Th < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Tr < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Tz < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Us < Stripe::StripeObject + class LocalAmusementTax < Stripe::StripeObject + # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + sig { returns(String) } + attr_reader :jurisdiction + end + class LocalLeaseTax < Stripe::StripeObject + # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + sig { returns(String) } + attr_reader :jurisdiction + end + class StateSalesTax < Stripe::StripeObject + class Election < Stripe::StripeObject + # A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. + sig { returns(String) } + attr_reader :jurisdiction + # The type of the election for the state sales tax registration. + sig { returns(String) } + attr_reader :type + end + # Elections for the state sales tax registration. + sig { returns(T::Array[Election]) } + attr_reader :elections + end + # Attribute for field local_amusement_tax + sig { returns(LocalAmusementTax) } + attr_reader :local_amusement_tax + # Attribute for field local_lease_tax + sig { returns(LocalLeaseTax) } + attr_reader :local_lease_tax + # Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). + sig { returns(String) } + attr_reader :state + # Attribute for field state_sales_tax + sig { returns(StateSalesTax) } + attr_reader :state_sales_tax + # Type of registration in the US. + sig { returns(String) } + attr_reader :type + end + class Uz < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Vn < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + class Za < Stripe::StripeObject + # Type of registration in `country`. + sig { returns(String) } + attr_reader :type + end + # Attribute for field ae + sig { returns(Ae) } + attr_reader :ae + # Attribute for field at + sig { returns(At) } + attr_reader :at + # Attribute for field au + sig { returns(Au) } + attr_reader :au + # Attribute for field be + sig { returns(Be) } + attr_reader :be + # Attribute for field bg + sig { returns(Bg) } + attr_reader :bg + # Attribute for field bh + sig { returns(Bh) } + attr_reader :bh + # Attribute for field by + sig { returns(By) } + attr_reader :by + # Attribute for field ca + sig { returns(Ca) } + attr_reader :ca + # Attribute for field ch + sig { returns(Ch) } + attr_reader :ch + # Attribute for field cl + sig { returns(Cl) } + attr_reader :cl + # Attribute for field co + sig { returns(Co) } + attr_reader :co + # Attribute for field cr + sig { returns(Cr) } + attr_reader :cr + # Attribute for field cy + sig { returns(Cy) } + attr_reader :cy + # Attribute for field cz + sig { returns(Cz) } + attr_reader :cz + # Attribute for field de + sig { returns(De) } + attr_reader :de + # Attribute for field dk + sig { returns(Dk) } + attr_reader :dk + # Attribute for field ec + sig { returns(Ec) } + attr_reader :ec + # Attribute for field ee + sig { returns(Ee) } + attr_reader :ee + # Attribute for field eg + sig { returns(Eg) } + attr_reader :eg + # Attribute for field es + sig { returns(Es) } + attr_reader :es + # Attribute for field fi + sig { returns(Fi) } + attr_reader :fi + # Attribute for field fr + sig { returns(Fr) } + attr_reader :fr + # Attribute for field gb + sig { returns(Gb) } + attr_reader :gb + # Attribute for field ge + sig { returns(Ge) } + attr_reader :ge + # Attribute for field gr + sig { returns(Gr) } + attr_reader :gr + # Attribute for field hr + sig { returns(Hr) } + attr_reader :hr + # Attribute for field hu + sig { returns(Hu) } + attr_reader :hu + # Attribute for field id + sig { returns(Id) } + attr_reader :id + # Attribute for field ie + sig { returns(Ie) } + attr_reader :ie + # Attribute for field is + sig { returns(Is) } + attr_reader :is + # Attribute for field it + sig { returns(It) } + attr_reader :it + # Attribute for field jp + sig { returns(Jp) } + attr_reader :jp + # Attribute for field ke + sig { returns(Ke) } + attr_reader :ke + # Attribute for field kr + sig { returns(Kr) } + attr_reader :kr + # Attribute for field kz + sig { returns(Kz) } + attr_reader :kz + # Attribute for field lt + sig { returns(Lt) } + attr_reader :lt + # Attribute for field lu + sig { returns(Lu) } + attr_reader :lu + # Attribute for field lv + sig { returns(Lv) } + attr_reader :lv + # Attribute for field ma + sig { returns(Ma) } + attr_reader :ma + # Attribute for field md + sig { returns(Md) } + attr_reader :md + # Attribute for field mt + sig { returns(Mt) } + attr_reader :mt + # Attribute for field mx + sig { returns(Mx) } + attr_reader :mx + # Attribute for field my + sig { returns(My) } + attr_reader :my + # Attribute for field ng + sig { returns(Ng) } + attr_reader :ng + # Attribute for field nl + sig { returns(Nl) } + attr_reader :nl + # Attribute for field no + sig { returns(No) } + attr_reader :no + # Attribute for field nz + sig { returns(Nz) } + attr_reader :nz + # Attribute for field om + sig { returns(Om) } + attr_reader :om + # Attribute for field pl + sig { returns(Pl) } + attr_reader :pl + # Attribute for field pt + sig { returns(Pt) } + attr_reader :pt + # Attribute for field ro + sig { returns(Ro) } + attr_reader :ro + # Attribute for field rs + sig { returns(Rs) } + attr_reader :rs + # Attribute for field ru + sig { returns(Ru) } + attr_reader :ru + # Attribute for field sa + sig { returns(Sa) } + attr_reader :sa + # Attribute for field se + sig { returns(Se) } + attr_reader :se + # Attribute for field sg + sig { returns(Sg) } + attr_reader :sg + # Attribute for field si + sig { returns(Si) } + attr_reader :si + # Attribute for field sk + sig { returns(Sk) } + attr_reader :sk + # Attribute for field th + sig { returns(Th) } + attr_reader :th + # Attribute for field tr + sig { returns(Tr) } + attr_reader :tr + # Attribute for field tz + sig { returns(Tz) } + attr_reader :tz + # Attribute for field us + sig { returns(Us) } + attr_reader :us + # Attribute for field uz + sig { returns(Uz) } + attr_reader :uz + # Attribute for field vn + sig { returns(Vn) } + attr_reader :vn + # Attribute for field za + sig { returns(Za) } + attr_reader :za + end + # Time at which the registration becomes active. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :active_from + + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + + # Attribute for field country_options + sig { returns(CountryOptions) } + attr_reader :country_options + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. Measured in seconds since the Unix epoch. + sig { returns(T.nilable(Integer)) } + attr_reader :expires_at + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The status of the registration. This field is present for convenience and can be deduced from `active_from` and `expires_at`. + sig { returns(String) } + attr_reader :status + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/settings.rbi b/rbi/stripe/resources/tax/settings.rbi new file mode 100644 index 000000000..1c1ba5c93 --- /dev/null +++ b/rbi/stripe/resources/tax/settings.rbi @@ -0,0 +1,83 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + # You can use Tax `Settings` to manage configurations used by Stripe Tax calculations. + # + # Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api) + class Settings < SingletonAPIResource + class Defaults < Stripe::StripeObject + # Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior. + sig { returns(T.nilable(String)) } + attr_reader :tax_behavior + # Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. + sig { returns(T.nilable(String)) } + attr_reader :tax_code + end + class HeadOffice < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + end + class StatusDetails < Stripe::StripeObject + class Active < Stripe::StripeObject; end + class Pending < Stripe::StripeObject + # The list of missing fields that are required to perform calculations. It includes the entry `head_office` when the status is `pending`. It is recommended to set the optional values even if they aren't listed as required for calculating taxes. Calculations can fail if missing fields aren't explicitly provided on every call. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :missing_fields + end + # Attribute for field active + sig { returns(Active) } + attr_reader :active + # Attribute for field pending + sig { returns(Pending) } + attr_reader :pending + end + # Attribute for field defaults + sig { returns(Defaults) } + attr_reader :defaults + + # The place where your business is located. + sig { returns(T.nilable(HeadOffice)) } + attr_reader :head_office + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The status of the Tax `Settings`. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_details + sig { returns(StatusDetails) } + attr_reader :status_details + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/transaction.rbi b/rbi/stripe/resources/tax/transaction.rbi new file mode 100644 index 000000000..8740d9f58 --- /dev/null +++ b/rbi/stripe/resources/tax/transaction.rbi @@ -0,0 +1,216 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + # A Tax Transaction records the tax collected from or refunded to your customer. + # + # Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction) + class Transaction < APIResource + class CustomerDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + sig { returns(T.nilable(String)) } + attr_reader :state + end + class TaxId < Stripe::StripeObject + # The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `hr_oib`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `li_vat`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, `tz_vat`, `uz_vat`, `uz_tin`, `md_vat`, `ma_vat`, `by_tin`, or `unknown` + sig { returns(String) } + attr_reader :type + # The value of the tax ID. + sig { returns(String) } + attr_reader :value + end + # The customer's postal address (for example, home or business location). + sig { returns(T.nilable(Address)) } + attr_reader :address + # The type of customer address provided. + sig { returns(T.nilable(String)) } + attr_reader :address_source + # The customer's IP address (IPv4 or IPv6). + sig { returns(T.nilable(String)) } + attr_reader :ip_address + # The customer's tax IDs (for example, EU VAT numbers). + sig { returns(T::Array[TaxId]) } + attr_reader :tax_ids + # The taxability override used for taxation. + sig { returns(String) } + attr_reader :taxability_override + end + class Reversal < Stripe::StripeObject + # The `id` of the reversed `Transaction` object. + sig { returns(T.nilable(String)) } + attr_reader :original_transaction + end + class ShipFromDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + end + class ShippingCost < Stripe::StripeObject + class TaxBreakdown < Stripe::StripeObject + class Jurisdiction < Stripe::StripeObject + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + # A human-readable name for the jurisdiction imposing the tax. + sig { returns(String) } + attr_reader :display_name + # Indicates the level of the jurisdiction imposing the tax. + sig { returns(String) } + attr_reader :level + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + sig { returns(T.nilable(String)) } + attr_reader :state + end + class TaxRateDetails < Stripe::StripeObject + # A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". + sig { returns(String) } + attr_reader :display_name + # The tax rate percentage as a string. For example, 8.5% is represented as "8.5". + sig { returns(String) } + attr_reader :percentage_decimal + # The tax type, such as `vat` or `sales_tax`. + sig { returns(String) } + attr_reader :tax_type + end + # The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Attribute for field jurisdiction + sig { returns(Jurisdiction) } + attr_reader :jurisdiction + # Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). + sig { returns(String) } + attr_reader :sourcing + # Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. + sig { returns(T.nilable(TaxRateDetails)) } + attr_reader :tax_rate_details + # The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. + sig { returns(String) } + attr_reader :taxability_reason + # The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :taxable_amount + end + # The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + sig { returns(Integer) } + attr_reader :amount + # The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount_tax + # The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). + sig { returns(String) } + attr_reader :shipping_rate + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + sig { returns(String) } + attr_reader :tax_behavior + # Detailed account of taxes relevant to shipping cost. (It is not populated for the transaction resource object and will be removed in the next API version.) + sig { returns(T::Array[TaxBreakdown]) } + attr_reader :tax_breakdown + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. + sig { returns(String) } + attr_reader :tax_code + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. + sig { returns(T.nilable(String)) } + attr_reader :customer + + # Attribute for field customer_details + sig { returns(CustomerDetails) } + attr_reader :customer_details + + # Unique identifier for the transaction. + sig { returns(String) } + attr_reader :id + + # The tax collected or refunded, by line item. + sig { returns(T.nilable(Stripe::ListObject)) } + attr_reader :line_items + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The Unix timestamp representing when the tax liability is assumed or reduced. + sig { returns(Integer) } + attr_reader :posted_at + + # A custom unique identifier, such as 'myOrder_123'. + sig { returns(String) } + attr_reader :reference + + # If `type=reversal`, contains information about what was reversed. + sig { returns(T.nilable(Reversal)) } + attr_reader :reversal + + # The details of the ship from location, such as the address. + sig { returns(T.nilable(ShipFromDetails)) } + attr_reader :ship_from_details + + # The shipping cost details for the transaction. + sig { returns(T.nilable(ShippingCost)) } + attr_reader :shipping_cost + + # Timestamp of date at which the tax rules and rates in effect applies for the calculation. + sig { returns(Integer) } + attr_reader :tax_date + + # If `reversal`, this transaction reverses an earlier transaction. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax/transaction_line_item.rbi b/rbi/stripe/resources/tax/transaction_line_item.rbi new file mode 100644 index 000000000..2b65c9c53 --- /dev/null +++ b/rbi/stripe/resources/tax/transaction_line_item.rbi @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Tax + class TransactionLineItem < APIResource + class Reversal < Stripe::StripeObject + # The `id` of the line item to reverse in the original transaction. + sig { returns(String) } + attr_reader :original_line_item + end + # The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. + sig { returns(Integer) } + attr_reader :amount + + # The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount_tax + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ID of an existing [Product](https://stripe.com/docs/api/products/object). + sig { returns(T.nilable(String)) } + attr_reader :product + + # The number of units of the item being purchased. For reversals, this is the quantity reversed. + sig { returns(Integer) } + attr_reader :quantity + + # A custom identifier for this line item in the transaction. + sig { returns(String) } + attr_reader :reference + + # If `type=reversal`, contains information about what was reversed. + sig { returns(T.nilable(Reversal)) } + attr_reader :reversal + + # Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. + sig { returns(String) } + attr_reader :tax_behavior + + # The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. + sig { returns(String) } + attr_reader :tax_code + + # If `reversal`, this line item reverses an earlier transaction. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax_code.rbi b/rbi/stripe/resources/tax_code.rbi new file mode 100644 index 000000000..38d6b5174 --- /dev/null +++ b/rbi/stripe/resources/tax_code.rbi @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. + class TaxCode < APIResource + # A detailed description of which types of products the tax code represents. + sig { returns(String) } + attr_reader :description + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # A short name for the tax code. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax_deducted_at_source.rbi b/rbi/stripe/resources/tax_deducted_at_source.rbi new file mode 100644 index 000000000..ef2601f3c --- /dev/null +++ b/rbi/stripe/resources/tax_deducted_at_source.rbi @@ -0,0 +1,27 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + class TaxDeductedAtSource < APIResource + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The end of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. + sig { returns(Integer) } + attr_reader :period_end + + # The start of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. + sig { returns(Integer) } + attr_reader :period_start + + # The TAN that was supplied to Stripe when TDS was assessed + sig { returns(String) } + attr_reader :tax_deduction_account_number + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax_id.rbi b/rbi/stripe/resources/tax_id.rbi new file mode 100644 index 000000000..a06192bae --- /dev/null +++ b/rbi/stripe/resources/tax_id.rbi @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. + # Customer and account tax IDs get displayed on related invoices and credit notes. + # + # Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids) + class TaxId < APIResource + class Owner < Stripe::StripeObject + # The account being referenced when `type` is `account`. + sig { returns(T.any(String, Stripe::Account)) } + attr_reader :account + # The Connect Application being referenced when `type` is `application`. + sig { returns(T.any(String, Stripe::Application)) } + attr_reader :application + # The customer being referenced when `type` is `customer`. + sig { returns(T.any(String, Stripe::Customer)) } + attr_reader :customer + # Type of owner referenced. + sig { returns(String) } + attr_reader :type + end + class Verification < Stripe::StripeObject + # Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. + sig { returns(String) } + attr_reader :status + # Verified address. + sig { returns(T.nilable(String)) } + attr_reader :verified_address + # Verified name. + sig { returns(T.nilable(String)) } + attr_reader :verified_name + end + # Two-letter ISO code representing the country of the tax ID. + sig { returns(T.nilable(String)) } + attr_reader :country + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # ID of the customer. + sig { returns(T.nilable(T.any(String, Stripe::Customer))) } + attr_reader :customer + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The account or customer the tax ID belongs to. + sig { returns(T.nilable(Owner)) } + attr_reader :owner + + # Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `by_tin`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hr_oib`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `li_vat`, `ma_vat`, `md_vat`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `tz_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `uz_tin`, `uz_vat`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` + sig { returns(String) } + attr_reader :type + + # Value of the tax ID. + sig { returns(String) } + attr_reader :value + + # Tax ID verification information. + sig { returns(T.nilable(Verification)) } + attr_reader :verification + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/tax_rate.rbi b/rbi/stripe/resources/tax_rate.rbi new file mode 100644 index 000000000..47cbecc99 --- /dev/null +++ b/rbi/stripe/resources/tax_rate.rbi @@ -0,0 +1,92 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. + # + # Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) + class TaxRate < APIResource + class FlatAmount < Stripe::StripeObject + # Amount of the tax when the `rate_type` is `flat_amount`. This positive integer represents how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + sig { returns(Integer) } + attr_reader :amount + # Three-letter ISO currency code, in lowercase. + sig { returns(String) } + attr_reader :currency + end + # Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + sig { returns(T::Boolean) } + attr_reader :active + + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + sig { returns(String) } + attr_reader :display_name + + # Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, + # this percentage reflects the rate actually used to calculate tax based on the product's taxability + # and whether the user is registered to collect taxes in the corresponding jurisdiction. + sig { returns(T.nilable(Float)) } + attr_reader :effective_percentage + + # The amount of the tax rate when the `rate_type` is `flat_amount`. Tax rates with `rate_type` `percentage` can vary based on the transaction, resulting in this field being `null`. This field exposes the amount and currency of the flat tax rate. + sig { returns(T.nilable(FlatAmount)) } + attr_reader :flat_amount + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # This specifies if the tax rate is inclusive or exclusive. + sig { returns(T::Boolean) } + attr_reader :inclusive + + # The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. + sig { returns(T.nilable(String)) } + attr_reader :jurisdiction + + # The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates. + sig { returns(T.nilable(String)) } + attr_reader :jurisdiction_level + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. + sig { returns(Float) } + attr_reader :percentage + + # Indicates the type of tax rate applied to the taxable amount. This value can be `null` when no tax applies to the location. + sig { returns(T.nilable(String)) } + attr_reader :rate_type + + # [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. + sig { returns(T.nilable(String)) } + attr_reader :state + + # The high-level tax type, such as `vat` or `sales_tax`. + sig { returns(T.nilable(String)) } + attr_reader :tax_type + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/terminal/configuration.rbi b/rbi/stripe/resources/terminal/configuration.rbi new file mode 100644 index 000000000..a3e7e7eb3 --- /dev/null +++ b/rbi/stripe/resources/terminal/configuration.rbi @@ -0,0 +1,298 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Terminal + # A Configurations object represents how features should be configured for terminal readers. + class Configuration < APIResource + class BbposWiseposE < Stripe::StripeObject + # A File ID representing an image you would like displayed on the reader. + sig { returns(T.any(String, Stripe::File)) } + attr_reader :splashscreen + end + class Offline < Stripe::StripeObject + # Determines whether to allow transactions to be collected while reader is offline. Defaults to false. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :enabled + end + class RebootWindow < Stripe::StripeObject + # Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. + sig { returns(Integer) } + attr_reader :end_hour + # Integer between 0 to 23 that represents the start hour of the reboot time window. + sig { returns(Integer) } + attr_reader :start_hour + end + class StripeS700 < Stripe::StripeObject + # A File ID representing an image you would like displayed on the reader. + sig { returns(T.any(String, Stripe::File)) } + attr_reader :splashscreen + end + class Tipping < Stripe::StripeObject + class Aud < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Cad < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Chf < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Czk < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Dkk < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Eur < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Gbp < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Hkd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Myr < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Nok < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Nzd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Pln < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Sek < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Sgd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + class Usd < Stripe::StripeObject + # Fixed amounts displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :fixed_amounts + # Percentages displayed when collecting a tip + sig { returns(T.nilable(T::Array[Integer])) } + attr_reader :percentages + # Below this amount, fixed amounts will be displayed; above it, percentages will be displayed + sig { returns(Integer) } + attr_reader :smart_tip_threshold + end + # Attribute for field aud + sig { returns(Aud) } + attr_reader :aud + # Attribute for field cad + sig { returns(Cad) } + attr_reader :cad + # Attribute for field chf + sig { returns(Chf) } + attr_reader :chf + # Attribute for field czk + sig { returns(Czk) } + attr_reader :czk + # Attribute for field dkk + sig { returns(Dkk) } + attr_reader :dkk + # Attribute for field eur + sig { returns(Eur) } + attr_reader :eur + # Attribute for field gbp + sig { returns(Gbp) } + attr_reader :gbp + # Attribute for field hkd + sig { returns(Hkd) } + attr_reader :hkd + # Attribute for field myr + sig { returns(Myr) } + attr_reader :myr + # Attribute for field nok + sig { returns(Nok) } + attr_reader :nok + # Attribute for field nzd + sig { returns(Nzd) } + attr_reader :nzd + # Attribute for field pln + sig { returns(Pln) } + attr_reader :pln + # Attribute for field sek + sig { returns(Sek) } + attr_reader :sek + # Attribute for field sgd + sig { returns(Sgd) } + attr_reader :sgd + # Attribute for field usd + sig { returns(Usd) } + attr_reader :usd + end + class VerifoneP400 < Stripe::StripeObject + # A File ID representing an image you would like displayed on the reader. + sig { returns(T.any(String, Stripe::File)) } + attr_reader :splashscreen + end + # Attribute for field bbpos_wisepos_e + sig { returns(BbposWiseposE) } + attr_reader :bbpos_wisepos_e + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Whether this Configuration is the default for your account + sig { returns(T.nilable(T::Boolean)) } + attr_reader :is_account_default + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String indicating the name of the Configuration object, set by the user + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field offline + sig { returns(Offline) } + attr_reader :offline + + # Attribute for field reboot_window + sig { returns(RebootWindow) } + attr_reader :reboot_window + + # Attribute for field stripe_s700 + sig { returns(StripeS700) } + attr_reader :stripe_s700 + + # Attribute for field tipping + sig { returns(Tipping) } + attr_reader :tipping + + # Attribute for field verifone_p400 + sig { returns(VerifoneP400) } + attr_reader :verifone_p400 + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/terminal/connection_token.rbi b/rbi/stripe/resources/terminal/connection_token.rbi new file mode 100644 index 000000000..c6cb936bf --- /dev/null +++ b/rbi/stripe/resources/terminal/connection_token.rbi @@ -0,0 +1,24 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Terminal + # A Connection Token is used by the Stripe Terminal SDK to connect to a reader. + # + # Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) + class ConnectionToken < APIResource + # The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). + sig { returns(String) } + attr_reader :location + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Your application should pass this token to the Stripe Terminal SDK. + sig { returns(String) } + attr_reader :secret + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/terminal/location.rbi b/rbi/stripe/resources/terminal/location.rbi new file mode 100644 index 000000000..6600b4059 --- /dev/null +++ b/rbi/stripe/resources/terminal/location.rbi @@ -0,0 +1,64 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Terminal + # A Location represents a grouping of readers. + # + # Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) + class Location < APIResource + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + + # The ID of a configuration that will be used to customize all readers in this location. + sig { returns(String) } + attr_reader :configuration_overrides + + # The display name of the location. + sig { returns(String) } + attr_reader :display_name + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/terminal/reader.rbi b/rbi/stripe/resources/terminal/reader.rbi new file mode 100644 index 000000000..7a6067202 --- /dev/null +++ b/rbi/stripe/resources/terminal/reader.rbi @@ -0,0 +1,366 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Terminal + # A Reader represents a physical device for accepting payment details. + # + # Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader) + class Reader < APIResource + class Action < Stripe::StripeObject + class CollectInputs < Stripe::StripeObject + class Input < Stripe::StripeObject + class CustomText < Stripe::StripeObject + # Customize the default description for this input + sig { returns(T.nilable(String)) } + attr_reader :description + # Customize the default label for this input's skip button + sig { returns(T.nilable(String)) } + attr_reader :skip_button + # Customize the default label for this input's submit button + sig { returns(T.nilable(String)) } + attr_reader :submit_button + # Customize the default title for this input + sig { returns(T.nilable(String)) } + attr_reader :title + end + class Email < Stripe::StripeObject + # The collected email address + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Numeric < Stripe::StripeObject + # The collected number + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Phone < Stripe::StripeObject + # The collected phone number + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Selection < Stripe::StripeObject + class Choice < Stripe::StripeObject + # The button style for the choice + sig { returns(T.nilable(String)) } + attr_reader :style + # A value to be selected + sig { returns(String) } + attr_reader :value + end + # List of possible choices to be selected + sig { returns(T::Array[Choice]) } + attr_reader :choices + # The value of the selected choice + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Signature < Stripe::StripeObject + # The File ID of a collected signature image + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Text < Stripe::StripeObject + # The collected text value + sig { returns(T.nilable(String)) } + attr_reader :value + end + class Toggle < Stripe::StripeObject + # The toggle's default value + sig { returns(T.nilable(String)) } + attr_reader :default_value + # The toggle's description text + sig { returns(T.nilable(String)) } + attr_reader :description + # The toggle's title text + sig { returns(T.nilable(String)) } + attr_reader :title + # The toggle's collected value + sig { returns(T.nilable(String)) } + attr_reader :value + end + # Default text of input being collected. + sig { returns(T.nilable(CustomText)) } + attr_reader :custom_text + # Information about a email being collected using a reader + sig { returns(Email) } + attr_reader :email + # Information about a number being collected using a reader + sig { returns(Numeric) } + attr_reader :numeric + # Information about a phone number being collected using a reader + sig { returns(Phone) } + attr_reader :phone + # Indicate that this input is required, disabling the skip button. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :required + # Information about a selection being collected using a reader + sig { returns(Selection) } + attr_reader :selection + # Information about a signature being collected using a reader + sig { returns(Signature) } + attr_reader :signature + # Indicate that this input was skipped by the user. + sig { returns(T::Boolean) } + attr_reader :skipped + # Information about text being collected using a reader + sig { returns(Text) } + attr_reader :text + # List of toggles being collected. Values are present if collection is complete. + sig { returns(T.nilable(T::Array[Toggle])) } + attr_reader :toggles + # Type of input being collected. + sig { returns(String) } + attr_reader :type + end + # List of inputs to be collected. + sig { returns(T::Array[Input]) } + attr_reader :inputs + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + end + class CollectPaymentMethod < Stripe::StripeObject + class CollectConfig < Stripe::StripeObject + class Tipping < Stripe::StripeObject + # Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :amount_eligible + end + # Enable customer initiated cancellation when processing this payment. + sig { returns(T::Boolean) } + attr_reader :enable_customer_cancellation + # Override showing a tipping selection screen on this transaction. + sig { returns(T::Boolean) } + attr_reader :skip_tipping + # Represents a per-transaction tipping configuration + sig { returns(Tipping) } + attr_reader :tipping + end + # Represents a per-transaction override of a reader configuration + sig { returns(CollectConfig) } + attr_reader :collect_config + # Most recent PaymentIntent processed by the reader. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + # PaymentMethod objects represent your customer's payment instruments. + # You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to + # Customer objects to store instrument details for future payments. + # + # Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). + sig { returns(Stripe::PaymentMethod) } + attr_reader :payment_method + # Attribute for field stripe_account + sig { returns(String) } + attr_reader :stripe_account + end + class ConfirmPaymentIntent < Stripe::StripeObject + # Most recent PaymentIntent processed by the reader. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + # Attribute for field stripe_account + sig { returns(String) } + attr_reader :stripe_account + end + class ProcessPaymentIntent < Stripe::StripeObject + class ProcessConfig < Stripe::StripeObject + class Tipping < Stripe::StripeObject + # Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + sig { returns(Integer) } + attr_reader :amount_eligible + end + # Enable customer initiated cancellation when processing this payment. + sig { returns(T::Boolean) } + attr_reader :enable_customer_cancellation + # Override showing a tipping selection screen on this transaction. + sig { returns(T::Boolean) } + attr_reader :skip_tipping + # Represents a per-transaction tipping configuration + sig { returns(Tipping) } + attr_reader :tipping + end + # Most recent PaymentIntent processed by the reader. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + # Represents a per-transaction override of a reader configuration + sig { returns(ProcessConfig) } + attr_reader :process_config + # Attribute for field stripe_account + sig { returns(String) } + attr_reader :stripe_account + end + class ProcessSetupIntent < Stripe::StripeObject + class ProcessConfig < Stripe::StripeObject + # Enable customer initiated cancellation when processing this SetupIntent. + sig { returns(T::Boolean) } + attr_reader :enable_customer_cancellation + end + # ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. + sig { returns(String) } + attr_reader :generated_card + # Represents a per-setup override of a reader configuration + sig { returns(ProcessConfig) } + attr_reader :process_config + # Most recent SetupIntent processed by the reader. + sig { returns(T.any(String, Stripe::SetupIntent)) } + attr_reader :setup_intent + end + class RefundPayment < Stripe::StripeObject + class RefundPaymentConfig < Stripe::StripeObject + # Enable customer initiated cancellation when refunding this payment. + sig { returns(T::Boolean) } + attr_reader :enable_customer_cancellation + end + # The amount being refunded. + sig { returns(Integer) } + attr_reader :amount + # Charge that is being refunded. + sig { returns(T.any(String, Stripe::Charge)) } + attr_reader :charge + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + # Payment intent that is being refunded. + sig { returns(T.any(String, Stripe::PaymentIntent)) } + attr_reader :payment_intent + # The reason for the refund. + sig { returns(String) } + attr_reader :reason + # Unique identifier for the refund object. + sig { returns(T.any(String, Stripe::Refund)) } + attr_reader :refund + # Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. + sig { returns(T::Boolean) } + attr_reader :refund_application_fee + # Represents a per-transaction override of a reader configuration + sig { returns(RefundPaymentConfig) } + attr_reader :refund_payment_config + # Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. + sig { returns(T::Boolean) } + attr_reader :reverse_transfer + # Attribute for field stripe_account + sig { returns(String) } + attr_reader :stripe_account + end + class SetReaderDisplay < Stripe::StripeObject + class Cart < Stripe::StripeObject + class LineItem < Stripe::StripeObject + # The amount of the line item. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :amount + # Description of the line item. + sig { returns(String) } + attr_reader :description + # The quantity of the line item. + sig { returns(Integer) } + attr_reader :quantity + end + # 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). + sig { returns(String) } + attr_reader :currency + # List of line items in the cart. + sig { returns(T::Array[LineItem]) } + attr_reader :line_items + # Tax amount for the entire cart. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(T.nilable(Integer)) } + attr_reader :tax + # Total amount for the entire cart, including tax. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). + sig { returns(Integer) } + attr_reader :total + end + # Cart object to be displayed by the reader. + sig { returns(T.nilable(Cart)) } + attr_reader :cart + # Type of information to be displayed by the reader. + sig { returns(String) } + attr_reader :type + end + # Represents a reader action to collect customer inputs + sig { returns(CollectInputs) } + attr_reader :collect_inputs + # Represents a reader action to collect a payment method + sig { returns(CollectPaymentMethod) } + attr_reader :collect_payment_method + # Represents a reader action to confirm a payment + sig { returns(ConfirmPaymentIntent) } + attr_reader :confirm_payment_intent + # Failure code, only set if status is `failed`. + sig { returns(T.nilable(String)) } + attr_reader :failure_code + # Detailed failure message, only set if status is `failed`. + sig { returns(T.nilable(String)) } + attr_reader :failure_message + # Represents a reader action to process a payment intent + sig { returns(ProcessPaymentIntent) } + attr_reader :process_payment_intent + # Represents a reader action to process a setup intent + sig { returns(ProcessSetupIntent) } + attr_reader :process_setup_intent + # Represents a reader action to refund a payment + sig { returns(RefundPayment) } + attr_reader :refund_payment + # Represents a reader action to set the reader display + sig { returns(SetReaderDisplay) } + attr_reader :set_reader_display + # Status of the action performed by the reader. + sig { returns(String) } + attr_reader :status + # Type of action performed by the reader. + sig { returns(String) } + attr_reader :type + end + # The most recent action performed by the reader. + sig { returns(T.nilable(Action)) } + attr_reader :action + + # The current software version of the reader. + sig { returns(T.nilable(String)) } + attr_reader :device_sw_version + + # Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `stripe_s700`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. + sig { returns(String) } + attr_reader :device_type + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The local IP address of the reader. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + + # Custom label given to the reader for easier identification. + sig { returns(String) } + attr_reader :label + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The location identifier of the reader. + sig { returns(T.nilable(T.any(String, Stripe::Terminal::Location))) } + attr_reader :location + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Serial number of the reader. + sig { returns(String) } + attr_reader :serial_number + + # The networking status of the reader. We do not recommend using this field in flows that may block taking payments. + sig { returns(T.nilable(String)) } + attr_reader :status + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/terminal/reader_collected_data.rbi b/rbi/stripe/resources/terminal/reader_collected_data.rbi new file mode 100644 index 000000000..fed8d0de3 --- /dev/null +++ b/rbi/stripe/resources/terminal/reader_collected_data.rbi @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Terminal + # Returns data collected by Terminal readers. This data is only stored for 24 hours. + class ReaderCollectedData < APIResource + class Magstripe < Stripe::StripeObject + # The raw magstripe data collected by the reader. + sig { returns(T.nilable(String)) } + attr_reader :data + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The magstripe data collected by the reader. + sig { returns(T.nilable(Magstripe)) } + attr_reader :magstripe + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The type of data collected by the reader. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/test_helpers/test_clock.rbi b/rbi/stripe/resources/test_helpers/test_clock.rbi new file mode 100644 index 000000000..0d33ce0cf --- /dev/null +++ b/rbi/stripe/resources/test_helpers/test_clock.rbi @@ -0,0 +1,62 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module TestHelpers + # A test clock enables deterministic control over objects in testmode. With a test clock, you can create + # objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, + # you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. + class TestClock < APIResource + class StatusDetails < Stripe::StripeObject + class Advancing < Stripe::StripeObject + # The `frozen_time` that the Test Clock is advancing towards. + sig { returns(Integer) } + attr_reader :target_frozen_time + end + # Attribute for field advancing + sig { returns(Advancing) } + attr_reader :advancing + end + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Time at which this clock is scheduled to auto delete. + sig { returns(Integer) } + attr_reader :deletes_after + + # Time at which all objects belonging to this clock are frozen. + sig { returns(Integer) } + attr_reader :frozen_time + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The custom name supplied at creation. + sig { returns(T.nilable(String)) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The status of the Test Clock. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_details + sig { returns(StatusDetails) } + attr_reader :status_details + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/token.rbi b/rbi/stripe/resources/token.rbi new file mode 100644 index 000000000..837f55af7 --- /dev/null +++ b/rbi/stripe/resources/token.rbi @@ -0,0 +1,73 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Tokenization is the process Stripe uses to collect sensitive card or bank + # account details, or personally identifiable information (PII), directly from + # your customers in a secure manner. A token representing this information is + # returned to your server to use. Use our + # [recommended payments integrations](https://stripe.com/docs/payments) to perform this process + # on the client-side. This guarantees that no sensitive card data touches your server, + # and allows your integration to operate in a PCI-compliant way. + # + # If you can't use client-side tokenization, you can also create tokens using + # the API with either your publishable or secret API key. If + # your integration uses this method, you're responsible for any PCI compliance + # that it might require, and you must keep your secret API key safe. Unlike with + # client-side tokenization, your customer's information isn't sent directly to + # Stripe, so we can't determine how it's handled or stored. + # + # You can't store or use tokens more than once. To store card or bank account + # information for later use, create [Customer](https://stripe.com/docs/api#customers) + # objects or [External accounts](https://stripe.com/api#external_accounts). + # [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, + # performs best with integrations that use client-side tokenization. + class Token < APIResource + # These bank accounts are payment methods on `Customer` objects. + # + # On the other hand [External Accounts](/api#external_accounts) are transfer + # destinations on `Account` objects for connected accounts. + # They can be bank accounts or debit cards as well, and are documented in the links above. + # + # Related guide: [Bank debits and transfers](/payments/bank-debits-transfers) + sig { returns(Stripe::BankAccount) } + attr_reader :bank_account + + # You can store multiple cards on a customer in order to charge the customer + # later. You can also store multiple debit cards on a recipient in order to + # transfer to those cards later. + # + # Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) + sig { returns(Stripe::Card) } + attr_reader :card + + # IP address of the client that generates the token. + sig { returns(T.nilable(String)) } + attr_reader :client_ip + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Type of the token: `account`, `bank_account`, `card`, or `pii`. + sig { returns(String) } + attr_reader :type + + # Determines if you have already used this token (you can only use tokens once). + sig { returns(T::Boolean) } + attr_reader :used + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/topup.rbi b/rbi/stripe/resources/topup.rbi new file mode 100644 index 000000000..1b2a2b76f --- /dev/null +++ b/rbi/stripe/resources/topup.rbi @@ -0,0 +1,76 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # To top up your Stripe balance, you create a top-up object. You can retrieve + # individual top-ups, as well as list all top-ups. Top-ups are identified by a + # unique, random ID. + # + # Related guide: [Topping up your platform account](https://stripe.com/docs/connect/top-ups) + class Topup < APIResource + # Amount transferred. + sig { returns(Integer) } + attr_reader :amount + + # ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. + sig { returns(T.nilable(Integer)) } + attr_reader :expected_availability_date + + # Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). + sig { returns(T.nilable(String)) } + attr_reader :failure_code + + # Message to user further explaining reason for top-up failure if available. + sig { returns(T.nilable(String)) } + attr_reader :failure_message + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The source field is deprecated. It might not always be present in the API response. + sig { returns(T.nilable(Stripe::Source)) } + attr_reader :source + + # Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. + sig { returns(T.nilable(String)) } + attr_reader :statement_descriptor + + # The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. + sig { returns(String) } + attr_reader :status + + # A string that identifies this top-up as part of a group. + sig { returns(T.nilable(String)) } + attr_reader :transfer_group + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/transfer.rbi b/rbi/stripe/resources/transfer.rbi new file mode 100644 index 000000000..6f8b53315 --- /dev/null +++ b/rbi/stripe/resources/transfer.rbi @@ -0,0 +1,85 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A `Transfer` object is created when you move funds between Stripe accounts as + # part of Connect. + # + # Before April 6, 2017, transfers also represented movement of funds from a + # Stripe account to a card or bank account. This behavior has since been split + # out into a [Payout](https://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more + # information, read about the + # [transfer/payout split](https://stripe.com/docs/transfer-payout-split). + # + # Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) + class Transfer < APIResource + # Amount in cents (or local equivalent) to be transferred. + sig { returns(Integer) } + attr_reader :amount + + # Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + sig { returns(Integer) } + attr_reader :amount_reversed + + # Balance transaction that describes the impact of this transfer on your account balance. + sig { returns(T.nilable(T.any(String, Stripe::BalanceTransaction))) } + attr_reader :balance_transaction + + # Time that this record of the transfer was first created. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # ID of the Stripe account the transfer was sent to. + sig { returns(T.nilable(T.any(String, Stripe::Account))) } + attr_reader :destination + + # If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + sig { returns(T.any(String, Stripe::Charge)) } + attr_reader :destination_payment + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # A list of reversals that have been applied to the transfer. + sig { returns(Stripe::ListObject) } + attr_reader :reversals + + # Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. + sig { returns(T::Boolean) } + attr_reader :reversed + + # ID of the charge that was used to fund the transfer. If null, the transfer was funded from the available balance. + sig { returns(T.nilable(T.any(String, Stripe::Charge))) } + attr_reader :source_transaction + + # The source balance this transfer came from. One of `card`, `fpx`, or `bank_account`. + sig { returns(String) } + attr_reader :source_type + + # A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. + sig { returns(T.nilable(String)) } + attr_reader :transfer_group + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/credit_reversal.rbi b/rbi/stripe/resources/treasury/credit_reversal.rbi new file mode 100644 index 000000000..896520e7d --- /dev/null +++ b/rbi/stripe/resources/treasury/credit_reversal.rbi @@ -0,0 +1,71 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + class CreditReversal < APIResource + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when the CreditReversal changed status to `posted` + sig { returns(T.nilable(Integer)) } + attr_reader :posted_at + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # The FinancialAccount to reverse funds from. + sig { returns(String) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The rails used to reverse the funds. + sig { returns(String) } + attr_reader :network + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ReceivedCredit being reversed. + sig { returns(String) } + attr_reader :received_credit + + # Status of the CreditReversal + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # The Transaction associated with this object. + sig { returns(T.nilable(T.any(String, Stripe::Treasury::Transaction))) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/debit_reversal.rbi b/rbi/stripe/resources/treasury/debit_reversal.rbi new file mode 100644 index 000000000..53877a75a --- /dev/null +++ b/rbi/stripe/resources/treasury/debit_reversal.rbi @@ -0,0 +1,80 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + class DebitReversal < APIResource + class LinkedFlows < Stripe::StripeObject + # Set if there is an Issuing dispute associated with the DebitReversal. + sig { returns(T.nilable(String)) } + attr_reader :issuing_dispute + end + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when the DebitReversal changed status to `completed`. + sig { returns(T.nilable(Integer)) } + attr_reader :completed_at + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # The FinancialAccount to reverse funds from. + sig { returns(T.nilable(String)) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Other flows linked to a DebitReversal. + sig { returns(T.nilable(LinkedFlows)) } + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # The rails used to reverse the funds. + sig { returns(String) } + attr_reader :network + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The ReceivedDebit being reversed. + sig { returns(String) } + attr_reader :received_debit + + # Status of the DebitReversal + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # The Transaction associated with this object. + sig { returns(T.nilable(T.any(String, Stripe::Treasury::Transaction))) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/financial_account.rbi b/rbi/stripe/resources/treasury/financial_account.rbi new file mode 100644 index 000000000..377c17f2d --- /dev/null +++ b/rbi/stripe/resources/treasury/financial_account.rbi @@ -0,0 +1,137 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. + # FinancialAccounts serve as the source and destination of Treasury's money movement APIs. + class FinancialAccount < APIResource + class Balance < Stripe::StripeObject + # Funds the user can spend right now. + sig { returns(T::Hash[String, Integer]) } + attr_reader :cash + # Funds not spendable yet, but will become available at a later time. + sig { returns(T::Hash[String, Integer]) } + attr_reader :inbound_pending + # Funds in the account, but not spendable because they are being held for pending outbound flows. + sig { returns(T::Hash[String, Integer]) } + attr_reader :outbound_pending + end + class FinancialAddress < Stripe::StripeObject + class Aba < Stripe::StripeObject + # The name of the person or business that owns the bank account. + sig { returns(String) } + attr_reader :account_holder_name + # The account number. + sig { returns(T.nilable(String)) } + attr_reader :account_number + # The last four characters of the account number. + sig { returns(String) } + attr_reader :account_number_last4 + # Name of the bank. + sig { returns(String) } + attr_reader :bank_name + # Routing number for the account. + sig { returns(String) } + attr_reader :routing_number + end + # ABA Records contain U.S. bank account details per the ABA format. + sig { returns(Aba) } + attr_reader :aba + # The list of networks that the address supports + sig { returns(T::Array[String]) } + attr_reader :supported_networks + # The type of financial address + sig { returns(String) } + attr_reader :type + end + class PlatformRestrictions < Stripe::StripeObject + # Restricts all inbound money movement. + sig { returns(T.nilable(String)) } + attr_reader :inbound_flows + # Restricts all outbound money movement. + sig { returns(T.nilable(String)) } + attr_reader :outbound_flows + end + class StatusDetails < Stripe::StripeObject + class Closed < Stripe::StripeObject + # The array that contains reasons for a FinancialAccount closure. + sig { returns(T::Array[String]) } + attr_reader :reasons + end + # Details related to the closure of this FinancialAccount + sig { returns(T.nilable(Closed)) } + attr_reader :closed + end + # The array of paths to active Features in the Features hash. + sig { returns(T::Array[String]) } + attr_reader :active_features + + # Balance information for the FinancialAccount + sig { returns(Balance) } + attr_reader :balance + + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(String) } + attr_reader :country + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # The display name for the FinancialAccount. Use this field to customize the names of the FinancialAccounts for your connected accounts. Unlike the `nickname` field, `display_name` is not internal metadata and will be exposed to connected accounts. + sig { returns(T.nilable(String)) } + attr_reader :display_name + + # Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. + # Stripe or the platform can control Features via the requested field. + sig { returns(Stripe::Treasury::FinancialAccountFeatures) } + attr_reader :features + + # The set of credentials that resolve to a FinancialAccount. + sig { returns(T::Array[FinancialAddress]) } + attr_reader :financial_addresses + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The array of paths to pending Features in the Features hash. + sig { returns(T::Array[String]) } + attr_reader :pending_features + + # The set of functionalities that the platform can restrict on the FinancialAccount. + sig { returns(T.nilable(PlatformRestrictions)) } + attr_reader :platform_restrictions + + # The array of paths to restricted Features in the Features hash. + sig { returns(T::Array[String]) } + attr_reader :restricted_features + + # Status of this FinancialAccount. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_details + sig { returns(StatusDetails) } + attr_reader :status_details + + # The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. + sig { returns(T::Array[String]) } + attr_reader :supported_currencies + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/financial_account_features.rbi b/rbi/stripe/resources/treasury/financial_account_features.rbi new file mode 100644 index 000000000..963f94413 --- /dev/null +++ b/rbi/stripe/resources/treasury/financial_account_features.rbi @@ -0,0 +1,270 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. + # Stripe or the platform can control Features via the requested field. + class FinancialAccountFeatures < APIResource + class CardIssuing < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + class DepositInsurance < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + class FinancialAddresses < Stripe::StripeObject + class Aba < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Requested bank partner for this Financial Account + sig { returns(String) } + attr_reader :bank + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + # Toggle settings for enabling/disabling the ABA address feature + sig { returns(Aba) } + attr_reader :aba + end + class InboundTransfers < Stripe::StripeObject + class Ach < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + # Toggle settings for enabling/disabling an ACH specific feature + sig { returns(Ach) } + attr_reader :ach + end + class IntraStripeFlows < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + class OutboundPayments < Stripe::StripeObject + class Ach < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + class UsDomesticWire < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + # Toggle settings for enabling/disabling an ACH specific feature + sig { returns(Ach) } + attr_reader :ach + # Toggle settings for enabling/disabling a feature + sig { returns(UsDomesticWire) } + attr_reader :us_domestic_wire + end + class OutboundTransfers < Stripe::StripeObject + class Ach < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + class UsDomesticWire < Stripe::StripeObject + class StatusDetail < Stripe::StripeObject + # Represents the reason why the status is `pending` or `restricted`. + sig { returns(String) } + attr_reader :code + # Represents what the user should do, if anything, to activate the Feature. + sig { returns(T.nilable(String)) } + attr_reader :resolution + # The `platform_restrictions` that are restricting this Feature. + sig { returns(String) } + attr_reader :restriction + end + # Whether the FinancialAccount should have the Feature. + sig { returns(T::Boolean) } + attr_reader :requested + # Whether the Feature is operational. + sig { returns(String) } + attr_reader :status + # Additional details; includes at least one entry when the status is not `active`. + sig { returns(T::Array[StatusDetail]) } + attr_reader :status_details + end + # Toggle settings for enabling/disabling an ACH specific feature + sig { returns(Ach) } + attr_reader :ach + # Toggle settings for enabling/disabling a feature + sig { returns(UsDomesticWire) } + attr_reader :us_domestic_wire + end + # Toggle settings for enabling/disabling a feature + sig { returns(CardIssuing) } + attr_reader :card_issuing + + # Toggle settings for enabling/disabling a feature + sig { returns(DepositInsurance) } + attr_reader :deposit_insurance + + # Settings related to Financial Addresses features on a Financial Account + sig { returns(FinancialAddresses) } + attr_reader :financial_addresses + + # InboundTransfers contains inbound transfers features for a FinancialAccount. + sig { returns(InboundTransfers) } + attr_reader :inbound_transfers + + # Toggle settings for enabling/disabling a feature + sig { returns(IntraStripeFlows) } + attr_reader :intra_stripe_flows + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Settings related to Outbound Payments features on a Financial Account + sig { returns(OutboundPayments) } + attr_reader :outbound_payments + + # OutboundTransfers contains outbound transfers features for a FinancialAccount. + sig { returns(OutboundTransfers) } + attr_reader :outbound_transfers + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/inbound_transfer.rbi b/rbi/stripe/resources/treasury/inbound_transfer.rbi new file mode 100644 index 000000000..2604cb156 --- /dev/null +++ b/rbi/stripe/resources/treasury/inbound_transfer.rbi @@ -0,0 +1,181 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + # + # Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) + class InboundTransfer < APIResource + class FailureDetails < Stripe::StripeObject + # Reason for the failure. + sig { returns(String) } + attr_reader :code + end + class LinkedFlows < Stripe::StripeObject + # If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. + sig { returns(T.nilable(String)) } + attr_reader :received_debit + end + class OriginPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + end + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(T.any(String, Stripe::Mandate)) } + attr_reader :mandate + # The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. + sig { returns(String) } + attr_reader :network + # Routing number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + # The type of the payment method used in the InboundTransfer. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when an InboundTransfer changed status to `canceled`. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # Timestamp describing when an InboundTransfer changed status to `failed`. + sig { returns(T.nilable(Integer)) } + attr_reader :failed_at + # Timestamp describing when an InboundTransfer changed status to `succeeded`. + sig { returns(T.nilable(Integer)) } + attr_reader :succeeded_at + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Returns `true` if the InboundTransfer is able to be canceled. + sig { returns(T::Boolean) } + attr_reader :cancelable + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # Details about this InboundTransfer's failure. Only set when status is `failed`. + sig { returns(T.nilable(FailureDetails)) } + attr_reader :failure_details + + # The FinancialAccount that received the funds. + sig { returns(String) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field linked_flows + sig { returns(LinkedFlows) } + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The origin payment method to be debited for an InboundTransfer. + sig { returns(T.nilable(String)) } + attr_reader :origin_payment_method + + # Details about the PaymentMethod for an InboundTransfer. + sig { returns(T.nilable(OriginPaymentMethodDetails)) } + attr_reader :origin_payment_method_details + + # Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. + sig { returns(T.nilable(T::Boolean)) } + attr_reader :returned + + # Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`. + sig { returns(String) } + attr_reader :statement_descriptor + + # Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # The Transaction associated with this object. + sig { returns(T.nilable(T.any(String, Stripe::Treasury::Transaction))) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/outbound_payment.rbi b/rbi/stripe/resources/treasury/outbound_payment.rbi new file mode 100644 index 000000000..464f24e57 --- /dev/null +++ b/rbi/stripe/resources/treasury/outbound_payment.rbi @@ -0,0 +1,238 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + class OutboundPayment < APIResource + class DestinationPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + end + class FinancialAccount < Stripe::StripeObject + # Token of the FinancialAccount. + sig { returns(String) } + attr_reader :id + # The rails used to send funds. + sig { returns(String) } + attr_reader :network + end + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(T.any(String, Stripe::Mandate)) } + attr_reader :mandate + # The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. + sig { returns(String) } + attr_reader :network + # Routing number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + # Attribute for field financial_account + sig { returns(FinancialAccount) } + attr_reader :financial_account + # The type of the payment method used in the OutboundPayment. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class EndUserDetails < Stripe::StripeObject + # IP address of the user initiating the OutboundPayment. Set if `present` is set to `true`. IP address collection is required for risk and compliance reasons. This will be used to help determine if the OutboundPayment is authorized or should be blocked. + sig { returns(T.nilable(String)) } + attr_reader :ip_address + # `true` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. + sig { returns(T::Boolean) } + attr_reader :present + end + class ReturnedDetails < Stripe::StripeObject + # Reason for the return. + sig { returns(String) } + attr_reader :code + # The Transaction associated with this object. + sig { returns(T.any(String, Stripe::Treasury::Transaction)) } + attr_reader :transaction + end + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when an OutboundPayment changed status to `canceled`. + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # Timestamp describing when an OutboundPayment changed status to `failed`. + sig { returns(T.nilable(Integer)) } + attr_reader :failed_at + # Timestamp describing when an OutboundPayment changed status to `posted`. + sig { returns(T.nilable(Integer)) } + attr_reader :posted_at + # Timestamp describing when an OutboundPayment changed status to `returned`. + sig { returns(T.nilable(Integer)) } + attr_reader :returned_at + end + class TrackingDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH trace ID of the OutboundPayment for payments sent over the `ach` network. + sig { returns(String) } + attr_reader :trace_id + end + class UsDomesticWire < Stripe::StripeObject + # CHIPS System Sequence Number (SSN) of the OutboundPayment for payments sent over the `us_domestic_wire` network. + sig { returns(T.nilable(String)) } + attr_reader :chips + # IMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + sig { returns(T.nilable(String)) } + attr_reader :imad + # OMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. + sig { returns(T.nilable(String)) } + attr_reader :omad + end + # Attribute for field ach + sig { returns(Ach) } + attr_reader :ach + # The US bank account network used to send funds. + sig { returns(String) } + attr_reader :type + # Attribute for field us_domestic_wire + sig { returns(UsDomesticWire) } + attr_reader :us_domestic_wire + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Returns `true` if the object can be canceled, and `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :cancelable + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. + sig { returns(T.nilable(String)) } + attr_reader :customer + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. + sig { returns(T.nilable(String)) } + attr_reader :destination_payment_method + + # Details about the PaymentMethod for an OutboundPayment. + sig { returns(T.nilable(DestinationPaymentMethodDetails)) } + attr_reader :destination_payment_method_details + + # Details about the end user. + sig { returns(T.nilable(EndUserDetails)) } + attr_reader :end_user_details + + # The date when funds are expected to arrive in the destination account. + sig { returns(Integer) } + attr_reader :expected_arrival_date + + # The FinancialAccount that funds were pulled from. + sig { returns(String) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Details about a returned OutboundPayment. Only set when the status is `returned`. + sig { returns(T.nilable(ReturnedDetails)) } + attr_reader :returned_details + + # The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). + sig { returns(String) } + attr_reader :statement_descriptor + + # Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. An OutboundPayment is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # Details about network-specific tracking information if available. + sig { returns(T.nilable(TrackingDetails)) } + attr_reader :tracking_details + + # The Transaction associated with this object. + sig { returns(T.any(String, Stripe::Treasury::Transaction)) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/outbound_transfer.rbi b/rbi/stripe/resources/treasury/outbound_transfer.rbi new file mode 100644 index 000000000..f601a02b1 --- /dev/null +++ b/rbi/stripe/resources/treasury/outbound_transfer.rbi @@ -0,0 +1,228 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + # + # Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + class OutboundTransfer < APIResource + class DestinationPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + end + class UsBankAccount < Stripe::StripeObject + # Account holder type: individual or company. + sig { returns(T.nilable(String)) } + attr_reader :account_holder_type + # Account type: checkings or savings. Defaults to checking if omitted. + sig { returns(T.nilable(String)) } + attr_reader :account_type + # Name of the bank associated with the bank account. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + sig { returns(T.nilable(String)) } + attr_reader :fingerprint + # Last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # ID of the mandate used to make this payment. + sig { returns(T.any(String, Stripe::Mandate)) } + attr_reader :mandate + # The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. + sig { returns(String) } + attr_reader :network + # Routing number of the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + # The type of the payment method used in the OutboundTransfer. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class NetworkDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH Addenda record + sig { returns(T.nilable(String)) } + attr_reader :addenda + end + # Details about an ACH transaction. + sig { returns(T.nilable(Ach)) } + attr_reader :ach + # The type of flow that originated the OutboundTransfer. + sig { returns(String) } + attr_reader :type + end + class ReturnedDetails < Stripe::StripeObject + # Reason for the return. + sig { returns(String) } + attr_reader :code + # The Transaction associated with this object. + sig { returns(T.any(String, Stripe::Treasury::Transaction)) } + attr_reader :transaction + end + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when an OutboundTransfer changed status to `canceled` + sig { returns(T.nilable(Integer)) } + attr_reader :canceled_at + # Timestamp describing when an OutboundTransfer changed status to `failed` + sig { returns(T.nilable(Integer)) } + attr_reader :failed_at + # Timestamp describing when an OutboundTransfer changed status to `posted` + sig { returns(T.nilable(Integer)) } + attr_reader :posted_at + # Timestamp describing when an OutboundTransfer changed status to `returned` + sig { returns(T.nilable(Integer)) } + attr_reader :returned_at + end + class TrackingDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH trace ID of the OutboundTransfer for transfers sent over the `ach` network. + sig { returns(String) } + attr_reader :trace_id + end + class UsDomesticWire < Stripe::StripeObject + # CHIPS System Sequence Number (SSN) of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + sig { returns(T.nilable(String)) } + attr_reader :chips + # IMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + sig { returns(T.nilable(String)) } + attr_reader :imad + # OMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. + sig { returns(T.nilable(String)) } + attr_reader :omad + end + # Attribute for field ach + sig { returns(Ach) } + attr_reader :ach + # The US bank account network used to send funds. + sig { returns(String) } + attr_reader :type + # Attribute for field us_domestic_wire + sig { returns(UsDomesticWire) } + attr_reader :us_domestic_wire + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Returns `true` if the object can be canceled, and `false` otherwise. + sig { returns(T::Boolean) } + attr_reader :cancelable + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The PaymentMethod used as the payment instrument for an OutboundTransfer. + sig { returns(T.nilable(String)) } + attr_reader :destination_payment_method + + # Attribute for field destination_payment_method_details + sig { returns(DestinationPaymentMethodDetails) } + attr_reader :destination_payment_method_details + + # The date when funds are expected to arrive in the destination account. + sig { returns(Integer) } + attr_reader :expected_arrival_date + + # The FinancialAccount that funds were pulled from. + sig { returns(String) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # Details about the network used for the OutboundTransfer. + sig { returns(T.nilable(NetworkDetails)) } + attr_reader :network_details + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Details about a returned OutboundTransfer. Only set when the status is `returned`. + sig { returns(T.nilable(ReturnedDetails)) } + attr_reader :returned_details + + # Information about the OutboundTransfer to be sent to the recipient account. + sig { returns(String) } + attr_reader :statement_descriptor + + # Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + + # Details about network-specific tracking information if available. + sig { returns(T.nilable(TrackingDetails)) } + attr_reader :tracking_details + + # The Transaction associated with this object. + sig { returns(T.any(String, Stripe::Treasury::Transaction)) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/received_credit.rbi b/rbi/stripe/resources/treasury/received_credit.rbi new file mode 100644 index 000000000..3ec511d14 --- /dev/null +++ b/rbi/stripe/resources/treasury/received_credit.rbi @@ -0,0 +1,214 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + class ReceivedCredit < APIResource + class InitiatingPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + end + class FinancialAccount < Stripe::StripeObject + # The FinancialAccount ID. + sig { returns(String) } + attr_reader :id + # The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + sig { returns(String) } + attr_reader :network + end + class UsBankAccount < Stripe::StripeObject + # Bank name. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # The last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # The routing number for the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + # Set when `type` is `balance`. + sig { returns(String) } + attr_reader :balance + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + # Attribute for field financial_account + sig { returns(FinancialAccount) } + attr_reader :financial_account + # Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + sig { returns(String) } + attr_reader :issuing_card + # Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class LinkedFlows < Stripe::StripeObject + class SourceFlowDetails < Stripe::StripeObject + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + sig { returns(Stripe::Treasury::CreditReversal) } + attr_reader :credit_reversal + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + sig { returns(Stripe::Treasury::OutboundPayment) } + attr_reader :outbound_payment + # A `Payout` object is created when you receive funds from Stripe, or when you + # initiate a payout to either a bank account or debit card of a [connected + # Stripe account](/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, + # and list all payouts. Payouts are made on [varying + # schedules](/docs/connect/manage-payout-schedule), depending on your country and + # industry. + # + # Related guide: [Receiving payouts](https://stripe.com/docs/payouts) + sig { returns(Stripe::Payout) } + attr_reader :payout + # The type of the source flow that originated the ReceivedCredit. + sig { returns(String) } + attr_reader :type + end + # The CreditReversal created as a result of this ReceivedCredit being reversed. + sig { returns(T.nilable(String)) } + attr_reader :credit_reversal + # Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + sig { returns(T.nilable(String)) } + attr_reader :issuing_authorization + # Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. + sig { returns(T.nilable(String)) } + attr_reader :issuing_transaction + # ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the user. Examples of source flows include OutboundPayments, payouts, or CreditReversals. + sig { returns(T.nilable(String)) } + attr_reader :source_flow + # The expandable object of the source flow. + sig { returns(T.nilable(SourceFlowDetails)) } + attr_reader :source_flow_details + # The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). + sig { returns(T.nilable(String)) } + attr_reader :source_flow_type + end + class NetworkDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH Addenda record + sig { returns(T.nilable(String)) } + attr_reader :addenda + end + # Details about an ACH transaction. + sig { returns(T.nilable(Ach)) } + attr_reader :ach + # The type of flow that originated the ReceivedCredit. + sig { returns(String) } + attr_reader :type + end + class ReversalDetails < Stripe::StripeObject + # Time before which a ReceivedCredit can be reversed. + sig { returns(T.nilable(Integer)) } + attr_reader :deadline + # Set if a ReceivedCredit cannot be reversed. + sig { returns(T.nilable(String)) } + attr_reader :restricted_reason + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(String) } + attr_reader :description + + # Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. + sig { returns(T.nilable(String)) } + attr_reader :failure_code + + # The FinancialAccount that received the funds. + sig { returns(T.nilable(String)) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field initiating_payment_method_details + sig { returns(InitiatingPaymentMethodDetails) } + attr_reader :initiating_payment_method_details + + # Attribute for field linked_flows + sig { returns(LinkedFlows) } + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The rails used to send the funds. + sig { returns(String) } + attr_reader :network + + # Details specific to the money movement rails. + sig { returns(T.nilable(NetworkDetails)) } + attr_reader :network_details + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Details describing when a ReceivedCredit may be reversed. + sig { returns(T.nilable(ReversalDetails)) } + attr_reader :reversal_details + + # Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. + sig { returns(String) } + attr_reader :status + + # The Transaction associated with this object. + sig { returns(T.nilable(T.any(String, Stripe::Treasury::Transaction))) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/received_debit.rbi b/rbi/stripe/resources/treasury/received_debit.rbi new file mode 100644 index 000000000..eff9d4935 --- /dev/null +++ b/rbi/stripe/resources/treasury/received_debit.rbi @@ -0,0 +1,189 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + class ReceivedDebit < APIResource + class InitiatingPaymentMethodDetails < Stripe::StripeObject + class BillingDetails < Stripe::StripeObject + class Address < Stripe::StripeObject + # City, district, suburb, town, or village. + sig { returns(T.nilable(String)) } + attr_reader :city + # Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). + sig { returns(T.nilable(String)) } + attr_reader :country + # Address line 1 (e.g., street, PO Box, or company name). + sig { returns(T.nilable(String)) } + attr_reader :line1 + # Address line 2 (e.g., apartment, suite, unit, or building). + sig { returns(T.nilable(String)) } + attr_reader :line2 + # ZIP or postal code. + sig { returns(T.nilable(String)) } + attr_reader :postal_code + # State, county, province, or region. + sig { returns(T.nilable(String)) } + attr_reader :state + end + # Attribute for field address + sig { returns(Address) } + attr_reader :address + # Email address. + sig { returns(T.nilable(String)) } + attr_reader :email + # Full name. + sig { returns(T.nilable(String)) } + attr_reader :name + end + class FinancialAccount < Stripe::StripeObject + # The FinancialAccount ID. + sig { returns(String) } + attr_reader :id + # The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. + sig { returns(String) } + attr_reader :network + end + class UsBankAccount < Stripe::StripeObject + # Bank name. + sig { returns(T.nilable(String)) } + attr_reader :bank_name + # The last four digits of the bank account number. + sig { returns(T.nilable(String)) } + attr_reader :last4 + # The routing number for the bank account. + sig { returns(T.nilable(String)) } + attr_reader :routing_number + end + # Set when `type` is `balance`. + sig { returns(String) } + attr_reader :balance + # Attribute for field billing_details + sig { returns(BillingDetails) } + attr_reader :billing_details + # Attribute for field financial_account + sig { returns(FinancialAccount) } + attr_reader :financial_account + # Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. + sig { returns(String) } + attr_reader :issuing_card + # Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. + sig { returns(String) } + attr_reader :type + # Attribute for field us_bank_account + sig { returns(UsBankAccount) } + attr_reader :us_bank_account + end + class LinkedFlows < Stripe::StripeObject + # The DebitReversal created as a result of this ReceivedDebit being reversed. + sig { returns(T.nilable(String)) } + attr_reader :debit_reversal + # Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. + sig { returns(T.nilable(String)) } + attr_reader :inbound_transfer + # Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. + sig { returns(T.nilable(String)) } + attr_reader :issuing_authorization + # Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. + sig { returns(T.nilable(String)) } + attr_reader :issuing_transaction + # Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. + sig { returns(T.nilable(String)) } + attr_reader :payout + # The ReceivedCredit that Capital withheld from + sig { returns(T.nilable(String)) } + attr_reader :received_credit_capital_withholding + end + class NetworkDetails < Stripe::StripeObject + class Ach < Stripe::StripeObject + # ACH Addenda record + sig { returns(T.nilable(String)) } + attr_reader :addenda + end + # Details about an ACH transaction. + sig { returns(T.nilable(Ach)) } + attr_reader :ach + # The type of flow that originated the ReceivedDebit. + sig { returns(String) } + attr_reader :type + end + class ReversalDetails < Stripe::StripeObject + # Time before which a ReceivedDebit can be reversed. + sig { returns(T.nilable(Integer)) } + attr_reader :deadline + # Set if a ReceivedDebit can't be reversed. + sig { returns(T.nilable(String)) } + attr_reader :restricted_reason + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(String) } + attr_reader :description + + # Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. + sig { returns(T.nilable(String)) } + attr_reader :failure_code + + # The FinancialAccount that funds were pulled from. + sig { returns(T.nilable(String)) } + attr_reader :financial_account + + # A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. + sig { returns(T.nilable(String)) } + attr_reader :hosted_regulatory_receipt_url + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Attribute for field initiating_payment_method_details + sig { returns(InitiatingPaymentMethodDetails) } + attr_reader :initiating_payment_method_details + + # Attribute for field linked_flows + sig { returns(LinkedFlows) } + attr_reader :linked_flows + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # The network used for the ReceivedDebit. + sig { returns(String) } + attr_reader :network + + # Details specific to the money movement rails. + sig { returns(T.nilable(NetworkDetails)) } + attr_reader :network_details + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Details describing when a ReceivedDebit might be reversed. + sig { returns(T.nilable(ReversalDetails)) } + attr_reader :reversal_details + + # Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. + sig { returns(String) } + attr_reader :status + + # The Transaction associated with this object. + sig { returns(T.nilable(T.any(String, Stripe::Treasury::Transaction))) } + attr_reader :transaction + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/transaction.rbi b/rbi/stripe/resources/treasury/transaction.rbi new file mode 100644 index 000000000..25f487040 --- /dev/null +++ b/rbi/stripe/resources/treasury/transaction.rbi @@ -0,0 +1,132 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. + class Transaction < APIResource + class BalanceImpact < Stripe::StripeObject + # The change made to funds the user can spend right now. + sig { returns(Integer) } + attr_reader :cash + # The change made to funds that are not spendable yet, but will become available at a later time. + sig { returns(Integer) } + attr_reader :inbound_pending + # The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + sig { returns(Integer) } + attr_reader :outbound_pending + end + class FlowDetails < Stripe::StripeObject + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + sig { returns(Stripe::Treasury::CreditReversal) } + attr_reader :credit_reversal + # You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + sig { returns(Stripe::Treasury::DebitReversal) } + attr_reader :debit_reversal + # Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + # + # Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) + sig { returns(Stripe::Treasury::InboundTransfer) } + attr_reader :inbound_transfer + # When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + # object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + # purchase to be completed successfully. + # + # Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) + sig { returns(Stripe::Issuing::Authorization) } + attr_reader :issuing_authorization + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + sig { returns(Stripe::Treasury::OutboundPayment) } + attr_reader :outbound_payment + # Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + # + # Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + sig { returns(Stripe::Treasury::OutboundTransfer) } + attr_reader :outbound_transfer + # ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + sig { returns(Stripe::Treasury::ReceivedCredit) } + attr_reader :received_credit + # ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + sig { returns(Stripe::Treasury::ReceivedDebit) } + attr_reader :received_debit + # Type of the flow that created the Transaction. Set to the same value as `flow_type`. + sig { returns(String) } + attr_reader :type + end + class StatusTransitions < Stripe::StripeObject + # Timestamp describing when the Transaction changed status to `posted`. + sig { returns(T.nilable(Integer)) } + attr_reader :posted_at + # Timestamp describing when the Transaction changed status to `void`. + sig { returns(T.nilable(Integer)) } + attr_reader :void_at + end + # Amount (in cents) transferred. + sig { returns(Integer) } + attr_reader :amount + + # Change to a FinancialAccount's balance + sig { returns(BalanceImpact) } + attr_reader :balance_impact + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # An arbitrary string attached to the object. Often useful for displaying to users. + sig { returns(String) } + attr_reader :description + + # A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. + sig { returns(T.nilable(Stripe::ListObject)) } + attr_reader :entries + + # The FinancialAccount associated with this object. + sig { returns(String) } + attr_reader :financial_account + + # ID of the flow that created the Transaction. + sig { returns(T.nilable(String)) } + attr_reader :flow + + # Details of the flow that created the Transaction. + sig { returns(T.nilable(FlowDetails)) } + attr_reader :flow_details + + # Type of the flow that created the Transaction. + sig { returns(String) } + attr_reader :flow_type + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Status of the Transaction. + sig { returns(String) } + attr_reader :status + + # Attribute for field status_transitions + sig { returns(StatusTransitions) } + attr_reader :status_transitions + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/treasury/transaction_entry.rbi b/rbi/stripe/resources/treasury/transaction_entry.rbi new file mode 100644 index 000000000..2b9b495b0 --- /dev/null +++ b/rbi/stripe/resources/treasury/transaction_entry.rbi @@ -0,0 +1,116 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module Treasury + # TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). + class TransactionEntry < APIResource + class BalanceImpact < Stripe::StripeObject + # The change made to funds the user can spend right now. + sig { returns(Integer) } + attr_reader :cash + # The change made to funds that are not spendable yet, but will become available at a later time. + sig { returns(Integer) } + attr_reader :inbound_pending + # The change made to funds in the account, but not spendable because they are being held for pending outbound flows. + sig { returns(Integer) } + attr_reader :outbound_pending + end + class FlowDetails < Stripe::StripeObject + # You can reverse some [ReceivedCredits](https://stripe.com/docs/api#received_credits) depending on their network and source flow. Reversing a ReceivedCredit leads to the creation of a new object known as a CreditReversal. + sig { returns(Stripe::Treasury::CreditReversal) } + attr_reader :credit_reversal + # You can reverse some [ReceivedDebits](https://stripe.com/docs/api#received_debits) depending on their network and source flow. Reversing a ReceivedDebit leads to the creation of a new object known as a DebitReversal. + sig { returns(Stripe::Treasury::DebitReversal) } + attr_reader :debit_reversal + # Use [InboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. + # + # Related guide: [Moving money with Treasury using InboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) + sig { returns(Stripe::Treasury::InboundTransfer) } + attr_reader :inbound_transfer + # When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` + # object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the + # purchase to be completed successfully. + # + # Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) + sig { returns(Stripe::Issuing::Authorization) } + attr_reader :issuing_authorization + # Use [OutboundPayments](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/api#outbound_transfers). + # + # Simulate OutboundPayment state changes with the `/v1/test_helpers/treasury/outbound_payments` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundPayment objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-payments) + sig { returns(Stripe::Treasury::OutboundPayment) } + attr_reader :outbound_payment + # Use [OutboundTransfers](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. + # + # Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. + # + # Related guide: [Moving money with Treasury using OutboundTransfer objects](https://docs.stripe.com/docs/treasury/moving-money/financial-accounts/out-of/outbound-transfers) + sig { returns(Stripe::Treasury::OutboundTransfer) } + attr_reader :outbound_transfer + # ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) (for example, via ACH or wire). These money movements are not initiated from the FinancialAccount. + sig { returns(Stripe::Treasury::ReceivedCredit) } + attr_reader :received_credit + # ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. + sig { returns(Stripe::Treasury::ReceivedDebit) } + attr_reader :received_debit + # Type of the flow that created the Transaction. Set to the same value as `flow_type`. + sig { returns(String) } + attr_reader :type + end + # Change to a FinancialAccount's balance + sig { returns(BalanceImpact) } + attr_reader :balance_impact + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :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). + sig { returns(String) } + attr_reader :currency + + # When the TransactionEntry will impact the FinancialAccount's balance. + sig { returns(Integer) } + attr_reader :effective_at + + # The FinancialAccount associated with this object. + sig { returns(String) } + attr_reader :financial_account + + # Token of the flow associated with the TransactionEntry. + sig { returns(T.nilable(String)) } + attr_reader :flow + + # Details of the flow associated with the TransactionEntry. + sig { returns(T.nilable(FlowDetails)) } + attr_reader :flow_details + + # Type of the flow associated with the TransactionEntry. + sig { returns(String) } + attr_reader :flow_type + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The Transaction associated with this object. + sig { returns(T.any(String, Stripe::Treasury::Transaction)) } + attr_reader :transaction + + # The specific money movement that generated the TransactionEntry. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/usage_record.rbi b/rbi/stripe/resources/usage_record.rbi new file mode 100644 index 000000000..ebf73d749 --- /dev/null +++ b/rbi/stripe/resources/usage_record.rbi @@ -0,0 +1,37 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # Usage records allow you to report customer usage and metrics to Stripe for + # metered billing of subscription prices. + # + # Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) + # + # This is our legacy usage-based billing API. See the [updated usage-based billing docs](https://docs.stripe.com/billing/subscriptions/usage-based). + class UsageRecord < APIResource + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The usage quantity for the specified date. + sig { returns(Integer) } + attr_reader :quantity + + # The ID of the subscription item this usage record contains data for. + sig { returns(String) } + attr_reader :subscription_item + + # The timestamp when this usage occurred. + sig { returns(Integer) } + attr_reader :timestamp + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/usage_record_summary.rbi b/rbi/stripe/resources/usage_record_summary.rbi new file mode 100644 index 000000000..ae0d8c170 --- /dev/null +++ b/rbi/stripe/resources/usage_record_summary.rbi @@ -0,0 +1,44 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # A usage record summary represents an aggregated view of how much usage was accrued for a subscription item within a subscription billing period. + class UsageRecordSummary < StripeObject + class Period < Stripe::StripeObject + # The end date of this usage period. All usage up to and including this point in time is included. + sig { returns(T.nilable(Integer)) } + attr_reader :end + # The start date of this usage period. All usage after this point in time is included. + sig { returns(T.nilable(Integer)) } + attr_reader :start + end + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # The invoice in which this usage period has been billed for. + sig { returns(T.nilable(String)) } + attr_reader :invoice + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # Attribute for field period + sig { returns(Period) } + attr_reader :period + + # The ID of the subscription item this summary is describing. + sig { returns(String) } + attr_reader :subscription_item + + # The total usage within this usage period. + sig { returns(Integer) } + attr_reader :total_usage + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/v2/amount.rbi b/rbi/stripe/resources/v2/amount.rbi new file mode 100644 index 000000000..e9fe3dca9 --- /dev/null +++ b/rbi/stripe/resources/v2/amount.rbi @@ -0,0 +1,14 @@ +# frozen_string_literal: true +# typed: true + +module Stripe + module V2 + class Amount + sig { returns(Integer) } + attr_reader :value + + sig { returns(String) } + attr_reader :currency + end + end +end diff --git a/rbi/stripe/resources/v2/billing/meter_event.rbi b/rbi/stripe/resources/v2/billing/meter_event.rbi new file mode 100644 index 000000000..69665cb66 --- /dev/null +++ b/rbi/stripe/resources/v2/billing/meter_event.rbi @@ -0,0 +1,43 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module Billing + # Fix me empty_doc_string. + class MeterEvent < APIResource + # The creation time of this meter event. + sig { returns(String) } + attr_reader :created + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + sig { returns(String) } + attr_reader :event_name + + # A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We’ll enforce uniqueness within a rolling 24 hour period. + sig { returns(String) } + attr_reader :identifier + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + sig { returns(String) } + attr_reader :object + + # The payload of the event. This must contain the fields corresponding to a meter’s + # `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and + # `value_settings.event_payload_key` (default is `value`). Read more about the payload. + sig { returns(T::Hash[String, String]) } + attr_reader :payload + + # The time of the event. Must be within the past 35 calendar days or up to + # 5 minutes in the future. Defaults to current timestamp if not specified. + sig { returns(String) } + attr_reader :timestamp + end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi b/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi new file mode 100644 index 000000000..6701ef32a --- /dev/null +++ b/rbi/stripe/resources/v2/billing/meter_event_adjustment.rbi @@ -0,0 +1,48 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module Billing + class MeterEventAdjustment < APIResource + class Cancel < Stripe::StripeObject + # Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. + sig { returns(String) } + attr_reader :identifier + end + # Specifies which event to cancel. + sig { returns(Cancel) } + attr_reader :cancel + + # The time the adjustment was created. + sig { returns(String) } + attr_reader :created + + # The name of the meter event. Corresponds with the `event_name` field on a meter. + sig { returns(String) } + attr_reader :event_name + + # The unique id of this meter event adjustment. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + sig { returns(String) } + attr_reader :object + + # Open Enum. The meter event adjustment’s status. + sig { returns(String) } + attr_reader :status + + # Open Enum. Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. + sig { returns(String) } + attr_reader :type + end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/v2/billing/meter_event_session.rbi b/rbi/stripe/resources/v2/billing/meter_event_session.rbi new file mode 100644 index 000000000..c70d2a261 --- /dev/null +++ b/rbi/stripe/resources/v2/billing/meter_event_session.rbi @@ -0,0 +1,36 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + module Billing + class MeterEventSession < APIResource + # The authentication token for this session. Use this token when calling the + # high-throughput meter event API. + sig { returns(String) } + attr_reader :authentication_token + + # The creation time of this session. + sig { returns(String) } + attr_reader :created + + # The time at which this session will expire. + sig { returns(String) } + attr_reader :expires_at + + # The unique id of this auth session. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + sig { returns(String) } + attr_reader :object + end + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/v2/event.rbi b/rbi/stripe/resources/v2/event.rbi new file mode 100644 index 000000000..7cd77aba1 --- /dev/null +++ b/rbi/stripe/resources/v2/event.rbi @@ -0,0 +1,53 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + class Event < APIResource + class Reason < Stripe::StripeObject + class Request < Stripe::StripeObject + # ID of the API request that caused the event. + sig { returns(String) } + attr_reader :id + # The idempotency key transmitted during the request. + sig { returns(String) } + attr_reader :idempotency_key + end + # Event reason type. + sig { returns(String) } + attr_reader :type + # Information on the API request that instigated the event. + sig { returns(T.nilable(Request)) } + attr_reader :request + end + # Authentication context needed to fetch the event or related object. + sig { returns(T.nilable(String)) } + attr_reader :context + + # Time at which the object was created. + sig { returns(String) } + attr_reader :created + + # Unique identifier for the event. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # String representing the object's type. Objects of the same type share the same value of the object field. + sig { returns(String) } + attr_reader :object + + # Reason for the event. + sig { returns(T.nilable(Reason)) } + attr_reader :reason + + # The type of the event. + sig { returns(String) } + attr_reader :type + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/v2/event_destination.rbi b/rbi/stripe/resources/v2/event_destination.rbi new file mode 100644 index 000000000..5872889bf --- /dev/null +++ b/rbi/stripe/resources/v2/event_destination.rbi @@ -0,0 +1,106 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + module V2 + class EventDestination < APIResource + class StatusDetails < Stripe::StripeObject + class Disabled < Stripe::StripeObject + # Reason event destination has been disabled. + sig { returns(String) } + attr_reader :reason + end + # Details about why the event destination has been disabled. + sig { returns(T.nilable(Disabled)) } + attr_reader :disabled + end + class AmazonEventbridge < Stripe::StripeObject + # The AWS account ID. + sig { returns(String) } + attr_reader :aws_account_id + # The ARN of the AWS event source. + sig { returns(String) } + attr_reader :aws_event_source_arn + # The state of the AWS event source. + sig { returns(String) } + attr_reader :aws_event_source_status + end + class WebhookEndpoint < Stripe::StripeObject + # The signing secret of the webhook endpoint, only includable on creation. + sig { returns(T.nilable(String)) } + attr_reader :signing_secret + # The URL of the webhook endpoint, includable. + sig { returns(T.nilable(String)) } + attr_reader :url + end + # Time at which the object was created. + sig { returns(String) } + attr_reader :created + + # An optional description of what the event destination is used for. + sig { returns(String) } + attr_reader :description + + # The list of events to enable for this endpoint. + sig { returns(T::Array[String]) } + attr_reader :enabled_events + + # Payload type of events being subscribed to. + sig { returns(String) } + attr_reader :event_payload + + # Where events should be routed from. + sig { returns(T.nilable(T::Array[String])) } + attr_reader :events_from + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Metadata. + sig { returns(T.nilable(T::Hash[String, String])) } + attr_reader :metadata + + # Event destination name. + sig { returns(String) } + attr_reader :name + + # String representing the object's type. Objects of the same type share the same value of the object field. + sig { returns(String) } + attr_reader :object + + # If using the snapshot event payload, the API version events are rendered as. + sig { returns(T.nilable(String)) } + attr_reader :snapshot_api_version + + # Status. It can be set to either enabled or disabled. + sig { returns(String) } + attr_reader :status + + # Additional information about event destination status. + sig { returns(T.nilable(StatusDetails)) } + attr_reader :status_details + + # Event destination type. + sig { returns(String) } + attr_reader :type + + # Time at which the object was last updated. + sig { returns(String) } + attr_reader :updated + + # Amazon EventBridge configuration. + sig { returns(T.nilable(AmazonEventbridge)) } + attr_reader :amazon_eventbridge + + # Webhook endpoint configuration. + sig { returns(T.nilable(WebhookEndpoint)) } + attr_reader :webhook_endpoint + end + end +end \ No newline at end of file diff --git a/rbi/stripe/resources/webhook_endpoint.rbi b/rbi/stripe/resources/webhook_endpoint.rbi new file mode 100644 index 000000000..3894a599a --- /dev/null +++ b/rbi/stripe/resources/webhook_endpoint.rbi @@ -0,0 +1,66 @@ +# File generated from our OpenAPI spec +# frozen_string_literal: true + +# typed: true +module Stripe + # You can configure [webhook endpoints](https://docs.stripe.com/webhooks/) via the API to be + # notified about events that happen in your Stripe account or connected + # accounts. + # + # Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. + # + # Related guide: [Setting up webhooks](https://docs.stripe.com/webhooks/configure) + class WebhookEndpoint < APIResource + # The API version events are rendered as for this webhook endpoint. + sig { returns(T.nilable(String)) } + attr_reader :api_version + + # The ID of the associated Connect application. + sig { returns(T.nilable(String)) } + attr_reader :application + + # Time at which the object was created. Measured in seconds since the Unix epoch. + sig { returns(Integer) } + attr_reader :created + + # An optional description of what the webhook is used for. + sig { returns(T.nilable(String)) } + attr_reader :description + + # The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection. + sig { returns(T::Array[String]) } + attr_reader :enabled_events + + # Unique identifier for the object. + sig { returns(String) } + attr_reader :id + + # Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. + sig { returns(T::Boolean) } + attr_reader :livemode + + # Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + sig { returns(T::Hash[String, String]) } + attr_reader :metadata + + # String representing the object's type. Objects of the same type share the same value. + sig { returns(String) } + attr_reader :object + + # The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. + sig { returns(String) } + attr_reader :secret + + # The status of the webhook. It can be `enabled` or `disabled`. + sig { returns(String) } + attr_reader :status + + # The URL of the webhook endpoint. + sig { returns(String) } + attr_reader :url + + # Always true for a deleted object + sig { returns(T::Boolean) } + attr_reader :deleted + end +end \ No newline at end of file diff --git a/stripe.gemspec b/stripe.gemspec index 874c52484..f5d21eace 100644 --- a/stripe.gemspec +++ b/stripe.gemspec @@ -35,7 +35,8 @@ Gem::Specification.new do |s| /\A\.vscode/, /\Abin/, /\Asorbet/, - /\Atest/ + /\Atest/, + /\Arbi/ ) s.files = `git ls-files`.split("\n").grep_v(ignored) s.bindir = "exe"