├── .editorconfig ├── .gitattributes ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ ├── config.yml │ └── feature_request.yml ├── pull_request_template.md └── workflows │ ├── ci.yml │ └── rules.yml ├── .gitignore ├── .vscode ├── extensions.json └── settings.json ├── CHANGELOG ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Makefile ├── OPENAPI_VERSION ├── README.md ├── VERSION ├── build.gradle ├── deploy.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── justfile ├── lombok.config └── src ├── main └── java │ └── com │ └── stripe │ ├── ApiVersion.java │ ├── Stripe.java │ ├── StripeClient.java │ ├── events │ ├── V1BillingMeterErrorReportTriggeredEvent.java │ ├── V1BillingMeterNoMeterFoundEvent.java │ └── V2CoreEventDestinationPingEvent.java │ ├── examples │ ├── ExampleTemplate.java │ ├── MeterEventStream.java │ └── ThinEventWebhookHandler.java │ ├── exception │ ├── ApiConnectionException.java │ ├── ApiException.java │ ├── ApiKeyMissingException.java │ ├── AuthenticationException.java │ ├── CardException.java │ ├── EventDataObjectDeserializationException.java │ ├── IdempotencyException.java │ ├── InvalidRequestException.java │ ├── PermissionException.java │ ├── RateLimitException.java │ ├── SignatureVerificationException.java │ ├── StripeException.java │ ├── TemporarySessionExpiredException.java │ └── oauth │ │ ├── InvalidClientException.java │ │ ├── InvalidGrantException.java │ │ ├── InvalidRequestException.java │ │ ├── InvalidScopeException.java │ │ ├── OAuthException.java │ │ ├── UnsupportedGrantTypeException.java │ │ └── UnsupportedResponseTypeException.java │ ├── model │ ├── Account.java │ ├── AccountCollection.java │ ├── AccountLink.java │ ├── AccountSession.java │ ├── Address.java │ ├── ApplePayDomain.java │ ├── ApplePayDomainCollection.java │ ├── Application.java │ ├── ApplicationFee.java │ ├── ApplicationFeeCollection.java │ ├── Balance.java │ ├── BalanceTransaction.java │ ├── BalanceTransactionCollection.java │ ├── BalanceTransactionSource.java │ ├── BalanceTransactionSourceTypeAdapterFactory.java │ ├── BankAccount.java │ ├── Capability.java │ ├── CapabilityCollection.java │ ├── Card.java │ ├── CashBalance.java │ ├── Charge.java │ ├── ChargeCollection.java │ ├── ChargeSearchResult.java │ ├── ConfirmationToken.java │ ├── ConnectCollectionTransfer.java │ ├── CountrySpec.java │ ├── CountrySpecCollection.java │ ├── Coupon.java │ ├── CouponCollection.java │ ├── CreditNote.java │ ├── CreditNoteCollection.java │ ├── CreditNoteLineItem.java │ ├── CreditNoteLineItemCollection.java │ ├── Customer.java │ ├── CustomerBalanceTransaction.java │ ├── CustomerBalanceTransactionCollection.java │ ├── CustomerCashBalanceTransaction.java │ ├── CustomerCashBalanceTransactionCollection.java │ ├── CustomerCollection.java │ ├── CustomerSearchResult.java │ ├── CustomerSession.java │ ├── Discount.java │ ├── Dispute.java │ ├── DisputeCollection.java │ ├── EphemeralKey.java │ ├── EphemeralKeyDeserializer.java │ ├── Event.java │ ├── EventCollection.java │ ├── EventDataClassLookup.java │ ├── EventDataDeserializer.java │ ├── EventDataObjectDeserializer.java │ ├── EventRequestDeserializer.java │ ├── ExchangeRate.java │ ├── ExchangeRateCollection.java │ ├── ExpandableField.java │ ├── ExpandableFieldDeserializer.java │ ├── ExpandableFieldSerializer.java │ ├── ExternalAccount.java │ ├── ExternalAccountCollection.java │ ├── ExternalAccountTypeAdapterFactory.java │ ├── FeeRefund.java │ ├── FeeRefundCollection.java │ ├── File.java │ ├── FileCollection.java │ ├── FileLink.java │ ├── FileLinkCollection.java │ ├── FundingInstructions.java │ ├── HasId.java │ ├── InstantDeserializer.java │ ├── InstantSerializer.java │ ├── Invoice.java │ ├── InvoiceCollection.java │ ├── InvoiceItem.java │ ├── InvoiceItemCollection.java │ ├── InvoiceLineItem.java │ ├── InvoiceLineItemCollection.java │ ├── InvoicePayment.java │ ├── InvoicePaymentCollection.java │ ├── InvoiceRenderingTemplate.java │ ├── InvoiceRenderingTemplateCollection.java │ ├── InvoiceSearchResult.java │ ├── LineItem.java │ ├── LineItemCollection.java │ ├── LoginLink.java │ ├── Mandate.java │ ├── MetadataStore.java │ ├── PagingIterable.java │ ├── PagingIterator.java │ ├── PaymentIntent.java │ ├── PaymentIntentCollection.java │ ├── PaymentIntentSearchResult.java │ ├── PaymentLink.java │ ├── PaymentLinkCollection.java │ ├── PaymentMethod.java │ ├── PaymentMethodCollection.java │ ├── PaymentMethodConfiguration.java │ ├── PaymentMethodConfigurationCollection.java │ ├── PaymentMethodDomain.java │ ├── PaymentMethodDomainCollection.java │ ├── PaymentSource.java │ ├── PaymentSourceCollection.java │ ├── PaymentSourceTypeAdapterFactory.java │ ├── Payout.java │ ├── PayoutCollection.java │ ├── Person.java │ ├── PersonCollection.java │ ├── Plan.java │ ├── PlanCollection.java │ ├── Price.java │ ├── PriceCollection.java │ ├── PriceSearchResult.java │ ├── Product.java │ ├── ProductCollection.java │ ├── ProductFeature.java │ ├── ProductFeatureCollection.java │ ├── ProductSearchResult.java │ ├── PromotionCode.java │ ├── PromotionCodeCollection.java │ ├── Quote.java │ ├── QuoteCollection.java │ ├── Refund.java │ ├── RefundCollection.java │ ├── ReserveTransaction.java │ ├── Review.java │ ├── ReviewCollection.java │ ├── SearchPagingIterable.java │ ├── SearchPagingIterator.java │ ├── SetupAttempt.java │ ├── SetupAttemptCollection.java │ ├── SetupIntent.java │ ├── SetupIntentCollection.java │ ├── ShippingDetails.java │ ├── ShippingRate.java │ ├── ShippingRateCollection.java │ ├── Source.java │ ├── SourceMandateNotification.java │ ├── SourceTransaction.java │ ├── SourceTransactionCollection.java │ ├── StripeActiveObject.java │ ├── StripeCollection.java │ ├── StripeCollectionInterface.java │ ├── StripeError.java │ ├── StripeObject.java │ ├── StripeObjectInterface.java │ ├── StripeRawJsonObject.java │ ├── StripeRawJsonObjectDeserializer.java │ ├── StripeSearchResult.java │ ├── StripeSearchResultInterface.java │ ├── Subscription.java │ ├── SubscriptionCollection.java │ ├── SubscriptionItem.java │ ├── SubscriptionItemCollection.java │ ├── SubscriptionSchedule.java │ ├── SubscriptionScheduleCollection.java │ ├── SubscriptionSearchResult.java │ ├── TODO.java │ ├── TaxCode.java │ ├── TaxCodeCollection.java │ ├── TaxDeductedAtSource.java │ ├── TaxId.java │ ├── TaxIdCollection.java │ ├── TaxRate.java │ ├── TaxRateCollection.java │ ├── ThinEvent.java │ ├── ThinEventRelatedObject.java │ ├── Token.java │ ├── Topup.java │ ├── TopupCollection.java │ ├── Transfer.java │ ├── TransferCollection.java │ ├── TransferReversal.java │ ├── TransferReversalCollection.java │ ├── WebhookEndpoint.java │ ├── WebhookEndpointCollection.java │ ├── apps │ │ ├── Secret.java │ │ └── SecretCollection.java │ ├── billing │ │ ├── Alert.java │ │ ├── AlertCollection.java │ │ ├── AlertTriggered.java │ │ ├── CreditBalanceSummary.java │ │ ├── CreditBalanceTransaction.java │ │ ├── CreditBalanceTransactionCollection.java │ │ ├── CreditGrant.java │ │ ├── CreditGrantCollection.java │ │ ├── Meter.java │ │ ├── MeterCollection.java │ │ ├── MeterEvent.java │ │ ├── MeterEventAdjustment.java │ │ ├── MeterEventSummary.java │ │ └── MeterEventSummaryCollection.java │ ├── billingportal │ │ ├── Configuration.java │ │ ├── ConfigurationCollection.java │ │ └── Session.java │ ├── checkout │ │ ├── Session.java │ │ └── SessionCollection.java │ ├── climate │ │ ├── Order.java │ │ ├── OrderCollection.java │ │ ├── Product.java │ │ ├── ProductCollection.java │ │ ├── Supplier.java │ │ └── SupplierCollection.java │ ├── entitlements │ │ ├── ActiveEntitlement.java │ │ ├── ActiveEntitlementCollection.java │ │ ├── ActiveEntitlementSummary.java │ │ ├── Feature.java │ │ └── FeatureCollection.java │ ├── financialconnections │ │ ├── Account.java │ │ ├── AccountCollection.java │ │ ├── AccountOwner.java │ │ ├── AccountOwnerCollection.java │ │ ├── AccountOwnership.java │ │ ├── Session.java │ │ ├── Transaction.java │ │ └── TransactionCollection.java │ ├── forwarding │ │ ├── Request.java │ │ └── RequestCollection.java │ ├── identity │ │ ├── VerificationReport.java │ │ ├── VerificationReportCollection.java │ │ ├── VerificationSession.java │ │ └── VerificationSessionCollection.java │ ├── issuing │ │ ├── Authorization.java │ │ ├── AuthorizationCollection.java │ │ ├── Card.java │ │ ├── CardCollection.java │ │ ├── Cardholder.java │ │ ├── CardholderCollection.java │ │ ├── Dispute.java │ │ ├── DisputeCollection.java │ │ ├── PersonalizationDesign.java │ │ ├── PersonalizationDesignCollection.java │ │ ├── PhysicalBundle.java │ │ ├── PhysicalBundleCollection.java │ │ ├── Token.java │ │ ├── TokenCollection.java │ │ ├── Transaction.java │ │ └── TransactionCollection.java │ ├── oauth │ │ ├── DeauthorizedAccount.java │ │ ├── OAuthError.java │ │ └── TokenResponse.java │ ├── radar │ │ ├── EarlyFraudWarning.java │ │ ├── EarlyFraudWarningCollection.java │ │ ├── ValueList.java │ │ ├── ValueListCollection.java │ │ ├── ValueListItem.java │ │ └── ValueListItemCollection.java │ ├── reporting │ │ ├── ReportRun.java │ │ ├── ReportRunCollection.java │ │ ├── ReportType.java │ │ └── ReportTypeCollection.java │ ├── sigma │ │ ├── ScheduledQueryRun.java │ │ └── ScheduledQueryRunCollection.java │ ├── tax │ │ ├── Calculation.java │ │ ├── CalculationLineItem.java │ │ ├── CalculationLineItemCollection.java │ │ ├── Registration.java │ │ ├── RegistrationCollection.java │ │ ├── Settings.java │ │ ├── Transaction.java │ │ ├── TransactionLineItem.java │ │ └── TransactionLineItemCollection.java │ ├── terminal │ │ ├── Configuration.java │ │ ├── ConfigurationCollection.java │ │ ├── ConnectionToken.java │ │ ├── Location.java │ │ ├── LocationCollection.java │ │ ├── Reader.java │ │ └── ReaderCollection.java │ ├── testhelpers │ │ ├── TestClock.java │ │ └── TestClockCollection.java │ ├── treasury │ │ ├── CreditReversal.java │ │ ├── CreditReversalCollection.java │ │ ├── DebitReversal.java │ │ ├── DebitReversalCollection.java │ │ ├── FinancialAccount.java │ │ ├── FinancialAccountCollection.java │ │ ├── FinancialAccountFeatures.java │ │ ├── InboundTransfer.java │ │ ├── InboundTransferCollection.java │ │ ├── OutboundPayment.java │ │ ├── OutboundPaymentCollection.java │ │ ├── OutboundTransfer.java │ │ ├── OutboundTransferCollection.java │ │ ├── ReceivedCredit.java │ │ ├── ReceivedCreditCollection.java │ │ ├── ReceivedDebit.java │ │ ├── ReceivedDebitCollection.java │ │ ├── Transaction.java │ │ ├── TransactionCollection.java │ │ ├── TransactionEntry.java │ │ └── TransactionEntryCollection.java │ └── v2 │ │ ├── Event.java │ │ ├── EventDataClassLookup.java │ │ ├── EventDestination.java │ │ ├── EventTypeAdapterFactory.java │ │ ├── StripeCollection.java │ │ ├── StripeDeletedObject.java │ │ └── billing │ │ ├── MeterEvent.java │ │ ├── MeterEventAdjustment.java │ │ └── MeterEventSession.java │ ├── net │ ├── AbstractStripeResponse.java │ ├── ApiMode.java │ ├── ApiRequest.java │ ├── ApiRequestParams.java │ ├── ApiRequestParamsConverter.java │ ├── ApiResource.java │ ├── ApiResourceTypeAdapterFactoryProvider.java │ ├── ApiService.java │ ├── Authenticator.java │ ├── BaseAddress.java │ ├── BaseApiRequest.java │ ├── BearerTokenAuthenticator.java │ ├── FormEncoder.java │ ├── GlobalStripeResponseGetterOptions.java │ ├── HttpClient.java │ ├── HttpContent.java │ ├── HttpHeaders.java │ ├── HttpURLConnectionClient.java │ ├── JsonEncoder.java │ ├── KeyValuePair.java │ ├── LiveStripeResponseGetter.java │ ├── MultipartProcessor.java │ ├── OAuth.java │ ├── RawApiRequest.java │ ├── RawRequestOptions.java │ ├── RequestOptions.java │ ├── RequestTelemetry.java │ ├── StripeCollectionItemTypeSettingFactory.java │ ├── StripeRequest.java │ ├── StripeResponse.java │ ├── StripeResponseGetter.java │ ├── StripeResponseGetterOptions.java │ ├── StripeResponseGetterSettingTypeAdapterFactory.java │ ├── StripeResponseStream.java │ ├── UntypedMapDeserializer.java │ └── Webhook.java │ ├── param │ ├── AccountCapabilitiesParams.java │ ├── AccountCapabilityListParams.java │ ├── AccountCapabilityRetrieveParams.java │ ├── AccountCapabilityUpdateParams.java │ ├── AccountCreateParams.java │ ├── AccountExternalAccountCreateParams.java │ ├── AccountExternalAccountListParams.java │ ├── AccountExternalAccountRetrieveParams.java │ ├── AccountExternalAccountUpdateParams.java │ ├── AccountLinkCreateParams.java │ ├── AccountListParams.java │ ├── AccountLoginLinkCreateParams.java │ ├── AccountPersonCreateParams.java │ ├── AccountPersonListParams.java │ ├── AccountPersonRetrieveParams.java │ ├── AccountPersonUpdateParams.java │ ├── AccountPersonsParams.java │ ├── AccountRejectParams.java │ ├── AccountRetrieveCurrentParams.java │ ├── AccountRetrieveParams.java │ ├── AccountSessionCreateParams.java │ ├── AccountUpdateParams.java │ ├── ApplePayDomainCreateParams.java │ ├── ApplePayDomainListParams.java │ ├── ApplePayDomainRetrieveParams.java │ ├── ApplicationFeeListParams.java │ ├── ApplicationFeeRefundCreateParams.java │ ├── ApplicationFeeRefundListParams.java │ ├── ApplicationFeeRefundRetrieveParams.java │ ├── ApplicationFeeRefundUpdateParams.java │ ├── ApplicationFeeRetrieveParams.java │ ├── BalanceRetrieveParams.java │ ├── BalanceTransactionListParams.java │ ├── BalanceTransactionRetrieveParams.java │ ├── BankAccountUpdateOnAccountParams.java │ ├── BankAccountUpdateOnCustomerParams.java │ ├── BankAccountVerifyParams.java │ ├── CapabilityCollectionListParams.java │ ├── CapabilityCollectionRetrieveParams.java │ ├── CapabilityUpdateParams.java │ ├── CardUpdateOnAccountParams.java │ ├── CardUpdateOnCustomerParams.java │ ├── CashBalanceRetrieveParams.java │ ├── CashBalanceUpdateParams.java │ ├── ChargeCaptureParams.java │ ├── ChargeCreateParams.java │ ├── ChargeListParams.java │ ├── ChargeRetrieveParams.java │ ├── ChargeSearchParams.java │ ├── ChargeUpdateParams.java │ ├── ConfirmationTokenCreateParams.java │ ├── ConfirmationTokenRetrieveParams.java │ ├── CountrySpecListParams.java │ ├── CountrySpecRetrieveParams.java │ ├── CouponCreateParams.java │ ├── CouponListParams.java │ ├── CouponRetrieveParams.java │ ├── CouponUpdateParams.java │ ├── CreditNoteCreateParams.java │ ├── CreditNoteLineItemCollectionListParams.java │ ├── CreditNoteLineItemListParams.java │ ├── CreditNoteListParams.java │ ├── CreditNotePreviewLinesListParams.java │ ├── CreditNotePreviewParams.java │ ├── CreditNoteRetrieveParams.java │ ├── CreditNoteUpdateParams.java │ ├── CreditNoteVoidCreditNoteParams.java │ ├── CustomerBalanceTransactionCollectionCreateParams.java │ ├── CustomerBalanceTransactionCollectionListParams.java │ ├── CustomerBalanceTransactionCollectionRetrieveParams.java │ ├── CustomerBalanceTransactionCreateParams.java │ ├── CustomerBalanceTransactionListParams.java │ ├── CustomerBalanceTransactionRetrieveParams.java │ ├── CustomerBalanceTransactionUpdateParams.java │ ├── CustomerBalanceTransactionsParams.java │ ├── CustomerCashBalanceRetrieveParams.java │ ├── CustomerCashBalanceTransactionCollectionListParams.java │ ├── CustomerCashBalanceTransactionCollectionRetrieveParams.java │ ├── CustomerCashBalanceTransactionListParams.java │ ├── CustomerCashBalanceTransactionRetrieveParams.java │ ├── CustomerCashBalanceTransactionsParams.java │ ├── CustomerCashBalanceUpdateParams.java │ ├── CustomerCreateFundingInstructionsParams.java │ ├── CustomerCreateParams.java │ ├── CustomerFundCashBalanceParams.java │ ├── CustomerFundingInstructionsCreateParams.java │ ├── CustomerListParams.java │ ├── CustomerListPaymentMethodsParams.java │ ├── CustomerPaymentMethodListParams.java │ ├── CustomerPaymentMethodRetrieveParams.java │ ├── CustomerPaymentSourceCreateParams.java │ ├── CustomerPaymentSourceDeleteParams.java │ ├── CustomerPaymentSourceListParams.java │ ├── CustomerPaymentSourceRetrieveParams.java │ ├── CustomerPaymentSourceUpdateParams.java │ ├── CustomerPaymentSourceVerifyParams.java │ ├── CustomerRetrieveParams.java │ ├── CustomerRetrievePaymentMethodParams.java │ ├── CustomerSearchParams.java │ ├── CustomerSessionCreateParams.java │ ├── CustomerTaxIdCreateParams.java │ ├── CustomerTaxIdListParams.java │ ├── CustomerTaxIdRetrieveParams.java │ ├── CustomerUpdateParams.java │ ├── DisputeCloseParams.java │ ├── DisputeListParams.java │ ├── DisputeRetrieveParams.java │ ├── DisputeUpdateParams.java │ ├── EphemeralKeyCreateParams.java │ ├── EphemeralKeyDeleteParams.java │ ├── EventListParams.java │ ├── EventRetrieveParams.java │ ├── ExchangeRateListParams.java │ ├── ExchangeRateRetrieveParams.java │ ├── ExternalAccountCollectionCreateParams.java │ ├── ExternalAccountCollectionListParams.java │ ├── ExternalAccountCollectionRetrieveParams.java │ ├── FeeRefundCollectionCreateParams.java │ ├── FeeRefundCollectionListParams.java │ ├── FeeRefundCollectionRetrieveParams.java │ ├── FeeRefundUpdateParams.java │ ├── FileCreateParams.java │ ├── FileLinkCreateParams.java │ ├── FileLinkListParams.java │ ├── FileLinkRetrieveParams.java │ ├── FileLinkUpdateParams.java │ ├── FileListParams.java │ ├── FileRetrieveParams.java │ ├── InvoiceAddLinesParams.java │ ├── InvoiceAttachPaymentParams.java │ ├── InvoiceCreateParams.java │ ├── InvoiceCreatePreviewParams.java │ ├── InvoiceFinalizeInvoiceParams.java │ ├── InvoiceItemCreateParams.java │ ├── InvoiceItemListParams.java │ ├── InvoiceItemRetrieveParams.java │ ├── InvoiceItemUpdateParams.java │ ├── InvoiceLineItemCollectionListParams.java │ ├── InvoiceLineItemListParams.java │ ├── InvoiceLineItemUpdateParams.java │ ├── InvoiceListParams.java │ ├── InvoiceMarkUncollectibleParams.java │ ├── InvoicePayParams.java │ ├── InvoicePaymentListParams.java │ ├── InvoicePaymentRetrieveParams.java │ ├── InvoiceRemoveLinesParams.java │ ├── InvoiceRenderingTemplateArchiveParams.java │ ├── InvoiceRenderingTemplateListParams.java │ ├── InvoiceRenderingTemplateRetrieveParams.java │ ├── InvoiceRenderingTemplateUnarchiveParams.java │ ├── InvoiceRetrieveParams.java │ ├── InvoiceSearchParams.java │ ├── InvoiceSendInvoiceParams.java │ ├── InvoiceUpdateLinesParams.java │ ├── InvoiceUpdateParams.java │ ├── InvoiceVoidInvoiceParams.java │ ├── LoginLinkCreateOnAccountParams.java │ ├── MandateRetrieveParams.java │ ├── PaymentIntentApplyCustomerBalanceParams.java │ ├── PaymentIntentCancelParams.java │ ├── PaymentIntentCaptureParams.java │ ├── PaymentIntentConfirmParams.java │ ├── PaymentIntentCreateParams.java │ ├── PaymentIntentIncrementAuthorizationParams.java │ ├── PaymentIntentListParams.java │ ├── PaymentIntentRetrieveParams.java │ ├── PaymentIntentSearchParams.java │ ├── PaymentIntentUpdateParams.java │ ├── PaymentIntentVerifyMicrodepositsParams.java │ ├── PaymentLinkCreateParams.java │ ├── PaymentLinkLineItemListParams.java │ ├── PaymentLinkListLineItemsParams.java │ ├── PaymentLinkListParams.java │ ├── PaymentLinkRetrieveParams.java │ ├── PaymentLinkUpdateParams.java │ ├── PaymentMethodAttachParams.java │ ├── PaymentMethodConfigurationCreateParams.java │ ├── PaymentMethodConfigurationListParams.java │ ├── PaymentMethodConfigurationRetrieveParams.java │ ├── PaymentMethodConfigurationUpdateParams.java │ ├── PaymentMethodCreateParams.java │ ├── PaymentMethodDetachParams.java │ ├── PaymentMethodDomainCreateParams.java │ ├── PaymentMethodDomainListParams.java │ ├── PaymentMethodDomainRetrieveParams.java │ ├── PaymentMethodDomainUpdateParams.java │ ├── PaymentMethodDomainValidateParams.java │ ├── PaymentMethodListParams.java │ ├── PaymentMethodRetrieveParams.java │ ├── PaymentMethodUpdateParams.java │ ├── PaymentSourceCollectionCreateParams.java │ ├── PaymentSourceCollectionListParams.java │ ├── PaymentSourceCollectionRetrieveParams.java │ ├── PayoutCancelParams.java │ ├── PayoutCreateParams.java │ ├── PayoutListParams.java │ ├── PayoutRetrieveParams.java │ ├── PayoutReverseParams.java │ ├── PayoutUpdateParams.java │ ├── PersonCollectionCreateParams.java │ ├── PersonCollectionListParams.java │ ├── PersonCollectionRetrieveParams.java │ ├── PersonUpdateParams.java │ ├── PlanCreateParams.java │ ├── PlanListParams.java │ ├── PlanRetrieveParams.java │ ├── PlanUpdateParams.java │ ├── PriceCreateParams.java │ ├── PriceListParams.java │ ├── PriceRetrieveParams.java │ ├── PriceSearchParams.java │ ├── PriceUpdateParams.java │ ├── ProductCreateParams.java │ ├── ProductFeatureCreateParams.java │ ├── ProductFeatureListParams.java │ ├── ProductFeatureRetrieveParams.java │ ├── ProductListParams.java │ ├── ProductRetrieveParams.java │ ├── ProductSearchParams.java │ ├── ProductUpdateParams.java │ ├── PromotionCodeCreateParams.java │ ├── PromotionCodeListParams.java │ ├── PromotionCodeRetrieveParams.java │ ├── PromotionCodeUpdateParams.java │ ├── QuoteAcceptParams.java │ ├── QuoteCancelParams.java │ ├── QuoteComputedUpfrontLineItemsListParams.java │ ├── QuoteCreateParams.java │ ├── QuoteFinalizeQuoteParams.java │ ├── QuoteLineItemListParams.java │ ├── QuoteListComputedUpfrontLineItemsParams.java │ ├── QuoteListLineItemsParams.java │ ├── QuoteListParams.java │ ├── QuotePdfParams.java │ ├── QuoteRetrieveParams.java │ ├── QuoteUpdateParams.java │ ├── RefundCancelParams.java │ ├── RefundCollectionListParams.java │ ├── RefundCollectionRetrieveParams.java │ ├── RefundCreateParams.java │ ├── RefundExpireParams.java │ ├── RefundListParams.java │ ├── RefundRetrieveParams.java │ ├── RefundUpdateParams.java │ ├── ReviewApproveParams.java │ ├── ReviewListParams.java │ ├── ReviewRetrieveParams.java │ ├── SetupAttemptListParams.java │ ├── SetupIntentCancelParams.java │ ├── SetupIntentConfirmParams.java │ ├── SetupIntentCreateParams.java │ ├── SetupIntentListParams.java │ ├── SetupIntentRetrieveParams.java │ ├── SetupIntentUpdateParams.java │ ├── SetupIntentVerifyMicrodepositsParams.java │ ├── ShippingRateCreateParams.java │ ├── ShippingRateListParams.java │ ├── ShippingRateRetrieveParams.java │ ├── ShippingRateUpdateParams.java │ ├── SourceCreateParams.java │ ├── SourceDetachParams.java │ ├── SourceRetrieveParams.java │ ├── SourceSourceTransactionsParams.java │ ├── SourceTransactionListParams.java │ ├── SourceUpdateParams.java │ ├── SourceVerifyParams.java │ ├── SubscriptionCancelParams.java │ ├── SubscriptionCreateParams.java │ ├── SubscriptionItemCreateParams.java │ ├── SubscriptionItemDeleteParams.java │ ├── SubscriptionItemListParams.java │ ├── SubscriptionItemRetrieveParams.java │ ├── SubscriptionItemUpdateParams.java │ ├── SubscriptionListParams.java │ ├── SubscriptionResumeParams.java │ ├── SubscriptionRetrieveParams.java │ ├── SubscriptionScheduleCancelParams.java │ ├── SubscriptionScheduleCreateParams.java │ ├── SubscriptionScheduleListParams.java │ ├── SubscriptionScheduleReleaseParams.java │ ├── SubscriptionScheduleRetrieveParams.java │ ├── SubscriptionScheduleUpdateParams.java │ ├── SubscriptionSearchParams.java │ ├── SubscriptionUpdateParams.java │ ├── TaxCodeListParams.java │ ├── TaxCodeRetrieveParams.java │ ├── TaxIdCollectionCreateParams.java │ ├── TaxIdCollectionListParams.java │ ├── TaxIdCollectionRetrieveParams.java │ ├── TaxIdCreateParams.java │ ├── TaxIdListParams.java │ ├── TaxIdRetrieveParams.java │ ├── TaxRateCreateParams.java │ ├── TaxRateListParams.java │ ├── TaxRateRetrieveParams.java │ ├── TaxRateUpdateParams.java │ ├── TokenCreateParams.java │ ├── TokenRetrieveParams.java │ ├── TopupCancelParams.java │ ├── TopupCreateParams.java │ ├── TopupListParams.java │ ├── TopupRetrieveParams.java │ ├── TopupUpdateParams.java │ ├── TransferCreateParams.java │ ├── TransferListParams.java │ ├── TransferRetrieveParams.java │ ├── TransferReversalCollectionCreateParams.java │ ├── TransferReversalCollectionListParams.java │ ├── TransferReversalCollectionRetrieveParams.java │ ├── TransferReversalCreateParams.java │ ├── TransferReversalListParams.java │ ├── TransferReversalRetrieveParams.java │ ├── TransferReversalUpdateParams.java │ ├── TransferUpdateParams.java │ ├── WebhookEndpointCreateParams.java │ ├── WebhookEndpointListParams.java │ ├── WebhookEndpointRetrieveParams.java │ ├── WebhookEndpointUpdateParams.java │ ├── apps │ │ ├── SecretCreateParams.java │ │ ├── SecretDeleteWhereParams.java │ │ ├── SecretFindParams.java │ │ └── SecretListParams.java │ ├── billing │ │ ├── AlertActivateParams.java │ │ ├── AlertArchiveParams.java │ │ ├── AlertCreateParams.java │ │ ├── AlertDeactivateParams.java │ │ ├── AlertListParams.java │ │ ├── AlertRetrieveParams.java │ │ ├── CreditBalanceSummaryRetrieveParams.java │ │ ├── CreditBalanceTransactionListParams.java │ │ ├── CreditBalanceTransactionRetrieveParams.java │ │ ├── CreditGrantCreateParams.java │ │ ├── CreditGrantExpireParams.java │ │ ├── CreditGrantListParams.java │ │ ├── CreditGrantRetrieveParams.java │ │ ├── CreditGrantUpdateParams.java │ │ ├── CreditGrantVoidGrantParams.java │ │ ├── MeterCreateParams.java │ │ ├── MeterDeactivateParams.java │ │ ├── MeterEventAdjustmentCreateParams.java │ │ ├── MeterEventCreateParams.java │ │ ├── MeterEventSummariesParams.java │ │ ├── MeterEventSummaryListParams.java │ │ ├── MeterListParams.java │ │ ├── MeterReactivateParams.java │ │ ├── MeterRetrieveParams.java │ │ └── MeterUpdateParams.java │ ├── billingportal │ │ ├── ConfigurationCreateParams.java │ │ ├── ConfigurationListParams.java │ │ ├── ConfigurationRetrieveParams.java │ │ ├── ConfigurationUpdateParams.java │ │ └── SessionCreateParams.java │ ├── checkout │ │ ├── SessionCreateParams.java │ │ ├── SessionExpireParams.java │ │ ├── SessionLineItemListParams.java │ │ ├── SessionListLineItemsParams.java │ │ ├── SessionListParams.java │ │ ├── SessionRetrieveParams.java │ │ └── SessionUpdateParams.java │ ├── climate │ │ ├── OrderCancelParams.java │ │ ├── OrderCreateParams.java │ │ ├── OrderListParams.java │ │ ├── OrderRetrieveParams.java │ │ ├── OrderUpdateParams.java │ │ ├── ProductListParams.java │ │ ├── ProductRetrieveParams.java │ │ ├── SupplierListParams.java │ │ └── SupplierRetrieveParams.java │ ├── common │ │ └── EmptyParam.java │ ├── entitlements │ │ ├── ActiveEntitlementListParams.java │ │ ├── ActiveEntitlementRetrieveParams.java │ │ ├── FeatureCreateParams.java │ │ ├── FeatureListParams.java │ │ ├── FeatureRetrieveParams.java │ │ └── FeatureUpdateParams.java │ ├── financialconnections │ │ ├── AccountDisconnectParams.java │ │ ├── AccountListOwnersParams.java │ │ ├── AccountListParams.java │ │ ├── AccountOwnerListParams.java │ │ ├── AccountRefreshParams.java │ │ ├── AccountRetrieveParams.java │ │ ├── AccountSubscribeParams.java │ │ ├── AccountUnsubscribeParams.java │ │ ├── SessionCreateParams.java │ │ ├── SessionRetrieveParams.java │ │ ├── TransactionListParams.java │ │ └── TransactionRetrieveParams.java │ ├── forwarding │ │ ├── RequestCreateParams.java │ │ ├── RequestListParams.java │ │ └── RequestRetrieveParams.java │ ├── identity │ │ ├── VerificationReportListParams.java │ │ ├── VerificationReportRetrieveParams.java │ │ ├── VerificationSessionCancelParams.java │ │ ├── VerificationSessionCreateParams.java │ │ ├── VerificationSessionListParams.java │ │ ├── VerificationSessionRedactParams.java │ │ ├── VerificationSessionRetrieveParams.java │ │ └── VerificationSessionUpdateParams.java │ ├── issuing │ │ ├── AuthorizationApproveParams.java │ │ ├── AuthorizationCaptureParams.java │ │ ├── AuthorizationCreateParams.java │ │ ├── AuthorizationDeclineParams.java │ │ ├── AuthorizationExpireParams.java │ │ ├── AuthorizationFinalizeAmountParams.java │ │ ├── AuthorizationIncrementParams.java │ │ ├── AuthorizationListParams.java │ │ ├── AuthorizationRespondParams.java │ │ ├── AuthorizationRetrieveParams.java │ │ ├── AuthorizationReverseParams.java │ │ ├── AuthorizationUpdateParams.java │ │ ├── CardCreateParams.java │ │ ├── CardDeliverCardParams.java │ │ ├── CardDetailsParams.java │ │ ├── CardFailCardParams.java │ │ ├── CardListParams.java │ │ ├── CardRetrieveParams.java │ │ ├── CardReturnCardParams.java │ │ ├── CardShipCardParams.java │ │ ├── CardSubmitCardParams.java │ │ ├── CardUpdateParams.java │ │ ├── CardholderCreateParams.java │ │ ├── CardholderListParams.java │ │ ├── CardholderRetrieveParams.java │ │ ├── CardholderUpdateParams.java │ │ ├── DisputeCreateParams.java │ │ ├── DisputeListParams.java │ │ ├── DisputeRetrieveParams.java │ │ ├── DisputeSubmitParams.java │ │ ├── DisputeUpdateParams.java │ │ ├── PersonalizationDesignActivateParams.java │ │ ├── PersonalizationDesignCreateParams.java │ │ ├── PersonalizationDesignDeactivateParams.java │ │ ├── PersonalizationDesignListParams.java │ │ ├── PersonalizationDesignRejectParams.java │ │ ├── PersonalizationDesignRetrieveParams.java │ │ ├── PersonalizationDesignUpdateParams.java │ │ ├── PhysicalBundleListParams.java │ │ ├── PhysicalBundleRetrieveParams.java │ │ ├── TokenListParams.java │ │ ├── TokenRetrieveParams.java │ │ ├── TokenUpdateParams.java │ │ ├── TransactionCreateForceCaptureParams.java │ │ ├── TransactionCreateUnlinkedRefundParams.java │ │ ├── TransactionListParams.java │ │ ├── TransactionRefundParams.java │ │ ├── TransactionRetrieveParams.java │ │ └── TransactionUpdateParams.java │ ├── radar │ │ ├── EarlyFraudWarningListParams.java │ │ ├── EarlyFraudWarningRetrieveParams.java │ │ ├── ValueListCreateParams.java │ │ ├── ValueListItemCreateParams.java │ │ ├── ValueListItemListParams.java │ │ ├── ValueListItemRetrieveParams.java │ │ ├── ValueListListParams.java │ │ ├── ValueListRetrieveParams.java │ │ └── ValueListUpdateParams.java │ ├── reporting │ │ ├── ReportRunCreateParams.java │ │ ├── ReportRunListParams.java │ │ ├── ReportRunRetrieveParams.java │ │ ├── ReportTypeListParams.java │ │ └── ReportTypeRetrieveParams.java │ ├── sigma │ │ ├── ScheduledQueryRunListParams.java │ │ └── ScheduledQueryRunRetrieveParams.java │ ├── tax │ │ ├── CalculationCreateParams.java │ │ ├── CalculationLineItemListParams.java │ │ ├── CalculationListLineItemsParams.java │ │ ├── CalculationRetrieveParams.java │ │ ├── RegistrationCreateParams.java │ │ ├── RegistrationListParams.java │ │ ├── RegistrationRetrieveParams.java │ │ ├── RegistrationUpdateParams.java │ │ ├── SettingsRetrieveParams.java │ │ ├── SettingsUpdateParams.java │ │ ├── TransactionCreateFromCalculationParams.java │ │ ├── TransactionCreateReversalParams.java │ │ ├── TransactionLineItemListParams.java │ │ ├── TransactionListLineItemsParams.java │ │ └── TransactionRetrieveParams.java │ ├── terminal │ │ ├── ConfigurationCreateParams.java │ │ ├── ConfigurationListParams.java │ │ ├── ConfigurationRetrieveParams.java │ │ ├── ConfigurationUpdateParams.java │ │ ├── ConnectionTokenCreateParams.java │ │ ├── LocationCreateParams.java │ │ ├── LocationDeleteParams.java │ │ ├── LocationListParams.java │ │ ├── LocationRetrieveParams.java │ │ ├── LocationUpdateParams.java │ │ ├── ReaderCancelActionParams.java │ │ ├── ReaderCollectInputsParams.java │ │ ├── ReaderCreateParams.java │ │ ├── ReaderDeleteParams.java │ │ ├── ReaderListParams.java │ │ ├── ReaderPresentPaymentMethodParams.java │ │ ├── ReaderProcessPaymentIntentParams.java │ │ ├── ReaderProcessSetupIntentParams.java │ │ ├── ReaderRefundPaymentParams.java │ │ ├── ReaderRetrieveParams.java │ │ ├── ReaderSetReaderDisplayParams.java │ │ ├── ReaderSucceedInputCollectionParams.java │ │ ├── ReaderTimeoutInputCollectionParams.java │ │ └── ReaderUpdateParams.java │ ├── testhelpers │ │ ├── TestClockAdvanceParams.java │ │ ├── TestClockCreateParams.java │ │ ├── TestClockListParams.java │ │ └── TestClockRetrieveParams.java │ ├── treasury │ │ ├── CreditReversalCreateParams.java │ │ ├── CreditReversalListParams.java │ │ ├── CreditReversalRetrieveParams.java │ │ ├── DebitReversalCreateParams.java │ │ ├── DebitReversalListParams.java │ │ ├── DebitReversalRetrieveParams.java │ │ ├── FinancialAccountCloseParams.java │ │ ├── FinancialAccountCreateParams.java │ │ ├── FinancialAccountFeaturesRetrieveParams.java │ │ ├── FinancialAccountFeaturesUpdateParams.java │ │ ├── FinancialAccountListParams.java │ │ ├── FinancialAccountRetrieveFeaturesParams.java │ │ ├── FinancialAccountRetrieveParams.java │ │ ├── FinancialAccountUpdateFeaturesParams.java │ │ ├── FinancialAccountUpdateParams.java │ │ ├── InboundTransferCancelParams.java │ │ ├── InboundTransferCreateParams.java │ │ ├── InboundTransferFailParams.java │ │ ├── InboundTransferListParams.java │ │ ├── InboundTransferRetrieveParams.java │ │ ├── InboundTransferReturnInboundTransferParams.java │ │ ├── InboundTransferSucceedParams.java │ │ ├── OutboundPaymentCancelParams.java │ │ ├── OutboundPaymentCreateParams.java │ │ ├── OutboundPaymentFailParams.java │ │ ├── OutboundPaymentListParams.java │ │ ├── OutboundPaymentPostParams.java │ │ ├── OutboundPaymentRetrieveParams.java │ │ ├── OutboundPaymentReturnOutboundPaymentParams.java │ │ ├── OutboundPaymentUpdateParams.java │ │ ├── OutboundTransferCancelParams.java │ │ ├── OutboundTransferCreateParams.java │ │ ├── OutboundTransferFailParams.java │ │ ├── OutboundTransferListParams.java │ │ ├── OutboundTransferPostParams.java │ │ ├── OutboundTransferRetrieveParams.java │ │ ├── OutboundTransferReturnOutboundTransferParams.java │ │ ├── OutboundTransferUpdateParams.java │ │ ├── ReceivedCreditCreateParams.java │ │ ├── ReceivedCreditListParams.java │ │ ├── ReceivedCreditRetrieveParams.java │ │ ├── ReceivedDebitCreateParams.java │ │ ├── ReceivedDebitListParams.java │ │ ├── ReceivedDebitRetrieveParams.java │ │ ├── TransactionEntryListParams.java │ │ ├── TransactionEntryRetrieveParams.java │ │ ├── TransactionListParams.java │ │ └── TransactionRetrieveParams.java │ └── v2 │ │ ├── billing │ │ ├── MeterEventAdjustmentCreateParams.java │ │ ├── MeterEventCreateParams.java │ │ └── MeterEventStreamCreateParams.java │ │ └── core │ │ ├── EventDestinationCreateParams.java │ │ ├── EventDestinationListParams.java │ │ ├── EventDestinationRetrieveParams.java │ │ ├── EventDestinationUpdateParams.java │ │ └── EventListParams.java │ ├── service │ ├── AccountCapabilityService.java │ ├── AccountExternalAccountService.java │ ├── AccountLinkService.java │ ├── AccountLoginLinkService.java │ ├── AccountPersonService.java │ ├── AccountService.java │ ├── AccountSessionService.java │ ├── ApplePayDomainService.java │ ├── ApplicationFeeRefundService.java │ ├── ApplicationFeeService.java │ ├── AppsService.java │ ├── BalanceService.java │ ├── BalanceTransactionService.java │ ├── BillingPortalService.java │ ├── BillingService.java │ ├── ChargeService.java │ ├── CheckoutService.java │ ├── ClimateService.java │ ├── ConfirmationTokenService.java │ ├── CountrySpecService.java │ ├── CouponService.java │ ├── CreditNoteLineItemService.java │ ├── CreditNotePreviewLinesService.java │ ├── CreditNoteService.java │ ├── CustomerBalanceTransactionService.java │ ├── CustomerCashBalanceService.java │ ├── CustomerCashBalanceTransactionService.java │ ├── CustomerFundingInstructionsService.java │ ├── CustomerPaymentMethodService.java │ ├── CustomerPaymentSourceService.java │ ├── CustomerService.java │ ├── CustomerSessionService.java │ ├── CustomerTaxIdService.java │ ├── DisputeService.java │ ├── EntitlementsService.java │ ├── EphemeralKeyService.java │ ├── EventService.java │ ├── ExchangeRateService.java │ ├── FileLinkService.java │ ├── FileService.java │ ├── FinancialConnectionsService.java │ ├── ForwardingService.java │ ├── IdentityService.java │ ├── InvoiceItemService.java │ ├── InvoiceLineItemService.java │ ├── InvoicePaymentService.java │ ├── InvoiceRenderingTemplateService.java │ ├── InvoiceService.java │ ├── IssuingService.java │ ├── MandateService.java │ ├── PaymentIntentService.java │ ├── PaymentLinkLineItemService.java │ ├── PaymentLinkService.java │ ├── PaymentMethodConfigurationService.java │ ├── PaymentMethodDomainService.java │ ├── PaymentMethodService.java │ ├── PayoutService.java │ ├── PlanService.java │ ├── PriceService.java │ ├── ProductFeatureService.java │ ├── ProductService.java │ ├── PromotionCodeService.java │ ├── QuoteComputedUpfrontLineItemsService.java │ ├── QuoteLineItemService.java │ ├── QuoteService.java │ ├── RadarService.java │ ├── RefundService.java │ ├── ReportingService.java │ ├── ReviewService.java │ ├── SetupAttemptService.java │ ├── SetupIntentService.java │ ├── ShippingRateService.java │ ├── SigmaService.java │ ├── SourceService.java │ ├── SourceTransactionService.java │ ├── SubscriptionItemService.java │ ├── SubscriptionScheduleService.java │ ├── SubscriptionService.java │ ├── TaxCodeService.java │ ├── TaxIdService.java │ ├── TaxRateService.java │ ├── TaxService.java │ ├── TerminalService.java │ ├── TestHelpersService.java │ ├── TokenService.java │ ├── TopupService.java │ ├── TransferReversalService.java │ ├── TransferService.java │ ├── TreasuryService.java │ ├── V2Services.java │ ├── WebhookEndpointService.java │ ├── apps │ │ └── SecretService.java │ ├── billing │ │ ├── AlertService.java │ │ ├── CreditBalanceSummaryService.java │ │ ├── CreditBalanceTransactionService.java │ │ ├── CreditGrantService.java │ │ ├── MeterEventAdjustmentService.java │ │ ├── MeterEventService.java │ │ ├── MeterEventSummaryService.java │ │ └── MeterService.java │ ├── billingportal │ │ ├── ConfigurationService.java │ │ └── SessionService.java │ ├── checkout │ │ ├── SessionLineItemService.java │ │ └── SessionService.java │ ├── climate │ │ ├── OrderService.java │ │ ├── ProductService.java │ │ └── SupplierService.java │ ├── entitlements │ │ ├── ActiveEntitlementService.java │ │ └── FeatureService.java │ ├── financialconnections │ │ ├── AccountOwnerService.java │ │ ├── AccountService.java │ │ ├── SessionService.java │ │ └── TransactionService.java │ ├── forwarding │ │ └── RequestService.java │ ├── identity │ │ ├── VerificationReportService.java │ │ └── VerificationSessionService.java │ ├── issuing │ │ ├── AuthorizationService.java │ │ ├── CardService.java │ │ ├── CardholderService.java │ │ ├── DisputeService.java │ │ ├── PersonalizationDesignService.java │ │ ├── PhysicalBundleService.java │ │ ├── TokenService.java │ │ └── TransactionService.java │ ├── radar │ │ ├── EarlyFraudWarningService.java │ │ ├── ValueListItemService.java │ │ └── ValueListService.java │ ├── reporting │ │ ├── ReportRunService.java │ │ └── ReportTypeService.java │ ├── sigma │ │ └── ScheduledQueryRunService.java │ ├── tax │ │ ├── CalculationLineItemService.java │ │ ├── CalculationService.java │ │ ├── RegistrationService.java │ │ ├── SettingsService.java │ │ ├── TransactionLineItemService.java │ │ └── TransactionService.java │ ├── terminal │ │ ├── ConfigurationService.java │ │ ├── ConnectionTokenService.java │ │ ├── LocationService.java │ │ └── ReaderService.java │ ├── testhelpers │ │ ├── ConfirmationTokenService.java │ │ ├── CustomerService.java │ │ ├── IssuingService.java │ │ ├── RefundService.java │ │ ├── TerminalService.java │ │ ├── TestClockService.java │ │ ├── TreasuryService.java │ │ ├── issuing │ │ │ ├── AuthorizationService.java │ │ │ ├── CardService.java │ │ │ ├── PersonalizationDesignService.java │ │ │ └── TransactionService.java │ │ ├── terminal │ │ │ └── ReaderService.java │ │ └── treasury │ │ │ ├── InboundTransferService.java │ │ │ ├── OutboundPaymentService.java │ │ │ ├── OutboundTransferService.java │ │ │ ├── ReceivedCreditService.java │ │ │ └── ReceivedDebitService.java │ ├── treasury │ │ ├── CreditReversalService.java │ │ ├── DebitReversalService.java │ │ ├── FinancialAccountFeaturesService.java │ │ ├── FinancialAccountService.java │ │ ├── InboundTransferService.java │ │ ├── OutboundPaymentService.java │ │ ├── OutboundTransferService.java │ │ ├── ReceivedCreditService.java │ │ ├── ReceivedDebitService.java │ │ ├── TransactionEntryService.java │ │ └── TransactionService.java │ └── v2 │ │ ├── BillingService.java │ │ ├── CoreService.java │ │ ├── billing │ │ ├── MeterEventAdjustmentService.java │ │ ├── MeterEventService.java │ │ ├── MeterEventSessionService.java │ │ └── MeterEventStreamService.java │ │ └── core │ │ ├── EventDestinationService.java │ │ └── EventService.java │ ├── util │ ├── CaseInsensitiveMap.java │ ├── Stopwatch.java │ ├── StreamUtils.java │ └── StringUtils.java │ └── v2 │ ├── Amount.java │ └── EmptyStripeObject.java └── test ├── java └── com │ └── stripe │ ├── BaseStripeTest.java │ ├── DocumentationTest.java │ ├── RawRequestTest.java │ ├── StripeClientTest.java │ ├── StripeMockProcess.java │ ├── exception │ └── StripeExceptionTest.java │ ├── functional │ ├── AccountLinkTest.java │ ├── AccountTest.java │ ├── ApplePayDomainTest.java │ ├── ApplicationFeeTest.java │ ├── BalanceTest.java │ ├── BalanceTransactionTest.java │ ├── BankAccountTest.java │ ├── CardTest.java │ ├── ChargeTest.java │ ├── CountrySpecTest.java │ ├── CouponTest.java │ ├── CustomerTest.java │ ├── DeserializationTest.java │ ├── DisputeTest.java │ ├── EphemeralKeyTest.java │ ├── ErrorTest.java │ ├── EventTest.java │ ├── ExchangeRateTest.java │ ├── FeeRefundTest.java │ ├── FileLinkTest.java │ ├── FileTest.java │ ├── GeneratedExamples.java │ ├── InvoiceItemTest.java │ ├── InvoiceTest.java │ ├── LiveStripeResponseGetterTest.java │ ├── LoginLinkTest.java │ ├── MandateTest.java │ ├── PaymentIntentTest.java │ ├── PaymentMethodTest.java │ ├── PayoutTest.java │ ├── PersonTest.java │ ├── PlanTest.java │ ├── PriceTest.java │ ├── ProductTest.java │ ├── PromotionCodeTest.java │ ├── QuoteTest.java │ ├── RefundTest.java │ ├── RequestOptionsTest.java │ ├── ReversalTest.java │ ├── ReviewTest.java │ ├── SetupAttemptTest.java │ ├── SourceTest.java │ ├── StripeClientTest.java │ ├── StripeObjectTest.java │ ├── StripeResponseStreamTest.java │ ├── StripeResponseTest.java │ ├── SubscriptionItemTest.java │ ├── SubscriptionScheduleTest.java │ ├── SubscriptionTest.java │ ├── TaxCodeTest.java │ ├── TelemetryTest.java │ ├── TimeoutTest.java │ ├── TokenTest.java │ ├── TopupTest.java │ ├── TransferTest.java │ ├── WebhookEndpointTest.java │ ├── billingportal │ │ ├── ConfigurationTest.java │ │ └── SessionTest.java │ ├── checkout │ │ └── SessionTest.java │ ├── identity │ │ ├── VerificationReportTest.java │ │ └── VerificationSessionTest.java │ ├── issuing │ │ ├── AuthorizationTest.java │ │ ├── CardTest.java │ │ ├── CardholderTest.java │ │ ├── DisputeTest.java │ │ └── TransactionTest.java │ ├── radar │ │ ├── ValueListItemTest.java │ │ └── ValueListTest.java │ ├── reporting │ │ ├── ReportRunTest.java │ │ └── ReportTypeTest.java │ ├── sigma │ │ └── ScheduledQueryRunTest.java │ ├── terminal │ │ ├── ConnectionTokenTest.java │ │ ├── LocationTest.java │ │ └── ReaderTest.java │ └── v2 │ │ └── StripeCollectionTest.java │ ├── model │ ├── AccountLinkTest.java │ ├── AccountTest.java │ ├── ApplePayDomainTest.java │ ├── ApplicationFeeTest.java │ ├── BalanceTest.java │ ├── BalanceTransactionTest.java │ ├── ChargeLevel3Test.java │ ├── ChargeOutcomeTest.java │ ├── ChargeTest.java │ ├── CountrySpecTest.java │ ├── CouponTest.java │ ├── DisputeTest.java │ ├── EphemeralKeyTest.java │ ├── EventDataDeserializerTest.java │ ├── EventDataObjectDeserializerTest.java │ ├── EventTest.java │ ├── ExchangeRateTest.java │ ├── ExpandableFieldDeserializerTest.java │ ├── ExpandableFieldSerializerTest.java │ ├── ExpandableFieldTest.java │ ├── ExternalAccountDeserializationTest.java │ ├── FeeRefundTest.java │ ├── FileLinkTest.java │ ├── FileTest.java │ ├── InstantDeserializerTest.java │ ├── InstantSerializerTest.java │ ├── InvoiceItemTest.java │ ├── InvoiceTest.java │ ├── LineItemTest.java │ ├── LoginLinkTest.java │ ├── MandateTest.java │ ├── PagingIteratorTest.java │ ├── PaymentIntentTest.java │ ├── PaymentMethodTest.java │ ├── PayoutTest.java │ ├── PersonTest.java │ ├── PlanTest.java │ ├── PriceTest.java │ ├── ProductTest.java │ ├── PromotionCodeTest.java │ ├── QuoteTest.java │ ├── RefundTest.java │ ├── ReversalTest.java │ ├── ReviewTest.java │ ├── SearchPagingIteratorTest.java │ ├── SetupAttemptTest.java │ ├── SourceMandateNotificationTest.java │ ├── SourceTest.java │ ├── SourceTransactionTest.java │ ├── StandardizationTest.java │ ├── StripeErrorTest.java │ ├── SubscriptionItemTest.java │ ├── SubscriptionScheduleTest.java │ ├── SubscriptionTest.java │ ├── TaxCodeTest.java │ ├── TaxRateTest.java │ ├── TokenTest.java │ ├── TopupTest.java │ ├── TransferTest.java │ ├── WebhookEndpointTest.java │ ├── billingportal │ │ └── SessionTest.java │ ├── issuing │ │ ├── AuthorizationTest.java │ │ ├── CardTest.java │ │ ├── CardholderTest.java │ │ ├── DisputeTest.java │ │ └── TransactionTest.java │ ├── oauth │ │ └── OAuthErrorTest.java │ ├── radar │ │ ├── ValueListItemTest.java │ │ └── ValueListTest.java │ ├── reporting │ │ ├── ReportRunTest.java │ │ └── ReportTypeTest.java │ ├── sigma │ │ └── ScheduledQueryRunTest.java │ ├── terminal │ │ ├── ConnectionTokenTest.java │ │ ├── LocationTest.java │ │ └── ReaderTest.java │ └── v2 │ │ └── EventTests.java │ ├── net │ ├── ApiRequestParamsConverterTest.java │ ├── ApiRequestParamsTest.java │ ├── ApiResourceTest.java │ ├── ClientOptionsTest.java │ ├── FormEncoderTest.java │ ├── HttpClientTest.java │ ├── HttpContentTest.java │ ├── HttpHeadersTest.java │ ├── JsonEncoderTest.java │ ├── OAuthTest.java │ ├── RequestOptionsTest.java │ ├── StripeRequestTest.java │ ├── StripeResponseTest.java │ ├── TestStripeResponseGetterOptions.java │ ├── UntypedMapDeserializerTest.java │ └── WebhookTest.java │ ├── param │ ├── ChargeUpdateParamsTest.java │ ├── FileCreateParamsTest.java │ └── issuing │ │ └── TransactionUpdateParamsTest.java │ ├── util │ ├── CaseInsensitiveMapTest.java │ ├── StopwatchTest.java │ ├── StreamUtilsTest.java │ └── StringUtilsTest.java │ └── v2 │ ├── AmountTest.java │ └── InstantTest.java ├── openapi └── README.md └── resources ├── api_fixtures ├── account_application_deauthorized_old_version.json ├── account_link.json ├── balance_transaction_collection_with_source_expansion.json ├── balance_transaction_expansion.json ├── bank_account.json ├── billing_meter.json ├── billingportal │ └── session.json ├── card.json ├── charge_level3.json ├── charge_outcome.json ├── customer_created.json ├── customer_with_sources_and_tax_ids.json ├── ephemeral_key.json ├── error_invalid_request.json ├── error_v2_outbound_payment_insufficient_funds.json ├── event_plan.json ├── external_account_collection.json ├── invoice_with_discount_ids.json ├── invoice_with_discount_objects.json ├── invoiceitem_with_discount_ids.json ├── invoiceitem_with_discount_objects.json ├── line_item.json ├── login_link.json ├── order_item_parent_expansions.json ├── payment_intent.json ├── payment_intent_last_payment_error.json ├── payment_intent_old_next_source_action_authorize_with_url.json ├── payment_intent_old_next_source_action_value.json ├── payment_intent_with_expansions.json ├── payout_with_del_ext_bank_acct_expansion.json ├── person_old_document_expanded.json ├── person_old_document_unexpanded.json ├── setup_attempt.json ├── source_detached.json ├── source_mandate_notification.json ├── source_mandate_notification_event.json ├── source_transactions.json ├── subscription.json ├── terminal │ └── connection_token.json ├── usage_record.json └── usage_record_summary.json ├── model_fixtures ├── pageable_model_page_0.json ├── pageable_model_page_1.json ├── pageable_model_page_2.json ├── searchable_model_page_0.json ├── searchable_model_page_1.json └── searchable_model_page_2.json ├── oauth_fixtures ├── error_invalid_client.json └── token_response.json └── test.png /.editorconfig: -------------------------------------------------------------------------------- 1 | # see http://editorconfig.org/ 2 | 3 | root = true 4 | 5 | [*] 6 | charset = utf-8 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.java] 12 | indent_style = space 13 | indent_size = 2 14 | 15 | [*.json] 16 | indent_style = space 17 | indent_size = 2 18 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | gradlew linguist-generated=true 2 | gradlew.bat linguist-generated=true 3 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # All files should be reviewed by a member of the SDKs team 2 | * @stripe/api-library-reviewers 3 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: Stripe support 4 | url: https://support.stripe.com/ 5 | about: | 6 | Please only file issues here that you believe represent actual bugs or feature requests for the Stripe Java client library. 7 | 8 | If you're having general trouble with your Stripe integration, please reach out to support. 9 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Suggest an idea for this library 3 | labels: ["feature-request"] 4 | body: 5 | - type: markdown 6 | attributes: 7 | value: | 8 | Thanks for taking the time to fill out this feature request! 9 | - type: textarea 10 | id: problem 11 | attributes: 12 | label: Is your feature request related to a problem? Please describe. 13 | description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 14 | - type: textarea 15 | id: solution 16 | attributes: 17 | label: Describe the solution you'd like 18 | description: A clear and concise description of what you want to happen. 19 | - type: textarea 20 | id: alternatives 21 | attributes: 22 | label: Describe alternatives you've considered 23 | description: A clear and concise description of any alternative solutions or features you've considered. 24 | - type: textarea 25 | id: context 26 | attributes: 27 | label: Additional context 28 | description: Add any other context about the feature request here. 29 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ### Why? 2 | 3 | 4 | ### What? 5 | 9 | 10 | ### See Also 11 | 12 | -------------------------------------------------------------------------------- /.github/workflows/rules.yml: -------------------------------------------------------------------------------- 1 | 2 | name: rules 3 | 4 | on: 5 | workflow_dispatch: {} 6 | pull_request: 7 | types: 8 | - auto_merge_enabled 9 | 10 | jobs: 11 | require_merge_commit_on_merge_script_pr: 12 | name: Merge script PRs must create merge commits 13 | if: ${{ contains(github.head_ref, '/merge-') }} 14 | runs-on: ubuntu-latest 15 | steps: 16 | - run: | 17 | if ${{ github.event.pull_request.auto_merge.merge_method != 'merge' }}; then 18 | echo "Auto-merge method must be 'merge' instead of '${{github.event.pull_request.auto_merge.merge_method}}'" 19 | exit 1 20 | fi 21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | .classpath 3 | .project 4 | .settings 5 | tags 6 | target 7 | .idea 8 | *.iml 9 | .DS_Store 10 | 11 | # Gradle files 12 | .gradle/* 13 | build/* 14 | out/* 15 | 16 | # compiler output 17 | bin/ 18 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "EditorConfig.editorconfig", // default 4 | "redhat.java", // LSP 5 | "vscjava.vscode-java-debug", // debugger 6 | "vscjava.vscode-gradle", // gradle support 7 | "vscjava.vscode-java-test", // test runner 8 | "richardwillis.vscode-spotless-gradle" // formatting 9 | ], 10 | "unwantedRecommendations": [ 11 | "naco-siren.gradle-language", // old gradle 12 | "vscjava.vscode-java-pack" // has extra stuff, we've pulled the important parts out above 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | // Show the repo name in the top window bar. 3 | "window.title": "${rootName}${separator}${activeEditorMedium}", 4 | 5 | "editor.renderWhitespace": "all", 6 | "[java]": { 7 | "editor.rulers": [100], 8 | // use spotless for formatting (to match makefile) 9 | "spotlessGradle.format.enable": true, 10 | // don't show formatting issues as errors, just fix on save 11 | "spotlessGradle.diagnostics.enable": false, 12 | "editor.defaultFormatter": "richardwillis.vscode-spotless-gradle", 13 | "editor.codeActionsOnSave": { 14 | "source.fixAll.spotlessGradle": "explicit", 15 | // let spotless handle organizing imports, not the more general tooling 16 | "source.organizeImports": "never" 17 | } 18 | }, 19 | "java.configuration.updateBuildConfiguration": "automatic", 20 | // LSP was ooming and it recommended this change 21 | // (jar) added -Xss8m so lombok would run without stack overflowing 22 | // (xavdid) added -Xmx8G so LSP would be happy 23 | "java.jdt.ls.vmargs": "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -Dsun.zip.disableMemoryMapping=true -Xmx8G -Xms100m -Xlog:disable -Xss8m", 24 | "java.test.config": { 25 | "vmargs": ["-Dstripe.disallowGlobalResponseGetterFallback=true"] 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- 1 | CHANGELOG has changed to be Markdown-formatted. Please see CHANGELOG.md. 2 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2011- Stripe, Inc. (https://stripe.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # NOTE: this file is deprecated and slated for deletion; prefer using the equivalent `just` commands. 2 | 3 | .PHONY: update-version codegen-format 4 | update-version: 5 | @echo "$(VERSION)" > VERSION 6 | @perl -pi -e 's|badge/maven--central-v[.\d\-\w]+-blue|badge/maven--central-v$(VERSION)-blue|' README.md 7 | @perl -pi -e 's|https:\/\/search\.maven\.org\/remotecontent\?filepath=com\/stripe\/stripe-java\/[.\d\-\w]+\/stripe-java-[.\d\-\w]+.jar|https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/$(VERSION)/stripe-java-$(VERSION).jar|' README.md 8 | @perl -pi -e 's|implementation "com\.stripe:stripe-java:[.\d\-\w]+"|implementation "com.stripe:stripe-java:$(VERSION)"|' README.md 9 | @perl -pi -e 's|[.\d\-\w]+<\/version>|$(VERSION)|' README.md 10 | @perl -pi -e 's|VERSION_NAME=[.\d\-\w]+|VERSION_NAME=$(VERSION)|' gradle.properties 11 | @perl -pi -e 's|public static final String VERSION = "[.\d\-\w]+";|public static final String VERSION = "$(VERSION)";|' src/main/java/com/stripe/Stripe.java 12 | 13 | codegen-format: 14 | ./gradlew spotlessApply 15 | 16 | test: 17 | ./gradlew test 18 | 19 | ci-test: 20 | ./gradlew test 21 | -------------------------------------------------------------------------------- /OPENAPI_VERSION: -------------------------------------------------------------------------------- 1 | v1773 2 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 29.2.0 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stripe/stripe-java/d177cbc62bb595399e298288fe9803c1d213a3ac/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | config.stopBubbling = true 2 | lombok.addLombokGeneratedAnnotation = true 3 | lombok.getter.noIsPrefix = true 4 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/ApiVersion.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe; 3 | 4 | final class ApiVersion { 5 | public static final String CURRENT = "2025-05-28.basil"; 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/events/V2CoreEventDestinationPingEvent.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.events; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import com.stripe.exception.StripeException; 6 | import com.stripe.model.v2.Event; 7 | import com.stripe.model.v2.EventDestination; 8 | import lombok.Getter; 9 | 10 | @Getter 11 | public final class V2CoreEventDestinationPingEvent extends Event { 12 | @SerializedName("related_object") 13 | 14 | /** Object containing the reference to API resource relevant to the event. */ 15 | RelatedObject relatedObject; 16 | 17 | /** Retrieves the related object from the API. Make an API request on every call. */ 18 | public EventDestination fetchRelatedObject() throws StripeException { 19 | return (EventDestination) super.fetchRelatedObject(this.relatedObject); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/examples/ExampleTemplate.java: -------------------------------------------------------------------------------- 1 | package com.stripe.examples; 2 | 3 | /** 4 | * This is a template for defining new examples. It is not intended to be used directly. 5 | * 6 | *

describe what this example does 7 | * 8 | *

In this example, we: 9 | * 10 | *

15 | * 16 | *

describe assumptions about the user's stripe account, environment, or configuration; or things 17 | * to watch out for when running 18 | */ 19 | public class ExampleTemplate { 20 | 21 | @SuppressWarnings("unused") 22 | private String apiKey; 23 | 24 | public ExampleTemplate(String apiKey) { 25 | this.apiKey = apiKey; 26 | } 27 | 28 | @SuppressWarnings("CatchAndPrintStackTrace") 29 | public void doSomethingGreat() { 30 | 31 | try { 32 | System.out.println("Hello World"); 33 | // StripeClient client = new StripeClient(this.apiKey); 34 | // client.v2().... 35 | } catch (Exception e) { 36 | e.printStackTrace(); 37 | } 38 | } 39 | 40 | public static void main(String[] args) { 41 | String apiKey = "{{API_KEY}}"; 42 | 43 | ExampleTemplate example = new ExampleTemplate(apiKey); 44 | example.doSomethingGreat(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/ApiConnectionException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | public class ApiConnectionException extends StripeException { 4 | private static final long serialVersionUID = 2L; 5 | 6 | public ApiConnectionException(String message) { 7 | this(message, null); 8 | } 9 | 10 | public ApiConnectionException(String message, Throwable e) { 11 | super(message, null, null, 0, e); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/ApiException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | public class ApiException extends StripeException { 4 | private static final long serialVersionUID = 2L; 5 | 6 | public ApiException( 7 | String message, String requestId, String code, Integer statusCode, Throwable e) { 8 | super(message, requestId, code, statusCode, e); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/ApiKeyMissingException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | /** 4 | * {@link ApiKeyMissingException} is thrown when the API key is not set for a request. The API key 5 | * for a request may be set either globally through {@link com.stripe.Stripe#apiKey} or through 6 | * {@link com.stripe.net.RequestOptions}. 7 | */ 8 | public class ApiKeyMissingException extends RuntimeException { 9 | private static final long serialVersionUID = 1L; 10 | 11 | /** Initializes a new instance of the {@link ApiKeyMissingException} with a message. */ 12 | public ApiKeyMissingException(String message) { 13 | super(message); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/AuthenticationException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | public class AuthenticationException extends StripeException { 4 | private static final long serialVersionUID = 2L; 5 | 6 | public AuthenticationException( 7 | String message, String requestId, String code, Integer statusCode) { 8 | super(message, requestId, code, statusCode); 9 | } 10 | 11 | public AuthenticationException( 12 | String message, String requestId, String code, Integer statusCode, Throwable e) { 13 | super(message, requestId, code, statusCode, e); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/CardException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class CardException extends StripeException { 7 | private static final long serialVersionUID = 2L; 8 | 9 | private String param; 10 | private String declineCode; 11 | private String charge; 12 | 13 | /** Constructs a new card exception with the specified details. */ 14 | public CardException( 15 | String message, 16 | String requestId, 17 | String code, 18 | String param, 19 | String declineCode, 20 | String charge, 21 | Integer statusCode, 22 | Throwable e) { 23 | super(message, requestId, code, statusCode, e); 24 | this.param = param; 25 | this.declineCode = declineCode; 26 | this.charge = charge; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/EventDataObjectDeserializationException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | import com.stripe.model.EventDataObjectDeserializer; 4 | import lombok.Getter; 5 | 6 | public class EventDataObjectDeserializationException extends StripeException { 7 | private static final long serialVersionUID = 2L; 8 | 9 | /** 10 | * JSON intended as event data object {@link EventDataObjectDeserializer#getObject()} that fails 11 | * deserialization. 12 | */ 13 | @Getter private final String rawJson; 14 | 15 | public EventDataObjectDeserializationException(String message, String rawJson) { 16 | super(message, null, null, null); 17 | this.rawJson = rawJson; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/IdempotencyException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | public class IdempotencyException extends StripeException { 4 | private static final long serialVersionUID = 2L; 5 | 6 | public IdempotencyException(String message, String requestId, String code, Integer statusCode) { 7 | super(message, requestId, code, statusCode); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/InvalidRequestException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class InvalidRequestException extends StripeException { 7 | private static final long serialVersionUID = 2L; 8 | 9 | private final String param; 10 | 11 | public InvalidRequestException( 12 | String message, 13 | String param, 14 | String requestId, 15 | String code, 16 | Integer statusCode, 17 | Throwable e) { 18 | super(message, requestId, code, statusCode, e); 19 | this.param = param; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/PermissionException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | public class PermissionException extends AuthenticationException { 4 | private static final long serialVersionUID = 2L; 5 | 6 | public PermissionException(String message, String requestId, String code, Integer statusCode) { 7 | super(message, requestId, code, statusCode); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/RateLimitException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | public class RateLimitException extends InvalidRequestException { 4 | private static final long serialVersionUID = 2L; 5 | 6 | public RateLimitException( 7 | String message, 8 | String param, 9 | String requestId, 10 | String code, 11 | Integer statusCode, 12 | Throwable e) { 13 | super(message, param, requestId, code, statusCode, e); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/SignatureVerificationException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception; 2 | 3 | import lombok.Getter; 4 | 5 | @Getter 6 | public class SignatureVerificationException extends StripeException { 7 | private static final long serialVersionUID = 2L; 8 | 9 | private final String sigHeader; 10 | 11 | public SignatureVerificationException(String message, String sigHeader) { 12 | super(message, null, null, 0); 13 | this.sigHeader = sigHeader; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/InvalidClientException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | /** InvalidClientException is raised when authentication fails. */ 4 | public class InvalidClientException extends OAuthException { 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidClientException( 8 | String code, String description, String requestId, Integer statusCode, Throwable e) { 9 | super(code, description, requestId, statusCode, e); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/InvalidGrantException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | /** 4 | * InvalidGrantException is raised when a specified code doesn't exist, is expired, has been used, 5 | * or doesn't belong to you; a refresh token doesn't exist, or doesn't belong to you; or if an API 6 | * key's mode (live or test) doesn't match the mode of a code or refresh token. 7 | */ 8 | public class InvalidGrantException extends OAuthException { 9 | private static final long serialVersionUID = 2L; 10 | 11 | public InvalidGrantException( 12 | String code, String description, String requestId, Integer statusCode, Throwable e) { 13 | super(code, description, requestId, statusCode, e); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/InvalidRequestException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | /** 4 | * InvalidRequestException is raised when a code, refresh token, or grant type parameter is not 5 | * provided, but was required. 6 | */ 7 | public class InvalidRequestException extends OAuthException { 8 | private static final long serialVersionUID = 2L; 9 | 10 | public InvalidRequestException( 11 | String code, String description, String requestId, Integer statusCode, Throwable e) { 12 | super(code, description, requestId, statusCode, e); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/InvalidScopeException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | /** InvalidScopeException is raised when an invalid scope parameter is provided. */ 4 | public class InvalidScopeException extends OAuthException { 5 | private static final long serialVersionUID = 2L; 6 | 7 | public InvalidScopeException( 8 | String code, String description, String requestId, Integer statusCode, Throwable e) { 9 | super(code, description, requestId, statusCode, e); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/OAuthException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | import com.stripe.exception.StripeException; 4 | import com.stripe.model.oauth.OAuthError; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | /** Base parent class for all OAuth exceptions. */ 9 | @Getter 10 | public class OAuthException extends StripeException { 11 | private static final long serialVersionUID = 2L; 12 | 13 | /** The error resource returned by Stripe's OAuth API that caused the exception. */ 14 | @SuppressWarnings("serial") 15 | @Setter 16 | OAuthError oauthError; 17 | 18 | public OAuthException( 19 | String code, String description, String requestId, Integer statusCode, Throwable e) { 20 | super(description, requestId, code, statusCode, e); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/UnsupportedGrantTypeException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | /** 4 | * UnsupportedGrantTypeException is raised when an unuspported grant type parameter is specified. 5 | */ 6 | public class UnsupportedGrantTypeException extends OAuthException { 7 | private static final long serialVersionUID = 2L; 8 | 9 | public UnsupportedGrantTypeException( 10 | String code, String description, String requestId, Integer statusCode, Throwable e) { 11 | super(code, description, requestId, statusCode, e); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/exception/oauth/UnsupportedResponseTypeException.java: -------------------------------------------------------------------------------- 1 | package com.stripe.exception.oauth; 2 | 3 | /** 4 | * UnsupportedResponseTypeException is raised when an unsupported response type parameter is 5 | * specified. 6 | */ 7 | public class UnsupportedResponseTypeException extends OAuthException { 8 | private static final long serialVersionUID = 2L; 9 | 10 | public UnsupportedResponseTypeException( 11 | String code, String description, String requestId, Integer statusCode, Throwable e) { 12 | super(code, description, requestId, statusCode, e); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/AccountCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class AccountCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/Address.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | @Setter 11 | @EqualsAndHashCode(callSuper = false) 12 | public class Address extends StripeObject { 13 | /** City, district, suburb, town, or village. */ 14 | @SerializedName("city") 15 | String city; 16 | 17 | /** 18 | * Two-letter country code (ISO 3166-1 19 | * alpha-2). 20 | */ 21 | @SerializedName("country") 22 | String country; 23 | 24 | /** Address line 1 (e.g., street, PO Box, or company name). */ 25 | @SerializedName("line1") 26 | String line1; 27 | 28 | /** Address line 2 (e.g., apartment, suite, unit, or building). */ 29 | @SerializedName("line2") 30 | String line2; 31 | 32 | /** ZIP or postal code. */ 33 | @SerializedName("postal_code") 34 | String postalCode; 35 | 36 | /** State, county, province, or region. */ 37 | @SerializedName("state") 38 | String state; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ApplePayDomainCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ApplePayDomainCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/Application.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | @Setter 11 | @EqualsAndHashCode(callSuper = false) 12 | public class Application extends StripeObject implements HasId { 13 | /** Always true for a deleted object. */ 14 | @SerializedName("deleted") 15 | Boolean deleted; 16 | 17 | /** Unique identifier for the object. */ 18 | @Getter(onMethod_ = {@Override}) 19 | @SerializedName("id") 20 | String id; 21 | 22 | /** The name of the application. */ 23 | @SerializedName("name") 24 | String name; 25 | 26 | /** 27 | * String representing the object's type. Objects of the same type share the same value. 28 | * 29 | *

Equal to {@code application}. 30 | */ 31 | @SerializedName("object") 32 | String object; 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ApplicationFeeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ApplicationFeeCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/BalanceTransactionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class BalanceTransactionCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/BalanceTransactionSource.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public interface BalanceTransactionSource extends StripeObjectInterface, HasId {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ChargeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ChargeCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ChargeSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ChargeSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/CountrySpecCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class CountrySpecCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/CouponCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class CouponCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/CreditNoteCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class CreditNoteCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/CustomerCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class CustomerCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/CustomerSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class CustomerSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/DisputeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class DisputeCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/EphemeralKeyDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.FieldNamingPolicy; 4 | import com.google.gson.Gson; 5 | import com.google.gson.GsonBuilder; 6 | import com.google.gson.JsonDeserializationContext; 7 | import com.google.gson.JsonDeserializer; 8 | import com.google.gson.JsonElement; 9 | import com.google.gson.JsonParseException; 10 | import java.lang.reflect.Type; 11 | 12 | public class EphemeralKeyDeserializer implements JsonDeserializer { 13 | /** Deserializes an ephemeral_key JSON payload into an {@link EphemeralKey} object. */ 14 | @Override 15 | public EphemeralKey deserialize( 16 | JsonElement json, Type typeOfT, JsonDeserializationContext context) 17 | throws JsonParseException { 18 | Gson gson = 19 | new GsonBuilder() 20 | .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) 21 | .create(); 22 | 23 | EphemeralKey result = gson.fromJson(json, EphemeralKey.class); 24 | result.setRawJson(json.getAsJsonObject().toString()); 25 | return result; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/EventCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class EventCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/EventRequestDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.FieldNamingPolicy; 4 | import com.google.gson.Gson; 5 | import com.google.gson.GsonBuilder; 6 | import com.google.gson.JsonDeserializationContext; 7 | import com.google.gson.JsonDeserializer; 8 | import com.google.gson.JsonElement; 9 | import com.google.gson.JsonParseException; 10 | import java.lang.reflect.Type; 11 | 12 | public class EventRequestDeserializer implements JsonDeserializer { 13 | 14 | /** 15 | * Deserializes the JSON payload contained in an event's {@code request} attribute into an {@link 16 | * Event.Request} instance. 17 | */ 18 | @Override 19 | public Event.Request deserialize( 20 | JsonElement json, Type typeOfT, JsonDeserializationContext context) 21 | throws JsonParseException { 22 | Gson gson = 23 | new GsonBuilder() 24 | .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) 25 | .create(); 26 | 27 | // API versions 2017-05-25 and earlier render `request` as a string 28 | // instead of a JSON object 29 | if (json.isJsonPrimitive()) { 30 | Event.Request request = new Event.Request(); 31 | request.setId(json.getAsString()); 32 | return request; 33 | } else { 34 | return gson.fromJson(json, typeOfT); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ExchangeRateCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ExchangeRateCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ExpandableField.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.net.StripeResponseGetter; 4 | 5 | // This class is meant to be used for expandable fields in the Stripe API. 6 | // For example, ExpandableField in Charge. 7 | // The class should always contain a String id, and may have a null or type T expandedObject. 8 | // More info here: https://stripe.com/docs/api#expanding_objects 9 | public class ExpandableField implements StripeActiveObject { 10 | private String id; 11 | private T expandedObject; 12 | 13 | public ExpandableField(String id, T expandedObject) { 14 | this.id = id; 15 | this.expandedObject = expandedObject; 16 | } 17 | 18 | public boolean isExpanded() { 19 | return expandedObject != null; 20 | } 21 | 22 | public String getId() { 23 | return id; 24 | } 25 | 26 | public void setId(String id) { 27 | this.id = id; 28 | } 29 | 30 | public T getExpanded() { 31 | return expandedObject; 32 | } 33 | 34 | public void setExpanded(T expandedObject) { 35 | this.expandedObject = expandedObject; 36 | } 37 | 38 | @Override 39 | public void setResponseGetter(StripeResponseGetter responseGetter) { 40 | trySetResponseGetter(expandedObject, responseGetter); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ExpandableFieldSerializer.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonPrimitive; 5 | import com.google.gson.JsonSerializationContext; 6 | import com.google.gson.JsonSerializer; 7 | import java.lang.reflect.Type; 8 | 9 | public class ExpandableFieldSerializer implements JsonSerializer> { 10 | /** Serializes an expandable attribute into a JSON string. */ 11 | @Override 12 | public JsonElement serialize( 13 | ExpandableField src, Type typeOfSrc, JsonSerializationContext context) { 14 | if (src.isExpanded()) { 15 | return context.serialize(src.getExpanded()); 16 | } else if (src.getId() != null) { 17 | return new JsonPrimitive(src.getId()); 18 | } else { 19 | return null; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ExternalAccount.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | import com.stripe.exception.StripeException; 5 | import com.stripe.net.RequestOptions; 6 | import java.util.Map; 7 | 8 | public interface ExternalAccount extends StripeObjectInterface, HasId { 9 | ExternalAccount delete(Map params, RequestOptions options) throws StripeException; 10 | 11 | ExternalAccount delete() throws StripeException; 12 | 13 | ExternalAccount delete(RequestOptions options) throws StripeException; 14 | 15 | ExternalAccount delete(Map params) throws StripeException; 16 | 17 | ExternalAccount update(Map params, RequestOptions options) throws StripeException; 18 | 19 | ExternalAccount update(Map params) throws StripeException; 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/FileCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class FileCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/FileLinkCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class FileLinkCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/HasId.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | public interface HasId { 4 | String getId(); 5 | } 6 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InstantDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.*; 4 | import java.lang.reflect.Type; 5 | import java.time.Instant; 6 | 7 | public class InstantDeserializer implements JsonDeserializer, JsonSerializer { 8 | /** Deserializes an timestamp JSON payload into an {@link java.time.Instant} object. */ 9 | @Override 10 | public Instant deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) 11 | throws JsonParseException { 12 | if (json.isJsonNull()) { 13 | return null; 14 | } 15 | 16 | if (json.isJsonPrimitive()) { 17 | JsonPrimitive jsonPrimitive = json.getAsJsonPrimitive(); 18 | if (jsonPrimitive.isString()) { 19 | return Instant.parse(jsonPrimitive.getAsString()); 20 | } 21 | 22 | throw new JsonParseException("Instant is a non-string primitive type."); 23 | } 24 | 25 | throw new JsonParseException("Instant is a non-primitive type."); 26 | } 27 | 28 | @Override 29 | public JsonElement serialize(Instant src, Type typeOfSrc, JsonSerializationContext context) { 30 | return new JsonPrimitive(src.toString()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InstantSerializer.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonPrimitive; 5 | import com.google.gson.JsonSerializationContext; 6 | import com.google.gson.JsonSerializer; 7 | import java.lang.reflect.Type; 8 | import java.time.Instant; 9 | 10 | public class InstantSerializer implements JsonSerializer { 11 | /** Serializes an Instant into a JSON string in ISO 8601 format. */ 12 | @Override 13 | public JsonElement serialize(Instant src, Type typeOfSrc, JsonSerializationContext context) { 14 | if (src != null) { 15 | return new JsonPrimitive(src.toString()); 16 | } 17 | return null; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InvoiceCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class InvoiceCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InvoiceItemCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class InvoiceItemCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InvoicePaymentCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class InvoicePaymentCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InvoiceRenderingTemplateCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class InvoiceRenderingTemplateCollection 5 | extends StripeCollection {} 6 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/InvoiceSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class InvoiceSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/LineItemCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class LineItemCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/MetadataStore.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.exception.StripeException; 4 | import com.stripe.net.RequestOptions; 5 | import java.util.Map; 6 | 7 | /** Common interface for Stripe objects that can store metadata. */ 8 | public interface MetadataStore { 9 | Map getMetadata(); 10 | 11 | MetadataStore update(Map params) throws StripeException; 12 | 13 | MetadataStore update(Map params, RequestOptions options) 14 | throws StripeException; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PagingIterable.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.net.StripeResponseGetter; 4 | import java.lang.reflect.Type; 5 | import java.util.Iterator; 6 | 7 | /** 8 | * Provides an {@code Iterable} target that automatically iterates across all API 9 | * pages and which is suitable for use with a {@code foreach} loop. 10 | */ 11 | public class PagingIterable implements Iterable { 12 | private final StripeCollectionInterface page; 13 | private final StripeResponseGetter responseGetter; 14 | private final Type pageType; 15 | 16 | PagingIterable( 17 | final StripeCollectionInterface page, StripeResponseGetter responseGetter, Type pageType) { 18 | 19 | this.page = page; 20 | this.responseGetter = responseGetter; 21 | this.pageType = pageType; 22 | } 23 | 24 | @Override 25 | public Iterator iterator() { 26 | return new PagingIterator<>(page, responseGetter, pageType); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentIntentCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PaymentIntentCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentIntentSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PaymentIntentSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentLinkCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PaymentLinkCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentMethodCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PaymentMethodCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentMethodConfigurationCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PaymentMethodConfigurationCollection 5 | extends StripeCollection {} 6 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentMethodDomainCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PaymentMethodDomainCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PaymentSource.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public interface PaymentSource extends StripeObjectInterface, HasId {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PayoutCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PayoutCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PlanCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PlanCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PriceCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PriceCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PriceSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PriceSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ProductCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ProductCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ProductFeatureCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ProductFeatureCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ProductSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ProductSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/PromotionCodeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class PromotionCodeCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/QuoteCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class QuoteCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ReserveTransaction.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | @Setter 11 | @EqualsAndHashCode(callSuper = false) 12 | public class ReserveTransaction extends StripeObject implements BalanceTransactionSource { 13 | @SerializedName("amount") 14 | Long amount; 15 | 16 | /** 17 | * Three-letter ISO currency code, 18 | * in lowercase. Must be a supported currency. 19 | */ 20 | @SerializedName("currency") 21 | String currency; 22 | 23 | /** An arbitrary string attached to the object. Often useful for displaying to users. */ 24 | @SerializedName("description") 25 | String description; 26 | 27 | /** Unique identifier for the object. */ 28 | @Getter(onMethod_ = {@Override}) 29 | @SerializedName("id") 30 | String id; 31 | 32 | /** 33 | * String representing the object's type. Objects of the same type share the same value. 34 | * 35 | *

Equal to {@code reserve_transaction}. 36 | */ 37 | @SerializedName("object") 38 | String object; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ReviewCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ReviewCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SearchPagingIterable.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.net.StripeResponseGetter; 4 | import java.lang.reflect.Type; 5 | import java.util.Iterator; 6 | 7 | /** 8 | * Provides an {@code Iterable} target that automatically iterates across all API 9 | * pages and which is suitable for use with a {@code foreach} loop. 10 | */ 11 | public class SearchPagingIterable implements Iterable { 12 | private final StripeSearchResultInterface page; 13 | private final StripeResponseGetter responseGetter; 14 | private final Type pageType; 15 | 16 | SearchPagingIterable( 17 | final StripeSearchResultInterface page, 18 | StripeResponseGetter responseGetter, 19 | Type pageType) { 20 | this.page = page; 21 | this.responseGetter = responseGetter; 22 | this.pageType = pageType; 23 | } 24 | 25 | @Override 26 | public Iterator iterator() { 27 | return new SearchPagingIterator<>(page, responseGetter, pageType); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SetupAttemptCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SetupAttemptCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SetupIntentCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SetupIntentCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ShippingDetails.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | @Setter 11 | @EqualsAndHashCode(callSuper = false) 12 | public class ShippingDetails extends StripeObject { 13 | @SerializedName("address") 14 | Address address; 15 | 16 | /** The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. */ 17 | @SerializedName("carrier") 18 | String carrier; 19 | 20 | /** Recipient name. */ 21 | @SerializedName("name") 22 | String name; 23 | 24 | /** Recipient phone (including extension). */ 25 | @SerializedName("phone") 26 | String phone; 27 | 28 | /** 29 | * The tracking number for a physical product, obtained from the delivery service. If multiple 30 | * tracking numbers were generated for this purchase, please separate them with commas. 31 | */ 32 | @SerializedName("tracking_number") 33 | String trackingNumber; 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ShippingRateCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class ShippingRateCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SourceTransactionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SourceTransactionCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/StripeActiveObject.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.net.StripeResponseGetter; 4 | 5 | /** 6 | * Represents a {@code StripeObject} that has properties or method that can make HTTP requests. 7 | * Examples: - list that can retrieve next page - event that can fetch associated object 8 | */ 9 | public interface StripeActiveObject { 10 | /** 11 | * Method is used by the containing object or {@code StripeResponseGetter} implementations to set 12 | * the {@code StripeResponseGetter} instance used to make further requests. 13 | * 14 | * @param responseGetter the {@code StripeResponseGetter} instance to use for making further 15 | * requests. 16 | */ 17 | void setResponseGetter(StripeResponseGetter responseGetter); 18 | 19 | /** 20 | * Calls {@code setResponseGetter} on the {@code object} if it's supported. 21 | * 22 | * @param object the object to set the {@code StripeResponseGetter} for. 23 | * @param responseGetter the {@code StripeResponseGetter} instance to use for making further 24 | * requests. 25 | */ 26 | default void trySetResponseGetter(Object object, StripeResponseGetter responseGetter) { 27 | if (object instanceof StripeActiveObject) { 28 | ((StripeActiveObject) object).setResponseGetter(responseGetter); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/StripeCollectionInterface.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.net.RequestOptions; 4 | import java.lang.reflect.Type; 5 | import java.util.List; 6 | import java.util.Map; 7 | 8 | public interface StripeCollectionInterface extends StripeObjectInterface { 9 | List getData(); 10 | 11 | Boolean getHasMore(); 12 | 13 | String getUrl(); 14 | 15 | /** 16 | * Get request options that were used to fetch the collection. This is useful for purposes of 17 | * pagination. 18 | */ 19 | RequestOptions getRequestOptions(); 20 | 21 | /** 22 | * Get request parameters that were used to fetch the collection. This is useful for purposes of 23 | * pagination. 24 | */ 25 | Map getRequestParams(); 26 | 27 | /** 28 | * Set request options that were used to fetch the collection. This is required for purposes of 29 | * pagination. 30 | */ 31 | void setRequestOptions(RequestOptions requestOptions); 32 | 33 | /** 34 | * Set request parameters that were used to fetch the collection. This is required for purposes of 35 | * pagination. 36 | */ 37 | void setRequestParams(Map requestParams); 38 | 39 | void setPageTypeToken(Type type); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/StripeObjectInterface.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.stripe.net.StripeResponse; 4 | 5 | public interface StripeObjectInterface { 6 | public StripeResponse getLastResponse(); 7 | 8 | public void setLastResponse(StripeResponse response); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/StripeRawJsonObject.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** Fallback class for when we do not recognize the object that we have received. */ 6 | public class StripeRawJsonObject extends StripeObject { 7 | JsonObject json; 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/StripeRawJsonObjectDeserializer.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.JsonDeserializationContext; 4 | import com.google.gson.JsonDeserializer; 5 | import com.google.gson.JsonElement; 6 | import com.google.gson.JsonParseException; 7 | import java.lang.reflect.Type; 8 | 9 | public class StripeRawJsonObjectDeserializer implements JsonDeserializer { 10 | /** Deserializes a JSON payload into a {@link StripeRawJsonObject} object. */ 11 | @Override 12 | public StripeRawJsonObject deserialize( 13 | JsonElement json, Type typeOfT, JsonDeserializationContext context) 14 | throws JsonParseException { 15 | StripeRawJsonObject object = new StripeRawJsonObject(); 16 | object.json = json.getAsJsonObject(); 17 | return object; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/StripeSearchResultInterface.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | public interface StripeSearchResultInterface extends StripeCollectionInterface { 4 | String getNextPage(); 5 | 6 | Long getTotalCount(); 7 | } 8 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SubscriptionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SubscriptionCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SubscriptionItemCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SubscriptionItemCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SubscriptionScheduleCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SubscriptionScheduleCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/SubscriptionSearchResult.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class SubscriptionSearchResult extends StripeSearchResult {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/TODO.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | /** 4 | * Represents a type that cannot properly be generated, due to a problem with the generator or a 5 | * non-standard API definition. 6 | */ 7 | public class TODO extends StripeObject {} 8 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/TaxCodeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class TaxCodeCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/TaxDeductedAtSource.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import lombok.EqualsAndHashCode; 6 | import lombok.Getter; 7 | import lombok.Setter; 8 | 9 | @Getter 10 | @Setter 11 | @EqualsAndHashCode(callSuper = false) 12 | public class TaxDeductedAtSource extends StripeObject implements BalanceTransactionSource { 13 | /** Unique identifier for the object. */ 14 | @Getter(onMethod_ = {@Override}) 15 | @SerializedName("id") 16 | String id; 17 | 18 | /** 19 | * String representing the object's type. Objects of the same type share the same value. 20 | * 21 | *

Equal to {@code tax_deducted_at_source}. 22 | */ 23 | @SerializedName("object") 24 | String object; 25 | 26 | /** 27 | * The end of the invoicing period. This TDS applies to Stripe fees collected during this 28 | * invoicing period. 29 | */ 30 | @SerializedName("period_end") 31 | Long periodEnd; 32 | 33 | /** 34 | * The start of the invoicing period. This TDS applies to Stripe fees collected during this 35 | * invoicing period. 36 | */ 37 | @SerializedName("period_start") 38 | Long periodStart; 39 | 40 | /** The TAN that was supplied to Stripe when TDS was assessed. */ 41 | @SerializedName("tax_deduction_account_number") 42 | String taxDeductionAccountNumber; 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/TaxRateCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class TaxRateCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/ThinEventRelatedObject.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import lombok.Getter; 5 | 6 | @Getter 7 | public class ThinEventRelatedObject { 8 | @SerializedName("id") 9 | public String id; 10 | 11 | @SerializedName("type") 12 | public String type; 13 | 14 | @SerializedName("url") 15 | public String url; 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/TopupCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class TopupCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/TransferCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class TransferCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/WebhookEndpointCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model; 3 | 4 | public class WebhookEndpointCollection extends StripeCollection {} 5 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/apps/SecretCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.apps; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class SecretCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/billing/AlertCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.billing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class AlertCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/billing/CreditBalanceTransactionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.billing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class CreditBalanceTransactionCollection 7 | extends StripeCollection {} 8 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/billing/CreditGrantCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.billing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class CreditGrantCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/billing/MeterCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.billing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class MeterCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/billing/MeterEventSummaryCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.billing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class MeterEventSummaryCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/billingportal/ConfigurationCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.billingportal; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ConfigurationCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/checkout/SessionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.checkout; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class SessionCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/climate/OrderCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.climate; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class OrderCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/climate/ProductCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.climate; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ProductCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/climate/SupplierCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.climate; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class SupplierCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/entitlements/ActiveEntitlementCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.entitlements; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ActiveEntitlementCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/entitlements/ActiveEntitlementSummary.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.entitlements; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import com.stripe.model.StripeObject; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | /** A summary of a customer's active entitlements. */ 11 | @Getter 12 | @Setter 13 | @EqualsAndHashCode(callSuper = false) 14 | public class ActiveEntitlementSummary extends StripeObject { 15 | /** The customer that is entitled to this feature. */ 16 | @SerializedName("customer") 17 | String customer; 18 | 19 | /** The list of entitlements this customer has. */ 20 | @SerializedName("entitlements") 21 | ActiveEntitlementCollection entitlements; 22 | 23 | /** 24 | * Has the value {@code true} if the object exists in live mode or the value {@code false} if the 25 | * object exists in test mode. 26 | */ 27 | @SerializedName("livemode") 28 | Boolean livemode; 29 | 30 | /** 31 | * String representing the object's type. Objects of the same type share the same value. 32 | * 33 | *

Equal to {@code entitlements.active_entitlement_summary}. 34 | */ 35 | @SerializedName("object") 36 | String object; 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/entitlements/FeatureCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.entitlements; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class FeatureCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/financialconnections/AccountCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.financialconnections; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class AccountCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/financialconnections/AccountOwnerCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.financialconnections; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class AccountOwnerCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/financialconnections/AccountOwnership.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.financialconnections; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import com.stripe.model.HasId; 6 | import com.stripe.model.StripeObject; 7 | import lombok.EqualsAndHashCode; 8 | import lombok.Getter; 9 | import lombok.Setter; 10 | 11 | /** Describes a snapshot of the owners of an account at a particular point in time. */ 12 | @Getter 13 | @Setter 14 | @EqualsAndHashCode(callSuper = false) 15 | public class AccountOwnership extends StripeObject implements HasId { 16 | /** Time at which the object was created. Measured in seconds since the Unix epoch. */ 17 | @SerializedName("created") 18 | Long created; 19 | 20 | /** Unique identifier for the object. */ 21 | @Getter(onMethod_ = {@Override}) 22 | @SerializedName("id") 23 | String id; 24 | 25 | /** 26 | * String representing the object's type. Objects of the same type share the same value. 27 | * 28 | *

Equal to {@code financial_connections.account_ownership}. 29 | */ 30 | @SerializedName("object") 31 | String object; 32 | 33 | /** A paginated list of owners for this account. */ 34 | @SerializedName("owners") 35 | AccountOwnerCollection owners; 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/financialconnections/TransactionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.financialconnections; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TransactionCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/forwarding/RequestCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.forwarding; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class RequestCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/identity/VerificationReportCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.identity; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class VerificationReportCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/identity/VerificationSessionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.identity; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class VerificationSessionCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/AuthorizationCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class AuthorizationCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/CardCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class CardCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/CardholderCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class CardholderCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/DisputeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class DisputeCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/PersonalizationDesignCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class PersonalizationDesignCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/PhysicalBundleCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class PhysicalBundleCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/TokenCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TokenCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/issuing/TransactionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.issuing; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TransactionCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/oauth/DeauthorizedAccount.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.oauth; 2 | 3 | import com.stripe.model.StripeObject; 4 | import lombok.EqualsAndHashCode; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @EqualsAndHashCode(callSuper = false) 11 | public class DeauthorizedAccount extends StripeObject { 12 | String stripeUserId; 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/oauth/OAuthError.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.oauth; 2 | 3 | import com.stripe.model.StripeObject; 4 | import lombok.EqualsAndHashCode; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @EqualsAndHashCode(callSuper = false) 11 | public class OAuthError extends StripeObject { 12 | String error; 13 | String errorDescription; 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/oauth/TokenResponse.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.oauth; 2 | 3 | import com.stripe.model.StripeObject; 4 | import lombok.EqualsAndHashCode; 5 | import lombok.Getter; 6 | import lombok.Setter; 7 | 8 | @Getter 9 | @Setter 10 | @EqualsAndHashCode(callSuper = false) 11 | public class TokenResponse extends StripeObject { 12 | Boolean livemode; 13 | String scope; 14 | String stripeUserId; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/radar/EarlyFraudWarningCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.radar; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class EarlyFraudWarningCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/radar/ValueListCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.radar; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ValueListCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/radar/ValueListItemCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.radar; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ValueListItemCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/reporting/ReportRunCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.reporting; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ReportRunCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/reporting/ReportTypeCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.reporting; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ReportTypeCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/sigma/ScheduledQueryRunCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.sigma; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ScheduledQueryRunCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/tax/CalculationLineItemCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.tax; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class CalculationLineItemCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/tax/RegistrationCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.tax; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class RegistrationCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/tax/TransactionLineItemCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.tax; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TransactionLineItemCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/terminal/ConfigurationCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.terminal; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ConfigurationCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/terminal/LocationCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.terminal; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class LocationCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/terminal/ReaderCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.terminal; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ReaderCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/testhelpers/TestClockCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.testhelpers; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TestClockCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/CreditReversalCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class CreditReversalCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/DebitReversalCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class DebitReversalCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/FinancialAccountCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class FinancialAccountCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/InboundTransferCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class InboundTransferCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/OutboundPaymentCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class OutboundPaymentCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/OutboundTransferCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class OutboundTransferCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/ReceivedCreditCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ReceivedCreditCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/ReceivedDebitCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class ReceivedDebitCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/TransactionCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TransactionCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/treasury/TransactionEntryCollection.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.model.treasury; 3 | 4 | import com.stripe.model.StripeCollection; 5 | 6 | public class TransactionEntryCollection extends StripeCollection {} 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/model/v2/StripeDeletedObject.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.v2; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.stripe.model.HasId; 5 | import com.stripe.model.StripeObject; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.Getter; 8 | import lombok.Setter; 9 | 10 | @Getter 11 | @Setter 12 | @EqualsAndHashCode(callSuper = false) 13 | public class StripeDeletedObject extends StripeObject implements HasId { 14 | /** Unique identifier for the object. */ 15 | @Getter(onMethod_ = {@Override}) 16 | @SerializedName("id") 17 | String id; 18 | 19 | /** String representing the object’s type. Objects of the same type share the same value. */ 20 | @SerializedName("object") 21 | String object; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/ApiMode.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | public enum ApiMode { 4 | V1, 5 | V2 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/ApiRequest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | import java.util.Map; 6 | import lombok.Getter; 7 | 8 | @Getter 9 | public class ApiRequest extends BaseApiRequest { 10 | private Map params; 11 | private final ApiMode apiMode; 12 | 13 | private ApiRequest( 14 | BaseAddress baseAddress, 15 | ApiResource.RequestMethod method, 16 | String path, 17 | RequestOptions options, 18 | List usage, 19 | Map params) { 20 | super(baseAddress, method, path, options, usage); 21 | this.params = params; 22 | this.apiMode = path.startsWith("/v2") ? ApiMode.V2 : ApiMode.V1; 23 | } 24 | 25 | public ApiRequest( 26 | BaseAddress baseAddress, 27 | ApiResource.RequestMethod method, 28 | String path, 29 | Map params, 30 | RequestOptions options) { 31 | this(baseAddress, method, path, options, null, params); 32 | } 33 | 34 | public ApiRequest addUsage(String usage) { 35 | List newUsage = new ArrayList<>(); 36 | if (this.getUsage() != null) { 37 | newUsage.addAll(this.getUsage()); 38 | } 39 | newUsage.add(usage); 40 | return new ApiRequest( 41 | this.getBaseAddress(), 42 | this.getMethod(), 43 | this.getPath(), 44 | this.getOptions(), 45 | newUsage, 46 | this.getParams()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/ApiResourceTypeAdapterFactoryProvider.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.net; 3 | 4 | import com.google.gson.TypeAdapterFactory; 5 | import com.stripe.model.BalanceTransactionSourceTypeAdapterFactory; 6 | import com.stripe.model.ExternalAccountTypeAdapterFactory; 7 | import com.stripe.model.PaymentSourceTypeAdapterFactory; 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | /** 12 | * Provider for all {@link TypeAdapterFactory} required for deserializing subtypes of an interface. 13 | */ 14 | final class ApiResourceTypeAdapterFactoryProvider { 15 | private static final List factories = new ArrayList<>(); 16 | 17 | static { 18 | factories.add(new BalanceTransactionSourceTypeAdapterFactory()); 19 | factories.add(new ExternalAccountTypeAdapterFactory()); 20 | factories.add(new PaymentSourceTypeAdapterFactory()); 21 | } 22 | 23 | public static List getAll() { 24 | return factories; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/ApiService.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import com.stripe.exception.StripeException; 4 | import com.stripe.model.StripeObjectInterface; 5 | import java.io.InputStream; 6 | import java.lang.reflect.Type; 7 | import lombok.AccessLevel; 8 | import lombok.Getter; 9 | 10 | /** The base class for all services. */ 11 | public abstract class ApiService { 12 | @Getter(AccessLevel.PROTECTED) 13 | private final StripeResponseGetter responseGetter; 14 | 15 | protected ApiService(StripeResponseGetter responseGetter) { 16 | this.responseGetter = responseGetter; 17 | } 18 | 19 | @SuppressWarnings("TypeParameterUnusedInFormals") 20 | protected T request(ApiRequest request, Type typeToken) 21 | throws StripeException { 22 | return this.getResponseGetter().request(request.addUsage("stripe_client"), typeToken); 23 | } 24 | 25 | protected InputStream requestStream(ApiRequest request) throws StripeException { 26 | return this.getResponseGetter().requestStream(request.addUsage("stripe_client")); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/Authenticator.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import com.stripe.exception.StripeException; 4 | 5 | /** * Represents a request authentication mechanism. */ 6 | public interface Authenticator { 7 | /** 8 | * * Authenticate the request 9 | * 10 | * @param request the request that need authentication. 11 | * @return the request with authentication headers applied. 12 | * @throws StripeException on authentication errors. 13 | */ 14 | StripeRequest authenticate(StripeRequest request) throws StripeException; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/BaseAddress.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | /** The base address to use for the request. */ 4 | public enum BaseAddress { 5 | /** https://api.stripe.com */ 6 | API, 7 | /** https://connect.stripe.com */ 8 | CONNECT, 9 | /** https://files.stripe.com */ 10 | FILES, 11 | /** https://meter-events.stripe.com */ 12 | METER_EVENTS 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/BaseApiRequest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import java.util.List; 4 | import lombok.AccessLevel; 5 | import lombok.AllArgsConstructor; 6 | import lombok.Getter; 7 | 8 | @Getter 9 | @AllArgsConstructor(access = AccessLevel.PROTECTED) 10 | class BaseApiRequest { 11 | private final BaseAddress baseAddress; 12 | private final ApiResource.RequestMethod method; 13 | private final String path; 14 | private final RequestOptions options; 15 | 16 | private final List usage; 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/JsonEncoder.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import com.google.gson.FieldNamingPolicy; 4 | import com.google.gson.Gson; 5 | import com.google.gson.GsonBuilder; 6 | import java.io.IOException; 7 | import java.util.HashMap; 8 | import java.util.Map; 9 | 10 | final class JsonEncoder { 11 | private static final Gson BODY_GSON = 12 | new GsonBuilder() 13 | .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) 14 | .serializeNulls() 15 | .create(); 16 | 17 | public static HttpContent createHttpContent(Map params) throws IOException { 18 | if (params == null) { 19 | params = new HashMap(); 20 | } 21 | return HttpContent.buildJsonContent(BODY_GSON.toJson(params)); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/KeyValuePair.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import java.util.AbstractMap; 4 | 5 | /** 6 | * A KeyValuePair holds a key and a value. This class is used to represent parameters when encoding 7 | * API requests. 8 | * 9 | * @param the type of the key 10 | * @param the type of the value 11 | */ 12 | public class KeyValuePair extends AbstractMap.SimpleEntry { 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 16 | * Initializes a new instance of the {@link KeyValuePair} class using the specified key and value. 17 | * 18 | * @param key the key 19 | * @param value the value 20 | */ 21 | public KeyValuePair(K key, V value) { 22 | super(key, value); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/StripeCollectionItemTypeSettingFactory.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.TypeAdapter; 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.google.gson.reflect.TypeToken; 7 | import com.google.gson.stream.JsonReader; 8 | import com.google.gson.stream.JsonWriter; 9 | import com.stripe.model.*; 10 | import java.io.IOException; 11 | 12 | class StripeCollectionItemTypeSettingFactory implements TypeAdapterFactory { 13 | @Override 14 | public TypeAdapter create(final Gson gson, final TypeToken type) { 15 | final TypeAdapter delegate = gson.getDelegateAdapter(this, type); 16 | 17 | return new TypeAdapter() { 18 | @Override 19 | public void write(JsonWriter out, T value) throws IOException { 20 | delegate.write(out, value); 21 | } 22 | 23 | @Override 24 | public T read(JsonReader in) throws IOException { 25 | T obj = delegate.read(in); 26 | if (obj instanceof StripeCollectionInterface) { 27 | ((StripeCollectionInterface) obj).setPageTypeToken(type.getType()); 28 | } else if (obj instanceof com.stripe.model.v2.StripeCollection) { 29 | ((com.stripe.model.v2.StripeCollection) obj).setPageTypeToken(type.getType()); 30 | } 31 | return obj; 32 | } 33 | }; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/StripeResponse.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | /** A response from Stripe's API, with body represented as a String. */ 4 | public class StripeResponse extends AbstractStripeResponse { 5 | /** 6 | * Initializes a new instance of the {@link StripeResponse} class. 7 | * 8 | * @param code the HTTP status code of the response 9 | * @param headers the HTTP headers of the response 10 | * @param body the body of the response 11 | * @throws NullPointerException if {@code headers} or {@code body} is {@code null} 12 | */ 13 | public StripeResponse(int code, HttpHeaders headers, String body) { 14 | super(code, headers, body); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/StripeResponseGetterOptions.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import java.net.PasswordAuthentication; 4 | import java.net.Proxy; 5 | 6 | /** Controls how the request is sent by {@link StripeResponseGetter} */ 7 | public abstract class StripeResponseGetterOptions { 8 | // When adding settings here keep them in sync with settings in RequestOptions and 9 | // in the RequestOptions.merge method 10 | public abstract Authenticator getAuthenticator(); 11 | 12 | public abstract String getClientId(); 13 | 14 | public abstract int getConnectTimeout(); 15 | 16 | public abstract Proxy getConnectionProxy(); 17 | 18 | public abstract int getMaxNetworkRetries(); 19 | 20 | public abstract PasswordAuthentication getProxyCredential(); 21 | 22 | public abstract String getApiBase(); 23 | 24 | public abstract String getFilesBase(); 25 | 26 | public abstract String getConnectBase(); 27 | 28 | public abstract String getMeterEventsBase(); 29 | 30 | public abstract int getReadTimeout(); 31 | 32 | public abstract String getStripeAccount(); 33 | 34 | public abstract String getStripeContext(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/StripeResponseGetterSettingTypeAdapterFactory.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.TypeAdapter; 5 | import com.google.gson.TypeAdapterFactory; 6 | import com.google.gson.reflect.TypeToken; 7 | import com.google.gson.stream.JsonReader; 8 | import com.google.gson.stream.JsonWriter; 9 | import com.stripe.model.*; 10 | import java.io.IOException; 11 | 12 | class StripeResponseGetterSettingTypeAdapterFactory implements TypeAdapterFactory { 13 | @Override 14 | public TypeAdapter create(final Gson gson, final TypeToken type) { 15 | final TypeAdapter delegate = gson.getDelegateAdapter(this, type); 16 | 17 | return new TypeAdapter() { 18 | 19 | @Override 20 | public void write(JsonWriter out, T value) throws IOException { 21 | delegate.write(out, value); 22 | } 23 | 24 | @Override 25 | public T read(JsonReader in) throws IOException { 26 | T obj = delegate.read(in); 27 | if (obj instanceof StripeActiveObject) { 28 | ((StripeActiveObject) obj).setResponseGetter(ApiResource.getGlobalResponseGetter()); 29 | } 30 | return obj; 31 | } 32 | }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/net/StripeResponseStream.java: -------------------------------------------------------------------------------- 1 | package com.stripe.net; 2 | 3 | import com.stripe.util.StreamUtils; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | 7 | public class StripeResponseStream extends AbstractStripeResponse { 8 | /** 9 | * Initializes a new instance of the {@link StripeResponseStream} class. 10 | * 11 | * @param code the HTTP status code of the response 12 | * @param headers the HTTP headers of the response 13 | * @param body streaming body response 14 | * @throws NullPointerException if {@code headers} or {@code body} is {@code null} 15 | */ 16 | public StripeResponseStream(int code, HttpHeaders headers, InputStream body) { 17 | super(code, headers, body); 18 | } 19 | 20 | /** 21 | * Buffers the entire response body into a string, constructing the appropriate StripeResponse 22 | * 23 | * @return the StripeResponse 24 | */ 25 | StripeResponse unstream() throws IOException { 26 | final String bodyString = StreamUtils.readToEnd(this.body, ApiResource.CHARSET); 27 | this.body.close(); 28 | return new StripeResponse(this.code, this.headers, bodyString); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/param/common/EmptyParam.java: -------------------------------------------------------------------------------- 1 | package com.stripe.param.common; 2 | 3 | import com.google.gson.annotations.SerializedName; 4 | import com.stripe.net.ApiRequestParams; 5 | 6 | public enum EmptyParam implements ApiRequestParams.EnumParam { 7 | @SerializedName("") 8 | EMPTY(""); 9 | private final String value; 10 | 11 | EmptyParam(String value) { 12 | this.value = value; 13 | } 14 | 15 | @Override 16 | public String getValue() { 17 | return this.value; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/AppsService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class AppsService extends ApiService { 8 | public AppsService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.apps.SecretService secrets() { 13 | return new com.stripe.service.apps.SecretService(this.getResponseGetter()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/BillingPortalService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class BillingPortalService extends ApiService { 8 | public BillingPortalService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.billingportal.ConfigurationService configurations() { 13 | return new com.stripe.service.billingportal.ConfigurationService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.billingportal.SessionService sessions() { 17 | return new com.stripe.service.billingportal.SessionService(this.getResponseGetter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/CheckoutService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class CheckoutService extends ApiService { 8 | public CheckoutService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.checkout.SessionService sessions() { 13 | return new com.stripe.service.checkout.SessionService(this.getResponseGetter()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/ClimateService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class ClimateService extends ApiService { 8 | public ClimateService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.climate.OrderService orders() { 13 | return new com.stripe.service.climate.OrderService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.climate.ProductService products() { 17 | return new com.stripe.service.climate.ProductService(this.getResponseGetter()); 18 | } 19 | 20 | public com.stripe.service.climate.SupplierService suppliers() { 21 | return new com.stripe.service.climate.SupplierService(this.getResponseGetter()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/EntitlementsService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class EntitlementsService extends ApiService { 8 | public EntitlementsService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.entitlements.ActiveEntitlementService activeEntitlements() { 13 | return new com.stripe.service.entitlements.ActiveEntitlementService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.entitlements.FeatureService features() { 17 | return new com.stripe.service.entitlements.FeatureService(this.getResponseGetter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/FinancialConnectionsService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class FinancialConnectionsService extends ApiService { 8 | public FinancialConnectionsService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.financialconnections.AccountService accounts() { 13 | return new com.stripe.service.financialconnections.AccountService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.financialconnections.SessionService sessions() { 17 | return new com.stripe.service.financialconnections.SessionService(this.getResponseGetter()); 18 | } 19 | 20 | public com.stripe.service.financialconnections.TransactionService transactions() { 21 | return new com.stripe.service.financialconnections.TransactionService(this.getResponseGetter()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/ForwardingService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class ForwardingService extends ApiService { 8 | public ForwardingService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.forwarding.RequestService requests() { 13 | return new com.stripe.service.forwarding.RequestService(this.getResponseGetter()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/IdentityService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class IdentityService extends ApiService { 8 | public IdentityService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.identity.VerificationReportService verificationReports() { 13 | return new com.stripe.service.identity.VerificationReportService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.identity.VerificationSessionService verificationSessions() { 17 | return new com.stripe.service.identity.VerificationSessionService(this.getResponseGetter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/RadarService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class RadarService extends ApiService { 8 | public RadarService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.radar.EarlyFraudWarningService earlyFraudWarnings() { 13 | return new com.stripe.service.radar.EarlyFraudWarningService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.radar.ValueListItemService valueListItems() { 17 | return new com.stripe.service.radar.ValueListItemService(this.getResponseGetter()); 18 | } 19 | 20 | public com.stripe.service.radar.ValueListService valueLists() { 21 | return new com.stripe.service.radar.ValueListService(this.getResponseGetter()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/ReportingService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class ReportingService extends ApiService { 8 | public ReportingService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.reporting.ReportRunService reportRuns() { 13 | return new com.stripe.service.reporting.ReportRunService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.reporting.ReportTypeService reportTypes() { 17 | return new com.stripe.service.reporting.ReportTypeService(this.getResponseGetter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/SigmaService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class SigmaService extends ApiService { 8 | public SigmaService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.sigma.ScheduledQueryRunService scheduledQueryRuns() { 13 | return new com.stripe.service.sigma.ScheduledQueryRunService(this.getResponseGetter()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/TaxService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class TaxService extends ApiService { 8 | public TaxService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.tax.CalculationService calculations() { 13 | return new com.stripe.service.tax.CalculationService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.tax.RegistrationService registrations() { 17 | return new com.stripe.service.tax.RegistrationService(this.getResponseGetter()); 18 | } 19 | 20 | public com.stripe.service.tax.SettingsService settings() { 21 | return new com.stripe.service.tax.SettingsService(this.getResponseGetter()); 22 | } 23 | 24 | public com.stripe.service.tax.TransactionService transactions() { 25 | return new com.stripe.service.tax.TransactionService(this.getResponseGetter()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/TerminalService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class TerminalService extends ApiService { 8 | public TerminalService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.terminal.ConfigurationService configurations() { 13 | return new com.stripe.service.terminal.ConfigurationService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.terminal.ConnectionTokenService connectionTokens() { 17 | return new com.stripe.service.terminal.ConnectionTokenService(this.getResponseGetter()); 18 | } 19 | 20 | public com.stripe.service.terminal.LocationService locations() { 21 | return new com.stripe.service.terminal.LocationService(this.getResponseGetter()); 22 | } 23 | 24 | public com.stripe.service.terminal.ReaderService readers() { 25 | return new com.stripe.service.terminal.ReaderService(this.getResponseGetter()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/V2Services.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class V2Services extends ApiService { 8 | public V2Services(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.v2.BillingService billing() { 13 | return new com.stripe.service.v2.BillingService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.v2.CoreService core() { 17 | return new com.stripe.service.v2.CoreService(this.getResponseGetter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/billing/MeterEventService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service.billing; 3 | 4 | import com.stripe.exception.StripeException; 5 | import com.stripe.model.billing.MeterEvent; 6 | import com.stripe.net.ApiRequest; 7 | import com.stripe.net.ApiRequestParams; 8 | import com.stripe.net.ApiResource; 9 | import com.stripe.net.ApiService; 10 | import com.stripe.net.BaseAddress; 11 | import com.stripe.net.RequestOptions; 12 | import com.stripe.net.StripeResponseGetter; 13 | import com.stripe.param.billing.MeterEventCreateParams; 14 | 15 | public final class MeterEventService extends ApiService { 16 | public MeterEventService(StripeResponseGetter responseGetter) { 17 | super(responseGetter); 18 | } 19 | 20 | /** Creates a billing meter event. */ 21 | public MeterEvent create(MeterEventCreateParams params) throws StripeException { 22 | return create(params, (RequestOptions) null); 23 | } 24 | /** Creates a billing meter event. */ 25 | public MeterEvent create(MeterEventCreateParams params, RequestOptions options) 26 | throws StripeException { 27 | String path = "/v1/billing/meter_events"; 28 | ApiRequest request = 29 | new ApiRequest( 30 | BaseAddress.API, 31 | ApiResource.RequestMethod.POST, 32 | path, 33 | ApiRequestParams.paramsToMap(params), 34 | options); 35 | return this.request(request, MeterEvent.class); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/testhelpers/IssuingService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service.testhelpers; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class IssuingService extends ApiService { 8 | public IssuingService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.testhelpers.issuing.AuthorizationService authorizations() { 13 | return new com.stripe.service.testhelpers.issuing.AuthorizationService( 14 | this.getResponseGetter()); 15 | } 16 | 17 | public com.stripe.service.testhelpers.issuing.CardService cards() { 18 | return new com.stripe.service.testhelpers.issuing.CardService(this.getResponseGetter()); 19 | } 20 | 21 | public com.stripe.service.testhelpers.issuing.PersonalizationDesignService 22 | personalizationDesigns() { 23 | return new com.stripe.service.testhelpers.issuing.PersonalizationDesignService( 24 | this.getResponseGetter()); 25 | } 26 | 27 | public com.stripe.service.testhelpers.issuing.TransactionService transactions() { 28 | return new com.stripe.service.testhelpers.issuing.TransactionService(this.getResponseGetter()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/testhelpers/TerminalService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service.testhelpers; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class TerminalService extends ApiService { 8 | public TerminalService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.testhelpers.terminal.ReaderService readers() { 13 | return new com.stripe.service.testhelpers.terminal.ReaderService(this.getResponseGetter()); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/v2/BillingService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service.v2; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class BillingService extends ApiService { 8 | public BillingService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.v2.billing.MeterEventAdjustmentService meterEventAdjustments() { 13 | return new com.stripe.service.v2.billing.MeterEventAdjustmentService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.v2.billing.MeterEventSessionService meterEventSession() { 17 | return new com.stripe.service.v2.billing.MeterEventSessionService(this.getResponseGetter()); 18 | } 19 | 20 | public com.stripe.service.v2.billing.MeterEventStreamService meterEventStream() { 21 | return new com.stripe.service.v2.billing.MeterEventStreamService(this.getResponseGetter()); 22 | } 23 | 24 | public com.stripe.service.v2.billing.MeterEventService meterEvents() { 25 | return new com.stripe.service.v2.billing.MeterEventService(this.getResponseGetter()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/service/v2/CoreService.java: -------------------------------------------------------------------------------- 1 | // File generated from our OpenAPI spec 2 | package com.stripe.service.v2; 3 | 4 | import com.stripe.net.ApiService; 5 | import com.stripe.net.StripeResponseGetter; 6 | 7 | public final class CoreService extends ApiService { 8 | public CoreService(StripeResponseGetter responseGetter) { 9 | super(responseGetter); 10 | } 11 | 12 | public com.stripe.service.v2.core.EventDestinationService eventDestinations() { 13 | return new com.stripe.service.v2.core.EventDestinationService(this.getResponseGetter()); 14 | } 15 | 16 | public com.stripe.service.v2.core.EventService events() { 17 | return new com.stripe.service.v2.core.EventService(this.getResponseGetter()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/util/StreamUtils.java: -------------------------------------------------------------------------------- 1 | package com.stripe.util; 2 | 3 | import static java.util.Objects.requireNonNull; 4 | 5 | import java.io.IOException; 6 | import java.io.InputStream; 7 | import java.io.InputStreamReader; 8 | import java.io.Reader; 9 | import java.nio.charset.Charset; 10 | import lombok.Cleanup; 11 | 12 | public final class StreamUtils { 13 | private static final int DEFAULT_BUF_SIZE = 1024; 14 | 15 | /** 16 | * Reads the provided stream until the end and returns a string encoded with the provided charset. 17 | * 18 | * @param stream the stream to read 19 | * @param charset the charset to use 20 | * @return a string with the contents of the input stream 21 | * @throws NullPointerException if {@code stream} or {@code charset} is {@code null} 22 | * @throws IOException if an I/O error occurs 23 | */ 24 | public static String readToEnd(InputStream stream, Charset charset) throws IOException { 25 | requireNonNull(stream); 26 | requireNonNull(charset); 27 | 28 | final StringBuilder sb = new StringBuilder(); 29 | final char[] buffer = new char[DEFAULT_BUF_SIZE]; 30 | @Cleanup final Reader in = new InputStreamReader(stream, charset); 31 | int charsRead = 0; 32 | while ((charsRead = in.read(buffer, 0, buffer.length)) > 0) { 33 | sb.append(buffer, 0, charsRead); 34 | } 35 | return sb.toString(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/v2/Amount.java: -------------------------------------------------------------------------------- 1 | // NOT codegenned 2 | package com.stripe.v2; 3 | 4 | import com.google.gson.annotations.SerializedName; 5 | import com.stripe.model.StripeObject; 6 | import lombok.EqualsAndHashCode; 7 | import lombok.Getter; 8 | 9 | @Getter 10 | @EqualsAndHashCode(callSuper = false) 11 | public final class Amount extends StripeObject { 12 | public Amount(long value, String currency) { 13 | this.value = value; 14 | this.currency = currency; 15 | } 16 | 17 | @SerializedName("value") 18 | long value; 19 | 20 | @SerializedName("currency") 21 | String currency; 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/stripe/v2/EmptyStripeObject.java: -------------------------------------------------------------------------------- 1 | package com.stripe.v2; 2 | 3 | import com.stripe.model.StripeObject; 4 | 5 | /** 6 | * An empty entity for API methods with a void return type. We need a class to to deserialize into, 7 | * but we can't instantiate the abstract `StripeObject` directly. This class shouldn't do anything. 8 | * It's handwritten, not auto-generated. 9 | */ 10 | public final class EmptyStripeObject extends StripeObject {} 11 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/AccountLinkTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.AccountLink; 8 | import com.stripe.net.ApiResource; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | import org.junit.jupiter.api.Test; 12 | 13 | public class AccountLinkTest extends BaseStripeTest { 14 | @Test 15 | public void testCreate() throws StripeException { 16 | final Map params = new HashMap(); 17 | params.put("account", "acct_123"); 18 | params.put("refresh_url", "https://stripe.com/refresh"); 19 | params.put("return_url", "https://stripe.com/return"); 20 | params.put("type", "account_onboarding"); 21 | 22 | final AccountLink accountLink = AccountLink.create(params); 23 | 24 | assertNotNull(accountLink); 25 | verifyRequest(ApiResource.RequestMethod.POST, String.format("/v1/account_links"), params); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/ApplicationFeeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.ApplicationFee; 8 | import com.stripe.model.ApplicationFeeCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class ApplicationFeeTest extends BaseStripeTest { 15 | public static final String FEE_ID = "fee_123"; 16 | 17 | @Test 18 | public void testRetrieve() throws StripeException { 19 | final ApplicationFee fee = ApplicationFee.retrieve(FEE_ID); 20 | 21 | assertNotNull(fee); 22 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/application_fees/%s", FEE_ID)); 23 | } 24 | 25 | @Test 26 | public void testList() throws StripeException { 27 | final Map params = new HashMap<>(); 28 | params.put("limit", 1); 29 | 30 | final ApplicationFeeCollection fees = ApplicationFee.list(params); 31 | 32 | assertNotNull(fees); 33 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/application_fees"), params); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/BalanceTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.Balance; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class BalanceTest extends BaseStripeTest { 12 | @Test 13 | public void testRetrieve() throws StripeException { 14 | final Balance balance = Balance.retrieve(); 15 | 16 | assertNotNull(balance); 17 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/balance")); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/BalanceTransactionTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.BalanceTransaction; 8 | import com.stripe.model.BalanceTransactionCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class BalanceTransactionTest extends BaseStripeTest { 15 | public static final String RESOURCE_ID = "bt_123"; 16 | 17 | @Test 18 | public void testRetrieve() throws StripeException { 19 | final BalanceTransaction balanceTransaction = BalanceTransaction.retrieve(RESOURCE_ID); 20 | 21 | assertNotNull(balanceTransaction); 22 | verifyRequest( 23 | ApiResource.RequestMethod.GET, String.format("/v1/balance_transactions/%s", RESOURCE_ID)); 24 | } 25 | 26 | @Test 27 | public void testList() throws StripeException { 28 | final Map params = new HashMap<>(); 29 | params.put("limit", 1); 30 | 31 | final BalanceTransactionCollection balanceTransactions = BalanceTransaction.list(params); 32 | 33 | assertNotNull(balanceTransactions); 34 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/balance_transactions"), params); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/CountrySpecTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.CountrySpec; 8 | import com.stripe.model.CountrySpecCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class CountrySpecTest extends BaseStripeTest { 15 | public static final String COUNTRY_SPEC_ID = "US"; 16 | 17 | @Test 18 | public void testRetrieve() throws StripeException { 19 | final CountrySpec countrySpec = CountrySpec.retrieve(COUNTRY_SPEC_ID); 20 | 21 | assertNotNull(countrySpec); 22 | verifyRequest( 23 | ApiResource.RequestMethod.GET, String.format("/v1/country_specs/%s", COUNTRY_SPEC_ID)); 24 | } 25 | 26 | @Test 27 | public void testList() throws StripeException { 28 | final Map params = new HashMap<>(); 29 | params.put("limit", 1); 30 | 31 | CountrySpecCollection countrySpecs = CountrySpec.list(params); 32 | 33 | assertNotNull(countrySpecs); 34 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/country_specs"), params); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/ExchangeRateTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.ExchangeRate; 8 | import com.stripe.model.ExchangeRateCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class ExchangeRateTest extends BaseStripeTest { 15 | public static final String CURRENCY = "usd"; 16 | 17 | @Test 18 | public void testRetrieve() throws StripeException { 19 | final ExchangeRate rate = ExchangeRate.retrieve(CURRENCY); 20 | 21 | assertNotNull(rate); 22 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/exchange_rates/usd")); 23 | } 24 | 25 | @Test 26 | public void testList() throws StripeException { 27 | final Map params = new HashMap<>(); 28 | params.put("limit", 1); 29 | 30 | final ExchangeRateCollection rates = ExchangeRate.list(params); 31 | 32 | assertNotNull(rates); 33 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/exchange_rates")); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/LoginLinkTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.Account; 8 | import com.stripe.model.LoginLink; 9 | import com.stripe.net.ApiResource; 10 | import java.io.IOException; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class LoginLinkTest extends BaseStripeTest { 15 | public static final String ACCOUNT_ID = "acct_123"; 16 | 17 | @Test 18 | public void testCreate() throws IOException, StripeException { 19 | final Account account = Account.retrieve(ACCOUNT_ID, null); 20 | 21 | final LoginLink link = LoginLink.createOnAccount(ACCOUNT_ID, (Map) null, null); 22 | 23 | stubRequest( 24 | ApiResource.RequestMethod.POST, 25 | String.format("/v1/accounts/%s/login_links", account.getId()), 26 | null, 27 | LoginLink.class, 28 | getResourceAsString("/api_fixtures/login_link.json")); 29 | 30 | assertNotNull(link); 31 | verifyRequest( 32 | ApiResource.RequestMethod.POST, 33 | String.format("/v1/accounts/%s/login_links", account.getId())); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/MandateTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.Mandate; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class MandateTest extends BaseStripeTest { 12 | public static final String MANDATE_ID = "mandate_123"; 13 | 14 | @Test 15 | public void testRetrieve() throws StripeException { 16 | final Mandate schedule = Mandate.retrieve(MANDATE_ID); 17 | 18 | assertNotNull(schedule); 19 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/mandates/%s", MANDATE_ID)); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/SetupAttemptTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.SetupAttempt; 8 | import com.stripe.model.SetupAttemptCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class SetupAttemptTest extends BaseStripeTest { 15 | @Test 16 | public void testList() throws StripeException { 17 | final Map params = new HashMap<>(); 18 | params.put("setup_intent", "seti_123"); 19 | 20 | final SetupAttemptCollection setupAttempts = SetupAttempt.list(params); 21 | 22 | assertNotNull(setupAttempts); 23 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/setup_attempts"), params); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/StripeObjectTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.Subscription; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class StripeObjectTest extends BaseStripeTest { 11 | @Test 12 | public void testGetRawJsonObject() throws StripeException { 13 | final Subscription subscription = Subscription.retrieve("sub_123"); 14 | 15 | // Access `id`, a string element 16 | assertEquals( 17 | subscription.getId(), 18 | subscription.getRawJsonObject().getAsJsonPrimitive("id").getAsString()); 19 | 20 | // Access `created`, a number element 21 | assertEquals( 22 | subscription.getCreated(), 23 | subscription.getRawJsonObject().getAsJsonPrimitive("created").getAsLong()); 24 | 25 | // Access `items[data][0][id]`, a deeply nested string element 26 | assertEquals( 27 | subscription.getItems().getData().get(0).getId(), 28 | subscription 29 | .getRawJsonObject() 30 | .getAsJsonObject("items") 31 | .getAsJsonArray("data") 32 | .get(0) 33 | .getAsJsonObject() 34 | .getAsJsonPrimitive("id") 35 | .getAsString()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/TaxCodeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.exception.StripeException; 8 | import com.stripe.model.TaxCode; 9 | import com.stripe.model.TaxCodeCollection; 10 | import com.stripe.net.ApiResource; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | import org.junit.jupiter.api.Test; 14 | 15 | public class TaxCodeTest extends BaseStripeTest { 16 | public static final String TAX_CODE_ID = "txcd_123"; 17 | 18 | @Test 19 | public void testRetrieve() throws StripeException { 20 | final TaxCode taxCode = TaxCode.retrieve(TAX_CODE_ID); 21 | 22 | assertNotNull(taxCode); 23 | verifyRequest(ApiResource.RequestMethod.GET, String.format("/v1/tax_codes/%s", TAX_CODE_ID)); 24 | assertEquals("tax_code", taxCode.getObject()); 25 | } 26 | 27 | @Test 28 | public void testList() throws StripeException { 29 | final Map params = new HashMap<>(); 30 | params.put("limit", 1); 31 | 32 | final TaxCodeCollection taxCodes = TaxCode.list(params); 33 | 34 | assertNotNull(taxCodes); 35 | assertEquals(1, taxCodes.getData().size()); 36 | assertEquals("tax_code", taxCodes.getData().get(0).getObject()); 37 | verifyRequest(ApiResource.RequestMethod.GET, "/v1/tax_codes", params); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/billingportal/SessionTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional.billingportal; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.billingportal.Session; 8 | import com.stripe.net.ApiResource; 9 | import com.stripe.param.billingportal.SessionCreateParams; 10 | import org.junit.jupiter.api.Test; 11 | 12 | public class SessionTest extends BaseStripeTest { 13 | public static final String SESSION_ID = "bps_123"; 14 | 15 | @Test 16 | public void testCreate() throws StripeException { 17 | 18 | SessionCreateParams params = 19 | SessionCreateParams.builder() 20 | .setCustomer("cus_123") 21 | .setReturnUrl("https://stripe.com/return") 22 | .build(); 23 | 24 | final Session session = Session.create(params); 25 | 26 | assertNotNull(session); 27 | verifyRequest( 28 | ApiResource.RequestMethod.POST, 29 | String.format("/v1/billing_portal/sessions"), 30 | params.toMap()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/reporting/ReportTypeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional.reporting; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.reporting.ReportType; 8 | import com.stripe.model.reporting.ReportTypeCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class ReportTypeTest extends BaseStripeTest { 15 | public static final String REPORT_TYPE_ID = "activity.summary.1"; 16 | 17 | @Test 18 | public void testRetrieve() throws StripeException { 19 | final ReportType reportType = ReportType.retrieve(REPORT_TYPE_ID); 20 | 21 | assertNotNull(reportType); 22 | verifyRequest( 23 | ApiResource.RequestMethod.GET, 24 | String.format("/v1/reporting/report_types/%s", REPORT_TYPE_ID)); 25 | } 26 | 27 | @Test 28 | public void testList() throws StripeException { 29 | final Map params = new HashMap<>(); 30 | 31 | ReportTypeCollection reportTypes = ReportType.list(params); 32 | 33 | assertNotNull(reportTypes); 34 | verifyRequest( 35 | ApiResource.RequestMethod.GET, String.format("/v1/reporting/report_types"), params); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/sigma/ScheduledQueryRunTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional.sigma; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.sigma.ScheduledQueryRun; 8 | import com.stripe.model.sigma.ScheduledQueryRunCollection; 9 | import com.stripe.net.ApiResource; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import org.junit.jupiter.api.Test; 13 | 14 | public class ScheduledQueryRunTest extends BaseStripeTest { 15 | public static final String RUN_ID = "sqr_123"; 16 | 17 | @Test 18 | public void testRetrieve() throws StripeException { 19 | final ScheduledQueryRun run = ScheduledQueryRun.retrieve(RUN_ID); 20 | 21 | assertNotNull(run); 22 | verifyRequest( 23 | ApiResource.RequestMethod.GET, String.format("/v1/sigma/scheduled_query_runs/%s", RUN_ID)); 24 | } 25 | 26 | @Test 27 | public void testList() throws StripeException { 28 | final Map params = new HashMap<>(); 29 | params.put("limit", 1); 30 | 31 | ScheduledQueryRunCollection runs = ScheduledQueryRun.list(params); 32 | 33 | assertNotNull(runs); 34 | verifyRequest( 35 | ApiResource.RequestMethod.GET, String.format("/v1/sigma/scheduled_query_runs"), params); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/functional/terminal/ConnectionTokenTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.functional.terminal; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.exception.StripeException; 7 | import com.stripe.model.terminal.ConnectionToken; 8 | import com.stripe.net.ApiResource; 9 | import java.util.HashMap; 10 | import java.util.Map; 11 | import org.junit.jupiter.api.Test; 12 | 13 | public class ConnectionTokenTest extends BaseStripeTest { 14 | @Test 15 | public void testCreate() throws StripeException { 16 | final Map params = new HashMap<>(); 17 | 18 | final ConnectionToken connectionToken = ConnectionToken.create(params); 19 | 20 | assertNotNull(connectionToken); 21 | verifyRequest( 22 | ApiResource.RequestMethod.POST, String.format("/v1/terminal/connection_tokens"), params); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/AccountLinkTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class AccountLinkTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getResourceAsString("/api_fixtures/account_link.json"); 14 | final AccountLink resource = ApiResource.GSON.fromJson(data, AccountLink.class); 15 | assertNotNull(resource); 16 | assertEquals("account_link", resource.getObject()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ApplePayDomainTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ApplePayDomainTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/apple_pay/domains/apftw_123"); 13 | final ApplePayDomain resource = ApiResource.GSON.fromJson(data, ApplePayDomain.class); 14 | assertNotNull(resource); 15 | assertNotNull(resource.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/BalanceTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class BalanceTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/balance"); 13 | final Balance resource = ApiResource.GSON.fromJson(data, Balance.class); 14 | assertNotNull(resource); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ChargeLevel3Test.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ChargeLevel3Test extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getResourceAsString("/api_fixtures/charge_level3.json"); 13 | final Charge.Level3 object = ApiResource.GSON.fromJson(data, Charge.Level3.class); 14 | assertEquals("1234", object.getMerchantReference()); 15 | assertEquals(2, object.getLineItems().size()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ChargeOutcomeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ChargeOutcomeTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getResourceAsString("/api_fixtures/charge_outcome.json"); 13 | final Charge.Outcome object = ApiResource.GSON.fromJson(data, Charge.Outcome.class); 14 | assertNotNull(object); 15 | assertNotNull(object.getNetworkStatus()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/CountrySpecTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class CountrySpecTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/country_specs/us"); 13 | final CountrySpec resource = ApiResource.GSON.fromJson(data, CountrySpec.class); 14 | assertNotNull(resource); 15 | assertNotNull(resource.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/CouponTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class CouponTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/coupons/COUPON_ID"); 13 | final Coupon resource = ApiResource.GSON.fromJson(data, Coupon.class); 14 | assertNotNull(resource); 15 | assertNotNull(resource.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/DisputeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertNull; 6 | 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class DisputeTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getFixture("/v1/disputes/dp_123"); 15 | final Dispute dispute = ApiResource.GSON.fromJson(data, Dispute.class); 16 | assertNotNull(dispute); 17 | assertNotNull(dispute.getId()); 18 | assertEquals("dispute", dispute.getObject()); 19 | assertNull(dispute.getChargeObject()); 20 | } 21 | 22 | @Test 23 | public void testDeserializeWithExpansions() throws Exception { 24 | final String[] expansions = { 25 | "charge", 26 | }; 27 | final String data = getFixture("/v1/disputes/dp_123", expansions); 28 | final Dispute dispute = ApiResource.GSON.fromJson(data, Dispute.class); 29 | assertNotNull(dispute); 30 | final Charge charge = dispute.getChargeObject(); 31 | assertNotNull(charge); 32 | assertNotNull(charge.getId()); 33 | assertEquals(dispute.getCharge(), charge.getId()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/EphemeralKeyTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class EphemeralKeyTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String json = getResourceAsString("/api_fixtures/ephemeral_key.json"); 14 | final EphemeralKey resource = ApiResource.GSON.fromJson(json, EphemeralKey.class); 15 | assertNotNull(resource); 16 | assertEquals("ephkey_123", resource.getId()); 17 | assertEquals("ephemeral_key", resource.getObject()); 18 | } 19 | 20 | @Test 21 | public void testRawJson() { 22 | final String jsonString = "{\"foo\":5,\"bar\":[\"baz\",null]}"; 23 | final EphemeralKey key = ApiResource.GSON.fromJson(jsonString, EphemeralKey.class); 24 | assertEquals(jsonString, key.getRawJson()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/EventDataDeserializerTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class EventDataDeserializerTest extends BaseStripeTest { 10 | 11 | @Test 12 | public void testEventAccountApplicationDeauthorized() throws Exception { 13 | final String data = getResourceAsString("/api_fixtures/customer_created.json"); 14 | final Event event = ApiResource.GSON.fromJson(data, Event.class); 15 | assertNotNull(event); 16 | assertNotNull(event.getId()); 17 | assertNotNull(event.getData()); 18 | 19 | // Using deserializeUnsafe() because the fixture uses an older API version 20 | assertNotNull(event.getDataObjectDeserializer().deserializeUnsafe()); 21 | 22 | final Customer customer = (Customer) event.getDataObjectDeserializer().deserializeUnsafe(); 23 | assertNotNull(customer); 24 | assertNotNull(customer.getId()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ExchangeRateTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ExchangeRateTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/exchange_rates/usd"); 13 | final ExchangeRate resource = ApiResource.GSON.fromJson(data, ExchangeRate.class); 14 | assertNotNull(resource); 15 | assertNotNull(resource.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ExpandableFieldTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.*; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.StripeResponseGetter; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ExpandableFieldTest extends BaseStripeTest { 10 | @Test 11 | public void testPropagatesRequestGetter() { 12 | ActiveObject object = new ActiveObject(); 13 | ExpandableField f = new ExpandableField("1", object); 14 | 15 | assertNull(object.responseGetter); 16 | f.setResponseGetter(networkSpy); 17 | 18 | assertNotNull(object.responseGetter); 19 | } 20 | 21 | static class ActiveObject implements HasId, StripeActiveObject { 22 | public StripeResponseGetter responseGetter; 23 | 24 | @Override 25 | public void setResponseGetter(StripeResponseGetter responseGetter) { 26 | this.responseGetter = responseGetter; 27 | } 28 | 29 | @Override 30 | public String getId() { 31 | return null; 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/FileLinkTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertNull; 6 | 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class FileLinkTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getFixture("/v1/file_links/link_123"); 15 | final FileLink fileLink = ApiResource.GSON.fromJson(data, FileLink.class); 16 | assertNotNull(fileLink); 17 | assertNotNull(fileLink.getId()); 18 | assertEquals("file_link", fileLink.getObject()); 19 | assertNull(fileLink.getFileObject()); 20 | } 21 | 22 | @Test 23 | public void testDeserializeExpanded() throws Exception { 24 | final String[] expansions = { 25 | "file", 26 | }; 27 | final String data = getFixture("/v1/file_links/link_123", expansions); 28 | final FileLink fileLink = ApiResource.GSON.fromJson(data, FileLink.class); 29 | assertNotNull(fileLink); 30 | final File file = fileLink.getFileObject(); 31 | assertNotNull(file); 32 | assertNotNull(file.getId()); 33 | assertEquals(fileLink.getFile(), file.getId()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/FileTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class FileTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/files/file_123"); 13 | final File file = ApiResource.GSON.fromJson(data, File.class); 14 | assertNotNull(file); 15 | assertNotNull(file.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/InstantDeserializerTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNull; 5 | 6 | import com.google.gson.Gson; 7 | import com.google.gson.reflect.TypeToken; 8 | import com.stripe.BaseStripeTest; 9 | import com.stripe.net.ApiResource; 10 | import java.time.Instant; 11 | import org.junit.jupiter.api.Test; 12 | 13 | public class InstantDeserializerTest extends BaseStripeTest { 14 | 15 | private static Gson gson = ApiResource.GSON; 16 | 17 | @Test 18 | public void deserializeNull() { 19 | final String json = gson.toJson(null); 20 | // Gson also uses TypeTokens internally to get around Type Erasure for generic types, simulate 21 | // that here: 22 | final Instant out = gson.fromJson(json, new TypeToken() {}.getType()); 23 | assertNull(out); 24 | } 25 | 26 | @Test 27 | public void deserializeString() { 28 | final String json = gson.toJson("2022-02-15T00:27:45.330Z"); 29 | // Gson also uses TypeTokens internally to get around Type Erasure for generic types, simulate 30 | // that here: 31 | final Instant out = gson.fromJson(json, new TypeToken() {}.getType()); 32 | assertEquals(Instant.parse("2022-02-15T00:27:45.330Z"), out); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/LineItemTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class LineItemTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getResourceAsString("/api_fixtures/line_item.json"); 14 | final LineItem lineItem = ApiResource.GSON.fromJson(data, LineItem.class); 15 | assertNotNull(lineItem); 16 | assertNotNull(lineItem.getId()); 17 | assertEquals("item", lineItem.getObject()); 18 | assertEquals("price", lineItem.getPrice().getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/LoginLinkTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class LoginLinkTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getResourceAsString("/api_fixtures/login_link.json"); 13 | final LoginLink link = ApiResource.GSON.fromJson(data, LoginLink.class); 14 | assertNotNull(link); 15 | assertNotNull(link.getUrl()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/MandateTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class MandateTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/mandates/mandate_123"); 14 | final Mandate resource = ApiResource.GSON.fromJson(data, Mandate.class); 15 | assertNotNull(resource); 16 | assertNotNull(resource.getId()); 17 | } 18 | 19 | @Test 20 | public void testDeserializeWithExpansions() throws Exception { 21 | final String[] expansions = {"payment_method"}; 22 | 23 | final String data = getFixture("/v1/mandates/mandate_123", expansions); 24 | 25 | final Mandate resource = ApiResource.GSON.fromJson(data, Mandate.class); 26 | assertNotNull(resource); 27 | assertNotNull(resource.getId()); 28 | 29 | final PaymentMethod pm = resource.getPaymentMethodObject(); 30 | assertNotNull(pm); 31 | assertNotNull(pm.getId()); 32 | assertEquals(resource.getPaymentMethod(), pm.getId()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/PaymentMethodTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class PaymentMethodTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/payment_methods/pm_123"); 13 | final PaymentMethod resource = ApiResource.GSON.fromJson(data, PaymentMethod.class); 14 | assertNotNull(resource); 15 | assertNotNull(resource.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/PayoutTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | import static org.junit.jupiter.api.Assertions.assertTrue; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import java.io.IOException; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class PayoutTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getFixture("/v1/payouts/po_123"); 15 | final Payout resource = ApiResource.GSON.fromJson(data, Payout.class); 16 | assertNotNull(resource); 17 | assertNotNull(resource.getId()); 18 | } 19 | 20 | @Test 21 | public void testDeserializeWithExpandedDeletedBankAccount() throws IOException { 22 | final String data = 23 | getResourceAsString("/api_fixtures/payout_with_del_ext_bank_acct_expansion.json"); 24 | final Payout resource = ApiResource.GSON.fromJson(data, Payout.class); 25 | final BankAccount bankAccount = (BankAccount) resource.getDestinationObject(); 26 | 27 | assertNotNull(bankAccount); 28 | assertTrue(bankAccount.getDeleted()); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/PlanTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertNull; 6 | 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class PlanTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getFixture("/v1/plans/gold"); 15 | final Plan plan = ApiResource.GSON.fromJson(data, Plan.class); 16 | assertNotNull(plan); 17 | assertNotNull(plan.getId()); 18 | assertEquals("plan", plan.getObject()); 19 | assertNull(plan.getProductObject()); 20 | } 21 | 22 | @Test 23 | public void testDeserializeWithExpansions() throws Exception { 24 | final String[] expansions = { 25 | "product", 26 | }; 27 | final String data = getFixture("/v1/plans/gold", expansions); 28 | final Plan plan = ApiResource.GSON.fromJson(data, Plan.class); 29 | assertNotNull(plan); 30 | final Product product = plan.getProductObject(); 31 | assertNotNull(product); 32 | assertNotNull(product.getId()); 33 | assertEquals(plan.getProduct(), product.getId()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/PriceTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertNull; 6 | 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class PriceTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getFixture("/v1/prices/price_123"); 15 | final Price price = ApiResource.GSON.fromJson(data, Price.class); 16 | assertNotNull(price); 17 | assertNotNull(price.getId()); 18 | assertEquals("price", price.getObject()); 19 | assertNull(price.getProductObject()); 20 | } 21 | 22 | @Test 23 | public void testDeserializeWithExpansions() throws Exception { 24 | final String[] expansions = { 25 | "product", 26 | }; 27 | final String data = getFixture("/v1/prices/price_123", expansions); 28 | final Price price = ApiResource.GSON.fromJson(data, Price.class); 29 | assertNotNull(price); 30 | final Product product = price.getProductObject(); 31 | assertNotNull(product); 32 | assertNotNull(product.getId()); 33 | assertEquals(price.getProduct(), product.getId()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ProductTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ProductTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/products/prod_123"); 14 | final Product product = ApiResource.GSON.fromJson(data, Product.class); 15 | assertNotNull(product); 16 | assertNotNull(product.getId()); 17 | assertEquals("product", product.getObject()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/PromotionCodeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class PromotionCodeTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/promotion_codes/co_123"); 14 | final PromotionCode resource = ApiResource.GSON.fromJson(data, PromotionCode.class); 15 | assertNotNull(resource); 16 | assertNotNull(resource.getId()); 17 | } 18 | 19 | @Test 20 | public void testDeserializeWithExpansions() throws Exception { 21 | final String[] expansions = { 22 | "customer", 23 | }; 24 | final String data = getFixture("/v1/promotion_codes/co_123", expansions); 25 | final PromotionCode resource = ApiResource.GSON.fromJson(data, PromotionCode.class); 26 | assertNotNull(resource); 27 | assertNotNull(resource.getId()); 28 | 29 | final Customer customer = resource.getCustomerObject(); 30 | assertNotNull(customer); 31 | assertNotNull(customer.getId()); 32 | assertEquals(resource.getCustomer(), customer.getId()); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/QuoteTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class QuoteTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/quotes/qt_123"); 14 | final Quote quote = ApiResource.GSON.fromJson(data, Quote.class); 15 | assertNotNull(quote); 16 | assertNotNull(quote.getId()); 17 | assertEquals("quote", quote.getObject()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/ReviewTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ReviewTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/reviews/prv_123"); 14 | final Review review = ApiResource.GSON.fromJson(data, Review.class); 15 | assertNotNull(review); 16 | assertNotNull(review.getId()); 17 | assertEquals("review", review.getObject()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/SetupAttemptTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class SetupAttemptTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | // Keep the fixture to have `action` deserialize properly 13 | final SetupAttempt resource = 14 | ApiResource.GSON.fromJson( 15 | getResourceAsString("/api_fixtures/setup_attempt.json"), SetupAttempt.class); 16 | assertNotNull(resource); 17 | assertNotNull(resource.getId()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/SourceTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class SourceTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/sources/src_123"); 14 | final Source source = ApiResource.GSON.fromJson(data, Source.class); 15 | assertNotNull(source); 16 | assertNotNull(source.getId()); 17 | assertEquals("source", source.getObject()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/StripeErrorTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.google.gson.JsonObject; 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class StripeErrorTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getResourceAsString("/api_fixtures/error_invalid_request.json"); 15 | final JsonObject jsonObject = 16 | ApiResource.GSON.fromJson(data, JsonObject.class).getAsJsonObject("error"); 17 | final StripeError error = ApiResource.GSON.fromJson(jsonObject, StripeError.class); 18 | assertNotNull(error); 19 | assertEquals("parameter_unknown", error.getCode()); 20 | assertEquals("https://stripe.com/docs/error-codes/parameter-unknown", error.getDocUrl()); 21 | assertEquals("Received unknown parameter: foo", error.getMessage()); 22 | assertEquals("foo", error.getParam()); 23 | assertEquals("invalid_request_error", error.getType()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/SubscriptionItemTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class SubscriptionItemTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/subscription_items/si_123"); 14 | final SubscriptionItem subscriptionItem = 15 | ApiResource.GSON.fromJson(data, SubscriptionItem.class); 16 | assertNotNull(subscriptionItem); 17 | assertNotNull(subscriptionItem.getId()); 18 | assertEquals("subscription_item", subscriptionItem.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/TaxCodeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class TaxCodeTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/tax_codes/txr_123"); 14 | final TaxCode taxCode = ApiResource.GSON.fromJson(data, TaxCode.class); 15 | assertNotNull(taxCode); 16 | assertNotNull(taxCode.getId()); 17 | assertEquals("tax_code", taxCode.getObject()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/TaxRateTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertTrue; 6 | 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import java.math.BigDecimal; 10 | import org.junit.jupiter.api.Test; 11 | 12 | public class TaxRateTest extends BaseStripeTest { 13 | @Test 14 | public void testDeserialize() throws Exception { 15 | final String data = getFixture("/v1/tax_rates/txr_123"); 16 | final TaxRate taxRate = ApiResource.GSON.fromJson(data, TaxRate.class); 17 | assertNotNull(taxRate); 18 | assertNotNull(taxRate.getId()); 19 | assertEquals("tax_rate", taxRate.getObject()); 20 | } 21 | 22 | @Test 23 | @SuppressWarnings("BigDecimalEquals") 24 | public void testDeserializeBigDecimal() { 25 | final String data = "{\"object\": \"tax_rate\", \"percentage\": 0.3}"; 26 | final TaxRate taxRate = ApiResource.GSON.fromJson(data, TaxRate.class); 27 | assertNotNull(taxRate); 28 | assertNotNull(taxRate.getPercentage()); 29 | assertTrue(taxRate.getPercentage().equals(new BigDecimal("0.3"))); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/TokenTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class TokenTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/tokens/tok_123"); 14 | final Token token = ApiResource.GSON.fromJson(data, Token.class); 15 | assertNotNull(token); 16 | assertNotNull(token.getId()); 17 | assertEquals("token", token.getObject()); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/TopupTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertNull; 6 | 7 | import com.stripe.BaseStripeTest; 8 | import com.stripe.net.ApiResource; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class TopupTest extends BaseStripeTest { 12 | @Test 13 | public void testDeserialize() throws Exception { 14 | final String data = getFixture("/v1/topups/tu_123"); 15 | final Topup topup = ApiResource.GSON.fromJson(data, Topup.class); 16 | assertNotNull(topup); 17 | assertNotNull(topup.getId()); 18 | assertEquals("topup", topup.getObject()); 19 | assertNull(topup.getBalanceTransactionObject()); 20 | } 21 | 22 | @Test 23 | public void testDeserializeWithExpansions() throws Exception { 24 | final String[] expansions = { 25 | "balance_transaction", 26 | }; 27 | final String data = getFixture("/v1/topups/tu_123", expansions); 28 | final Topup topup = ApiResource.GSON.fromJson(data, Topup.class); 29 | assertNotNull(topup); 30 | final BalanceTransaction balanceTransaction = topup.getBalanceTransactionObject(); 31 | assertNotNull(balanceTransaction); 32 | assertNotNull(balanceTransaction.getId()); 33 | assertEquals(topup.getBalanceTransaction(), balanceTransaction.getId()); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/WebhookEndpointTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class WebhookEndpointTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/webhook_endpoints/we_123"); 13 | final WebhookEndpoint resource = ApiResource.GSON.fromJson(data, WebhookEndpoint.class); 14 | assertNotNull(resource); 15 | assertNotNull(resource.getId()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/billingportal/SessionTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.billingportal; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class SessionTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getResourceAsString("/api_fixtures/billingportal/session.json"); 14 | final Session session = ApiResource.GSON.fromJson(data, Session.class); 15 | 16 | assertNotNull(session); 17 | assertNotNull(session.getId()); 18 | assertEquals("billing_portal.session", session.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/issuing/CardTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.issuing; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class CardTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/issuing/cards/ic_123"); 14 | final Card card = ApiResource.GSON.fromJson(data, Card.class); 15 | 16 | assertNotNull(card); 17 | assertNotNull(card.getId()); 18 | assertEquals("issuing.card", card.getObject()); 19 | // assertNotNull(card.getCardholder()); 20 | // assertEquals("issuing.cardholder", card.getCardholder().getObject()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/issuing/CardholderTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.issuing; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class CardholderTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/issuing/cardholders/ich_123"); 14 | final Cardholder cardholder = ApiResource.GSON.fromJson(data, Cardholder.class); 15 | 16 | assertNotNull(cardholder); 17 | assertNotNull(cardholder.getId()); 18 | assertEquals("issuing.cardholder", cardholder.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/issuing/DisputeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.issuing; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class DisputeTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/issuing/disputes/idp_123"); 14 | final Dispute dispute = ApiResource.GSON.fromJson(data, Dispute.class); 15 | 16 | assertNotNull(dispute); 17 | assertNotNull(dispute.getId()); 18 | assertEquals("issuing.dispute", dispute.getObject()); 19 | } 20 | 21 | @Test 22 | public void testDeserializeWithExpansions() throws Exception { 23 | // TODO: handle support for balance_transactions expansion as stripe-mock doesn't support this 24 | // well 25 | final String[] expansions = { 26 | "transaction", 27 | }; 28 | final String data = getFixture("/v1/issuing/disputes/idp_123", expansions); 29 | final Dispute dispute = ApiResource.GSON.fromJson(data, Dispute.class); 30 | assertNotNull(dispute); 31 | final Transaction transaction = dispute.getTransactionObject(); 32 | assertNotNull(transaction); 33 | assertNotNull(transaction.getId()); 34 | assertEquals(dispute.getTransaction(), transaction.getId()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/oauth/OAuthErrorTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.oauth; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class OAuthErrorTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getResourceAsString("/oauth_fixtures/error_invalid_client.json"); 14 | final OAuthError error = ApiResource.GSON.fromJson(data, OAuthError.class); 15 | assertNotNull(error); 16 | assertEquals("invalid_client", error.getError()); 17 | assertEquals( 18 | "No authentication was provided. Send your secret API key using the Authorization " 19 | + "header, or as a client_secret POST parameter.", 20 | error.getErrorDescription()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/radar/ValueListItemTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.radar; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ValueListItemTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/radar/value_lists/rsli_123"); 14 | final ValueListItem valueListItem = ApiResource.GSON.fromJson(data, ValueListItem.class); 15 | 16 | assertNotNull(valueListItem); 17 | assertNotNull(valueListItem.getId()); 18 | assertEquals("radar.value_list", valueListItem.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/radar/ValueListTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.radar; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ValueListTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/radar/value_lists/rsl_123"); 14 | final ValueList valueList = ApiResource.GSON.fromJson(data, ValueList.class); 15 | 16 | assertNotNull(valueList); 17 | assertNotNull(valueList.getId()); 18 | assertEquals("radar.value_list", valueList.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/reporting/ReportRunTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.reporting; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ReportRunTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/reporting/report_runs/frr_123"); 14 | final ReportRun reportRun = ApiResource.GSON.fromJson(data, ReportRun.class); 15 | 16 | assertNotNull(reportRun); 17 | assertNotNull(reportRun.getId()); 18 | assertEquals("reporting.report_run", reportRun.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/reporting/ReportTypeTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.reporting; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ReportTypeTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/reporting/report_types/activity.summary.1"); 14 | final ReportType reportType = ApiResource.GSON.fromJson(data, ReportType.class); 15 | 16 | assertNotNull(reportType); 17 | assertNotNull(reportType.getId()); 18 | assertEquals("reporting.report_type", reportType.getObject()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/sigma/ScheduledQueryRunTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.sigma; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class ScheduledQueryRunTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final String data = getFixture("/v1/sigma/scheduled_query_runs/sqr_123"); 14 | final ScheduledQueryRun run = ApiResource.GSON.fromJson(data, ScheduledQueryRun.class); 15 | 16 | assertNotNull(run); 17 | assertNotNull(run.getId()); 18 | assertEquals("scheduled_query_run", run.getObject()); 19 | assertNotNull(run.getFile()); 20 | assertEquals("file", run.getFile().getObject()); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/terminal/ConnectionTokenTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.terminal; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ConnectionTokenTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getResourceAsString("/api_fixtures/terminal/connection_token.json"); 13 | final ConnectionToken connectionToken = ApiResource.GSON.fromJson(data, ConnectionToken.class); 14 | assertNotNull(connectionToken); 15 | assertNotNull(connectionToken.getSecret()); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/terminal/LocationTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.terminal; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class LocationTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/terminal/locations/loc_123"); 13 | final Location location = ApiResource.GSON.fromJson(data, Location.class); 14 | 15 | assertNotNull(location); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/model/terminal/ReaderTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.model.terminal; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertNotNull; 4 | 5 | import com.stripe.BaseStripeTest; 6 | import com.stripe.net.ApiResource; 7 | import org.junit.jupiter.api.Test; 8 | 9 | public class ReaderTest extends BaseStripeTest { 10 | @Test 11 | public void testDeserialize() throws Exception { 12 | final String data = getFixture("/v1/terminal/readers/rdr_123"); 13 | final Reader reader = ApiResource.GSON.fromJson(data, Reader.class); 14 | 15 | assertNotNull(reader); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/param/ChargeUpdateParamsTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.param; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | class ChargeUpdateParamsTest { 8 | @Test 9 | public void testGetter() { 10 | ChargeUpdateParams chargeUpdateParams = 11 | ChargeUpdateParams.builder().setDescription("foo").build(); 12 | 13 | assertEquals("foo", chargeUpdateParams.getDescription()); 14 | } 15 | 16 | @Test 17 | public void testGetterNested() { 18 | ChargeUpdateParams chargeUpdateParams = 19 | ChargeUpdateParams.builder() 20 | .setShipping(ChargeUpdateParams.Shipping.builder().setName("Jenny Rosen").build()) 21 | .build(); 22 | 23 | assertEquals("Jenny Rosen", chargeUpdateParams.getShipping().getName()); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/util/StreamUtilsTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.util; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | 5 | import java.io.ByteArrayInputStream; 6 | import java.io.IOException; 7 | import java.io.InputStream; 8 | import java.nio.CharBuffer; 9 | import java.nio.charset.StandardCharsets; 10 | import org.junit.jupiter.api.Test; 11 | 12 | public class StreamUtilsTest { 13 | @Test 14 | public void testReadToEnd() throws IOException { 15 | // Short string 16 | String string = "Hello world!"; 17 | InputStream stream = new ByteArrayInputStream(string.getBytes(StandardCharsets.UTF_8)); 18 | assertEquals(string, StreamUtils.readToEnd(stream, StandardCharsets.UTF_8)); 19 | 20 | // Long string 21 | string = CharBuffer.allocate(50000).toString().replace('\0', 'A'); 22 | stream = new ByteArrayInputStream(string.getBytes(StandardCharsets.UTF_8)); 23 | assertEquals(string, StreamUtils.readToEnd(stream, StandardCharsets.UTF_8)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/v2/AmountTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.v2; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | 6 | import com.stripe.BaseStripeTest; 7 | import com.stripe.net.ApiResource; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class AmountTest extends BaseStripeTest { 11 | @Test 12 | public void testDeserialize() throws Exception { 13 | final Amount amount = 14 | ApiResource.GSON.fromJson("{\"value\": 10, \"currency\": \"USD\"}", Amount.class); 15 | assertNotNull(amount); 16 | assertEquals(10, amount.getValue()); 17 | assertEquals("USD", amount.getCurrency()); 18 | } 19 | 20 | @Test 21 | public void testDeserializeExtra() throws Exception { 22 | final Amount amount = 23 | ApiResource.GSON.fromJson( 24 | "{\"value\": 10, \"currency\": \"USD\", \"extra\": 42}", Amount.class); 25 | assertNotNull(amount); 26 | assertEquals(10, amount.getValue()); 27 | assertEquals("USD", amount.getCurrency()); 28 | } 29 | 30 | @Test 31 | public void testSerialize() throws Exception { 32 | final String amountJson = ApiResource.GSON.toJson(new Amount(10, "USD"), Amount.class); 33 | assertEquals("{\"value\":10,\"currency\":\"USD\"}", amountJson); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/com/stripe/v2/InstantTest.java: -------------------------------------------------------------------------------- 1 | package com.stripe.v2; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotNull; 5 | import static org.junit.jupiter.api.Assertions.assertNull; 6 | 7 | import com.stripe.net.ApiResource; 8 | import java.time.Instant; 9 | import org.junit.jupiter.api.Test; 10 | 11 | public class InstantTest { 12 | @Test 13 | public void testDeserialize() { 14 | final Instant instant = 15 | ApiResource.GSON.fromJson("\"2023-03-01T22:08:48.920Z\"", Instant.class); 16 | assertNotNull(instant); 17 | assertEquals(Instant.parse("2023-03-01T22:08:48.920Z"), instant); 18 | } 19 | 20 | @Test 21 | public void testDeserializeNull() { 22 | final Instant instant = ApiResource.GSON.fromJson("null", Instant.class); 23 | assertNull(instant); 24 | } 25 | 26 | @Test 27 | public void testSerialize() { 28 | final String instantJson = 29 | ApiResource.GSON.toJson(Instant.parse("2023-03-01T22:08:48.920Z"), Instant.class); 30 | assertEquals("\"2023-03-01T22:08:48.920Z\"", instantJson); 31 | } 32 | 33 | @Test 34 | public void testSerializeNull() { 35 | final String instantJson = ApiResource.GSON.toJson(null, Instant.class); 36 | assertEquals("null", instantJson); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/openapi/README.md: -------------------------------------------------------------------------------- 1 | ## Using custom OpenAPI specification and fixtures files 2 | 3 | You can place custom OpenAPI specification and fixtures files in this 4 | directory. The files must be in JSON format, and must be named `spec3.json` 5 | and `fixtures3.json` respectively. 6 | 7 | If those files are present, the test suite will start its own stripe-mock 8 | process on a random available port. In order for this to work, `stripe-mock` 9 | must be on the `PATH` in the environment used to run the test suite. -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/account_application_deauthorized_old_version.json: -------------------------------------------------------------------------------- 1 | { 2 | "created": 1326853478, 3 | "livemode": false, 4 | "id": "evt_00000000000000", 5 | "type": "account.application.deauthorized", 6 | "object": "event", 7 | "request": null, 8 | "pending_webhooks": 1, 9 | "api_version": "2013-08-15", 10 | "data": { 11 | "object": { 12 | "id": "ca_00000000000000", 13 | "object": "application", 14 | "name": ["old test data array type, now should be string"] 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/account_link.json: -------------------------------------------------------------------------------- 1 | { 2 | "object": "account_link", 3 | "created": 1544220862, 4 | "expires_at": 1544221162, 5 | "url": "https://stripe.com/hv/12345" 6 | } 7 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/bank_account.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ba_123", 3 | "object": "bank_account", 4 | "account_holder_name": "Jane Austen", 5 | "account_holder_type": "individual", 6 | "bank_name": "STRIPE TEST BANK", 7 | "country": "US", 8 | "currency": "usd", 9 | "customer": "cus_123", 10 | "default_for_currency": false, 11 | "fingerprint": "1JWtPxqbdX5Gamtc", 12 | "last4": "6789", 13 | "metadata": { 14 | }, 15 | "routing_number": "110000000", 16 | "status": "new" 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/billing_meter.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "meter_123", 3 | "object": "billing.meter", 4 | "created": 1727303036, 5 | "customer_mapping": { 6 | "event_payload_key": "e1", 7 | "type": "by_id" 8 | }, 9 | "default_aggregation": { 10 | "formula": "sum" 11 | }, 12 | 13 | "display_name": "API Requests", 14 | "event_name": "API Request Made", 15 | "event_time_window": "day", 16 | "livemode": false, 17 | "status": "active", 18 | "status_transitions": { 19 | "deactivated_at": null 20 | }, 21 | "updated": 1727303036, 22 | "value_settings": { 23 | "event_payload_key": "e1" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/billingportal/session.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "bps_123", 3 | "object": "billing_portal.session", 4 | "created": 1587502060, 5 | "customer": "cus_123", 6 | "livemode": true, 7 | "return_url": "https://example.com/account", 8 | "url": "https://billing.stripe.com/session/{SESSION_SECRET}" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/card.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "card_123", 3 | "object": "card", 4 | "address_city": null, 5 | "address_country": null, 6 | "address_line1": null, 7 | "address_line1_check": null, 8 | "address_line2": null, 9 | "address_state": null, 10 | "address_zip": null, 11 | "address_zip_check": null, 12 | "brand": "Visa", 13 | "country": "US", 14 | "customer": "cus_123", 15 | "cvc_check": null, 16 | "dynamic_last4": null, 17 | "exp_month": 8, 18 | "exp_year": 2019, 19 | "fingerprint": "Xt5EWLLDS7FJjR1c", 20 | "funding": "credit", 21 | "last4": "4242", 22 | "metadata": { 23 | }, 24 | "name": null, 25 | "tokenization_method": null 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/charge_level3.json: -------------------------------------------------------------------------------- 1 | { 2 | "line_items": [ 3 | { 4 | "discount_amount": 200, 5 | "product_code": "1234", 6 | "product_description": "description 1", 7 | "quantity": 2, 8 | "tax_amount": 200, 9 | "unit_cost": 1000 10 | }, 11 | { 12 | "discount_amount": 300, 13 | "product_code": "1235", 14 | "product_description": "description 2", 15 | "quantity": 3, 16 | "tax_amount": 300, 17 | "unit_cost": 3000 18 | } 19 | ], 20 | "merchant_reference": "1234", 21 | "shipping_address_zip": "94110", 22 | "shipping_amount": 700 23 | } -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/charge_outcome.json: -------------------------------------------------------------------------------- 1 | { 2 | "network_status": "approved_by_network", 3 | "reason": null, 4 | "risk_level": "normal", 5 | "risk_score": 50, 6 | "seller_message": "Payment complete.", 7 | "type": "authorized" 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/customer_created.json: -------------------------------------------------------------------------------- 1 | { 2 | "created": 1326853478, 3 | "livemode": false, 4 | "id": "evt_00000000000000", 5 | "type": "customer.created", 6 | "object": "event", 7 | "request": null, 8 | "pending_webhooks": 1, 9 | "api_version": "2017-08-15", 10 | "data": { 11 | "object": { 12 | "id": "cus_00000000000000", 13 | "object": "customer", 14 | "name": "Test Platform" 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/customer_with_sources_and_tax_ids.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "cus_123", 3 | "object": "customer", 4 | "address": null, 5 | "balance": 0, 6 | "created": 1598574431, 7 | "currency": "usd", 8 | "default_source": null, 9 | "delinquent": false, 10 | "description": null, 11 | "discount": null, 12 | "email": null, 13 | "invoice_prefix": "657F4A3", 14 | "invoice_settings": { 15 | "custom_fields": null, 16 | "default_payment_method": null, 17 | "footer": null 18 | }, 19 | "livemode": false, 20 | "metadata": {}, 21 | "name": null, 22 | "next_invoice_sequence": 1, 23 | "phone": null, 24 | "preferred_locales": [], 25 | "shipping": null, 26 | "sources": { 27 | "object": "list", 28 | "data": [], 29 | "has_more": false, 30 | "url": "/v1/customers/cus_123/sources" 31 | }, 32 | "tax_exempt": "none", 33 | "tax_ids": { 34 | "object": "list", 35 | "data": [], 36 | "has_more": false, 37 | "url": "/v1/customers/cus_123/tax_ids" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/ephemeral_key.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "ephkey_123", 3 | "object": "ephemeral_key", 4 | "associated_objects": [ 5 | { 6 | "type": "customer", 7 | "id": "cus_123" 8 | } 9 | ], 10 | "created": 100, 11 | "expires": 200, 12 | "livemode": false, 13 | "secret": "ek_test_hunter2" 14 | } 15 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/error_invalid_request.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": { 3 | "code": "parameter_unknown", 4 | "doc_url": "https://stripe.com/docs/error-codes/parameter-unknown", 5 | "message": "Received unknown parameter: foo", 6 | "param": "foo", 7 | "type": "invalid_request_error" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/error_v2_outbound_payment_insufficient_funds.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": { 3 | "type": "temporary_session_expired", 4 | "code": "does not matter", 5 | "message": "Session expired", 6 | "request_log_url": "https://dashboard.stripe.com/logs/req_xyz" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/event_plan.json: -------------------------------------------------------------------------------- 1 | { 2 | "api_version": "2018-09-24", 3 | "created": 1538742675, 4 | "data": { 5 | "object": { 6 | "active": true, 7 | "aggregate_usage": null, 8 | "amount": 2000, 9 | "billing_scheme": "per_unit", 10 | "created": 1540222994, 11 | "currency": "usd", 12 | "id": "gold", 13 | "interval": "month", 14 | "interval_count": 1, 15 | "livemode": false, 16 | "metadata": {}, 17 | "nickname": null, 18 | "object": "plan", 19 | "product": "prod_123", 20 | "tiers": null, 21 | "tiers_mode": null, 22 | "transform_usage": null, 23 | "trial_period_days": null, 24 | "usage_type": "licensed" 25 | } 26 | }, 27 | "id": "evt_123", 28 | "livemode": false, 29 | "object": "event", 30 | "pending_webhooks": 0, 31 | "request": { 32 | "id": "req_123", 33 | "idempotency_key": "key-123" 34 | }, 35 | "type": "plan.created" 36 | } -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/external_account_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "object": "list", 3 | "data": [ 4 | { 5 | "id": "card_123", 6 | "object": "card" 7 | }, 8 | { 9 | "id": "ba_123", 10 | "object": "bank_account", 11 | "account": "acc_123" 12 | }, 13 | { 14 | "id": "bar_123", 15 | "object": "unknown_bar" 16 | } 17 | ] 18 | } 19 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/invoiceitem_with_discount_ids.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": 1000, 3 | "currency": "usd", 4 | "customer": "cus_Hj56dFLtzm170b", 5 | "date": 1234567890, 6 | "description": "My First Invoice Item (created for API docs)", 7 | "discountable": true, 8 | "discounts": [ 9 | "25_5OFF", 10 | "50_5OFF" 11 | ], 12 | "id": "ii_123", 13 | "invoice": null, 14 | "livemode": false, 15 | "metadata": {}, 16 | "object": "invoiceitem", 17 | "period": { 18 | "end": 1595970646, 19 | "start": 1595970646 20 | }, 21 | "plan": null, 22 | "price": null, 23 | "proration": false, 24 | "quantity": 1, 25 | "subscription": null, 26 | "tax_rates": [], 27 | "unit_amount": 1000, 28 | "unit_amount_decimal": "1000" 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/line_item.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "li_123", 3 | "object": "item", 4 | "amount_subtotal": 0, 5 | "amount_total": 0, 6 | "currency": "usd", 7 | "description": "Gold Special", 8 | "price": { 9 | "id": "price_123", 10 | "object": "price", 11 | "active": true, 12 | "billing_scheme": "per_unit", 13 | "created": 1589237394, 14 | "currency": "usd", 15 | "livemode": false, 16 | "lookup_key": null, 17 | "metadata": {}, 18 | "nickname": null, 19 | "product": "prod_123", 20 | "recurring": null, 21 | "tiers": null, 22 | "tiers_mode": null, 23 | "transform_quantity": null, 24 | "type": "one_time", 25 | "unit_amount": 1000, 26 | "unit_amount_decimal": "1000" 27 | }, 28 | "quantity": 1 29 | } 30 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/login_link.json: -------------------------------------------------------------------------------- 1 | { 2 | "object": "login_link", 3 | "created": 1528377855, 4 | "url": "https://connect.stripe.com/express/1234567890ab" 5 | } 6 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/payout_with_del_ext_bank_acct_expansion.json: -------------------------------------------------------------------------------- 1 | { 2 | "amount": 1100, 3 | "arrival_date": 1234567890, 4 | "automatic": true, 5 | "balance_transaction": "txn_123", 6 | "created": 1234567890, 7 | "currency": "usd", 8 | "description": "STRIPE TRANSFER", 9 | "destination": { 10 | "id": "ba_123", 11 | "object": "bank_account", 12 | "deleted": true 13 | }, 14 | "failure_balance_transaction": null, 15 | "failure_code": null, 16 | "failure_message": null, 17 | "id": "po_123", 18 | "livemode": false, 19 | "metadata": {}, 20 | "method": "standard", 21 | "object": "payout", 22 | "source_type": "card", 23 | "statement_descriptor": null, 24 | "status": "paid", 25 | "type": "bank_account" 26 | } 27 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/person_old_document_expanded.json: -------------------------------------------------------------------------------- 1 | { 2 | "account": "acct_123", 3 | "created": 1234567890, 4 | "dob": { 5 | "day": null, 6 | "month": null, 7 | "year": null 8 | }, 9 | "first_name": null, 10 | "id": "person_123", 11 | "last_name": null, 12 | "metadata": { 13 | }, 14 | "object": "person", 15 | "relationship": { 16 | "account_opener": false, 17 | "director": false, 18 | "owner": false, 19 | "percent_ownership": null, 20 | "title": null 21 | }, 22 | "requirements": { 23 | "currently_due": [], 24 | "eventually_due": [], 25 | "past_due": [] 26 | }, 27 | "ssn_last_4_provided": false, 28 | "verification": { 29 | "details": null, 30 | "details_code": null, 31 | "document": { 32 | "created": 1234567890, 33 | "filename": "file_123", 34 | "id": "file_123", 35 | "links": { 36 | "data": [], 37 | "has_more": false, 38 | "object": "list", 39 | "url": "/v1/file_links?file=file_123" 40 | }, 41 | "object": "file", 42 | "purpose": "identity_document", 43 | "size": 9863, 44 | "title": null, 45 | "type": "png", 46 | "url": null 47 | }, 48 | "document_back": null, 49 | "status": "unverified" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/person_old_document_unexpanded.json: -------------------------------------------------------------------------------- 1 | { 2 | "account": "acct_123", 3 | "created": 1234567890, 4 | "dob": { 5 | "day": null, 6 | "month": null, 7 | "year": null 8 | }, 9 | "first_name": null, 10 | "id": "person_123", 11 | "last_name": null, 12 | "metadata": { 13 | }, 14 | "object": "person", 15 | "relationship": { 16 | "account_opener": false, 17 | "director": false, 18 | "owner": false, 19 | "percent_ownership": null, 20 | "title": null 21 | }, 22 | "requirements": { 23 | "currently_due": [], 24 | "eventually_due": [], 25 | "past_due": [] 26 | }, 27 | "ssn_last_4_provided": false, 28 | "verification": { 29 | "details": null, 30 | "details_code": null, 31 | "document": "file_123", 32 | "document_back": null, 33 | "status": "unverified" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/setup_attempt.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "setatt_123", 3 | "object": "setup_attempt", 4 | "application": "ca_123", 5 | "created": 1562004309, 6 | "customer": "cus_123", 7 | "livemode": false, 8 | "on_behalf_of": "acct_123", 9 | "payment_method": "pm_123", 10 | "payment_method_details": { 11 | "type": "card" 12 | }, 13 | "setup_error": null, 14 | "setup_intent": "seti_123", 15 | "status": "succeeded", 16 | "usage": "off_session" 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/source_detached.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "src_123", 3 | "object": "source", 4 | "ach_credit_transfer": { 5 | "account_number": "test_52796e3294dc", 6 | "bank_name": "TEST BANK", 7 | "fingerprint": null, 8 | "routing_number": "110000000", 9 | "swift_code": "TSTEZ122" 10 | }, 11 | "client_secret": "src_client_secret_123", 12 | "created": 1234567890, 13 | "currency": "usd", 14 | "customer": null, 15 | "flow": "receiver", 16 | "livemode": false, 17 | "metadata": {}, 18 | "owner": { 19 | "address": null, 20 | "email": "jenny.rosen@example.com", 21 | "name": null, 22 | "phone": null, 23 | "verified_address": null, 24 | "verified_email": null, 25 | "verified_name": null, 26 | "verified_phone": null 27 | }, 28 | "receiver": { 29 | "address": "121042882-38381234567890123", 30 | "amount_charged": 0, 31 | "amount_received": 0, 32 | "amount_returned": 0 33 | }, 34 | "status": "pending", 35 | "type": "ach_credit_transfer", 36 | "usage": "consumed" 37 | } 38 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/source_transactions.json: -------------------------------------------------------------------------------- 1 | { 2 | "object": "list", 3 | "data": [ 4 | { 5 | "id": "srctxn_123", 6 | "object": "source_transaction", 7 | "amount": 1000, 8 | "created": 1506086518, 9 | "currency": "usd", 10 | "livemode": false, 11 | "source": "src_123", 12 | "type": "ach_credit_transfer", 13 | "ach_credit_transfer": { 14 | "last4": "db67", 15 | "routing_number": "110000000", 16 | "fingerprint": "U9AqfhJoSWCOImOv" 17 | } 18 | } 19 | ], 20 | "has_more": false, 21 | "url": "/v1/sources/src_123/source_transactions" 22 | } 23 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/terminal/connection_token.json: -------------------------------------------------------------------------------- 1 | { 2 | "object": "terminal.connection_token", 3 | "secret": "pst_test_KHAvP1SrGh1Lz75yMBiU6NV" 4 | } -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/usage_record.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "mbur_123", 3 | "object": "usage_record", 4 | "livemode": false, 5 | "quantity": 100, 6 | "subscription_item": "si_123", 7 | "timestamp": 1528128974 8 | } 9 | -------------------------------------------------------------------------------- /src/test/resources/api_fixtures/usage_record_summary.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "sis_123", 3 | "object": "usage_record_summary", 4 | "invoice": "in_123", 5 | "livemode": false, 6 | "period": { 7 | "end": 1494289000, 8 | "start": 1494288000 9 | }, 10 | "subscription_item": "si_123", 11 | "total_usage": 1 12 | } -------------------------------------------------------------------------------- /src/test/resources/model_fixtures/pageable_model_page_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "pm_123", 5 | "object": "pageablemodel" 6 | }, 7 | { 8 | "id": "pm_124", 9 | "object": "pageablemodel" 10 | } 11 | ], 12 | "has_more": true, 13 | "object": "list", 14 | "url": "/v1/pageable_models" 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/model_fixtures/pageable_model_page_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "pm_125", 5 | "object": "pageablemodel" 6 | }, 7 | { 8 | "id": "pm_126", 9 | "object": "pageablemodel" 10 | } 11 | ], 12 | "has_more": true, 13 | "object": "list", 14 | "url": "/v1/pageable_models" 15 | } 16 | -------------------------------------------------------------------------------- /src/test/resources/model_fixtures/pageable_model_page_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "pm_127", 5 | "object": "pageablemodel" 6 | } 7 | ], 8 | "has_more": false, 9 | "object": "list", 10 | "url": "/v1/pageable_models" 11 | } 12 | -------------------------------------------------------------------------------- /src/test/resources/model_fixtures/searchable_model_page_0.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "pm_123", 5 | "object": "searchablemodel" 6 | }, 7 | { 8 | "id": "pm_124", 9 | "object": "searchablemodel" 10 | } 11 | ], 12 | "has_more": true, 13 | "object": "search_result", 14 | "next_page": "page1", 15 | "total_count": 5, 16 | "url": "/v1/searchable_models" 17 | } 18 | -------------------------------------------------------------------------------- /src/test/resources/model_fixtures/searchable_model_page_1.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "pm_125", 5 | "object": "searchablemodel" 6 | }, 7 | { 8 | "id": "pm_126", 9 | "object": "searchablemodel" 10 | } 11 | ], 12 | "has_more": true, 13 | "object": "search_result", 14 | "next_page": "page2", 15 | "url": "/v1/searchable_models" 16 | } 17 | -------------------------------------------------------------------------------- /src/test/resources/model_fixtures/searchable_model_page_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "data": [ 3 | { 4 | "id": "pm_127", 5 | "object": "searchablemodel" 6 | } 7 | ], 8 | "has_more": false, 9 | "object": "search_result", 10 | "next_page": null, 11 | "url": "/v1/searchable_models" 12 | } 13 | -------------------------------------------------------------------------------- /src/test/resources/oauth_fixtures/error_invalid_client.json: -------------------------------------------------------------------------------- 1 | { 2 | "error": "invalid_client", 3 | "error_description": "No authentication was provided. Send your secret API key using the Authorization header, or as a client_secret POST parameter." 4 | } 5 | -------------------------------------------------------------------------------- /src/test/resources/oauth_fixtures/token_response.json: -------------------------------------------------------------------------------- 1 | { 2 | "access_token": "sk_test_access_token", 3 | "livemode": false, 4 | "refresh_token": "rt_refresh_token", 5 | "token_type": "bearer", 6 | "stripe_publishable_key": "pk_test_stripe_publishable_key", 7 | "stripe_user_id": "acct_test_token", 8 | "scope": "read_only" 9 | } 10 | -------------------------------------------------------------------------------- /src/test/resources/test.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/stripe/stripe-java/d177cbc62bb595399e298288fe9803c1d213a3ac/src/test/resources/test.png --------------------------------------------------------------------------------