Crate stripe[−][src]
This crate provides Rust bindings to the Stripe HTTP API.
Getting Started
To get started, we need to create a client:
let client = stripe::Client::new("sk_test_YOUR_STRIPE_SECRET");
Then we can begin making requests as we'd like. Most Stripe requests accept
many optional parameters, so we usually get the ::new(...)
with any required
params and then set the ones we want from there.
Most requests for creating or updating a Stripe object use the same Rust struct, so you may frequently need to refer to the official API docs to determine which fields are required for either request.
/* Creating a Stripe Charge */ let token = "tok_ID_FROM_CHECKOUT".parse().unwrap(); let mut params = stripe::CreateCharge::new(); // NOTE: Stripe represents currency in the lowest denominations (e.g. cents) params.amount = Some(1095); // e.g. $10.95 params.source = Some(stripe::ChargeSourceParams::Token(token)); // Example: Override currency to be in Canadian Dollars params.currency = Some(stripe::Currency::CAD); let charge = stripe::Charge::create(&client, params).unwrap(); println!("{:?}", charge); // => Charge { id: "ch_12345", amount: 1095, .. }
/* Listing Stripe Charges */ let params = stripe::ListCharges::new(); let charges = stripe::Charge::list(&client, params).unwrap(); println!("{:?}", charges); // => List { data: [Charge { id: "ch_12345", .. }] }
Structs
Enums
AccountCapabilitiesBacsDebitPayments | An enum representing the possible values of an |
AccountCapabilitiesBancontactPayments | An enum representing the possible values of an |
AccountCapabilitiesCartesBancairesPayments | An enum representing the possible values of an |
AccountCapabilitiesEpsPayments | An enum representing the possible values of an |
AccountCapabilitiesFpxPayments | An enum representing the possible values of an |
AccountCapabilitiesGiropayPayments | An enum representing the possible values of an |
AccountCapabilitiesGrabpayPayments | An enum representing the possible values of an |
AccountCapabilitiesIdealPayments | An enum representing the possible values of an |
AccountCapabilitiesOxxoPayments | An enum representing the possible values of an |
AccountCapabilitiesP24Payments | An enum representing the possible values of an |
AccountCapabilitiesSepaDebitPayments | An enum representing the possible values of an |
AccountCapabilitiesSofortPayments | An enum representing the possible values of an |
AccountHolderType | An enum representing the possible values of a |
AccountRequirementsErrorCode | An enum representing the possible values of an |
AccountType | An enum representing the possible values of an |
ApiErrors | |
ApiVersion | An enum representing the versions of the Stripe API. |
BalanceTransactionSource | |
BalanceTransactionSourceId | |
BalanceTransactionStatus | An enum representing the possible values of an |
BalanceTransactionType | An enum representing the possible values of an |
BankAccountAvailablePayoutMethods | An enum representing the possible values of an |
BankAccountStatus | An enum representing the possible values of an |
BusinessType | |
CapabilityStatus | An enum representing the possible values of an |
CaptureMethod | The resource representing a Stripe CaptureMethod object. |
CardBrand | |
CardType | |
ChargeSourceParams | The set of PaymentSource parameters that can be used to create a charge. |
CheckResult | |
CheckoutSessionBillingAddressCollection | An enum representing the possible values of an |
CheckoutSessionLocale | An enum representing the possible values of an |
CheckoutSessionMode | An enum representing the possible values of an |
CheckoutSessionPaymentStatus | An enum representing the possible values of an |
CheckoutSessionSubmitType | An enum representing the possible values of an |
CollectionMethod | An enum representing the possible values of an |
CompanyParamsStructure | An enum representing the possible values of an |
CompanyStructure | An enum representing the possible values of an |
ConfirmationMethod | The resource representing a Stripe ConfirmationMethod object. |
CouponDuration | An enum representing the possible values of an |
CreatePaymentMethodEpsBank | An enum representing the possible values of an |
CreatePaymentMethodFpxBank | An enum representing the possible values of an |
CreatePaymentMethodIdealBank | An enum representing the possible values of an |
CreatePaymentMethodP24Bank | An enum representing the possible values of an |
CreatePaymentMethodSofortCountry | An enum representing the possible values of an |
CreatePriceRecurringAggregateUsage | An enum representing the possible values of an |
CreatePriceRecurringInterval | An enum representing the possible values of an |
CreatePriceRecurringUsageType | An enum representing the possible values of an |
CreatePriceTransformQuantityRound | An enum representing the possible values of an |
CreateSetupIntentMandateDataCustomerAcceptanceType | An enum representing the possible values of an |
CreateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure | An enum representing the possible values of an |
CreateSourceSourceOrderItemsType | An enum representing the possible values of an |
CreateSubscriptionSchedulePhasesBillingCycleAnchor | An enum representing the possible values of an |
CreateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval | An enum representing the possible values of an |
Currency | Currency is the list of supported currencies. |
CustomerAcceptanceType | An enum representing the possible values of an |
CustomerTaxExempt | An enum representing the possible values of an |
CustomerTaxExemptFilter | An enum representing the possible values of an |
DelayDays | |
DelayDaysOther | |
DetachedSource | |
DisputeStatus | An enum representing the possible values of an |
Error | An error encountered when communicating with the Stripe API. |
ErrorCode | The list of possible values for a RequestError's code. |
ErrorType | The list of possible values for a RequestError's type. |
EventFilter | An enum representing the possible values of an |
EventObject | |
EventType | |
Expandable | An id or object. |
ExternalAccount | |
FeeType | An enum representing the possible values of an |
FilePurpose | An enum representing the possible values of an |
FraudDetailsReport | An enum representing the possible values of a |
IdOrCreate | |
InvoiceBillingReason | An enum representing the possible values of an |
InvoiceCustomerTaxExempt | An enum representing the possible values of an |
InvoiceLineItemId | |
InvoiceLineItemType | An enum representing the possible values of an |
InvoiceStatus | An enum representing the possible values of an |
InvoiceStatusFilter | An enum representing the possible values of an |
IssuingAuthorizationCheck | An enum representing the possible values of the |
IssuingAuthorizationMethod | An enum representing the possible values of the |
IssuingAuthorizationReason | An enum representing the possible values of the |
IssuingAuthorizationStatus | An enum representing the possible values of an |
IssuingAuthorizationWalletProvider | An enum representing the possible values of an |
IssuingCardCancellationReason | An enum representing the possible values of an |
IssuingCardPinStatus | An enum representing the possible values of an |
IssuingCardReplacementReason | An enum representing the possible values of an |
IssuingCardShippingCarrier | An enum representing the possible values of an |
IssuingCardShippingService | An enum representing the possible values of an |
IssuingCardShippingStatus | An enum representing the possible values of an |
IssuingCardShippingType | An enum representing the possible values of an |
IssuingCardStatus | An enum representing the possible values of an |
IssuingCardType | An enum representing the possible values of an |
IssuingCardholderRequirementsDisabledReason | An enum representing the possible values of an |
IssuingCardholderRequirementsPastDue | An enum representing the possible values of an |
IssuingCardholderStatus | An enum representing the possible values of an |
IssuingCardholderType | An enum representing the possible values of an |
IssuingDisputeCanceledEvidenceProductType | An enum representing the possible values of an |
IssuingDisputeCanceledEvidenceReturnStatus | An enum representing the possible values of an |
IssuingDisputeEvidenceReason | An enum representing the possible values of an |
IssuingDisputeMerchandiseNotAsDescribedEvidenceReturnStatus | An enum representing the possible values of an |
IssuingDisputeNotReceivedEvidenceProductType | An enum representing the possible values of an |
IssuingDisputeOtherEvidenceProductType | An enum representing the possible values of an |
IssuingDisputeReason | An enum representing the possible values of an |
IssuingDisputeStatus | An enum representing the possible values of an |
IssuingTransactionType | An enum representing the possible values of an |
ListPricesRecurringInterval | An enum representing the possible values of an |
ListPricesRecurringUsageType | An enum representing the possible values of an |
MandateBacsDebitNetworkStatus | An enum representing the possible values of an |
MandateStatus | An enum representing the possible values of an |
MandateType | An enum representing the possible values of an |
MerchantCategory | An enum representing the industry of a merchant. |
OffSessionOther | |
OrderItemParamsType | An enum representing the possible values of an |
OrderStatus | An enum representing the possible values of an |
OrderStatusFilter | An enum representing the possible values of an |
PaymentErrorType | The resource representing a Stripe PaymentErrorType object. |
PaymentIntentCancellationReason | An enum representing the possible values of an |
PaymentIntentCaptureMethod | An enum representing the possible values of an |
PaymentIntentConfirmationMethod | An enum representing the possible values of an |
PaymentIntentMethodType | Represents the way a |
PaymentIntentNextActionType | |
PaymentIntentOffSession | |
PaymentIntentStatus | An enum representing the possible values of an |
PaymentMethodDetailsAchDebitAccountHolderType | An enum representing the possible values of an |
PaymentMethodDetailsBancontactPreferredLanguage | An enum representing the possible values of an |
PaymentMethodDetailsCardWalletType | An enum representing the possible values of an |
PaymentMethodDetailsEpsBank | An enum representing the possible values of an |
PaymentMethodDetailsFpxBank | An enum representing the possible values of an |
PaymentMethodDetailsIdealBank | An enum representing the possible values of an |
PaymentMethodDetailsIdealBic | An enum representing the possible values of an |
PaymentMethodDetailsInteracPresentReadMethod | An enum representing the possible values of an |
PaymentMethodDetailsInteracPresentReceiptAccountType | An enum representing the possible values of an |
PaymentMethodDetailsP24Bank | An enum representing the possible values of an |
PaymentMethodDetailsSofortPreferredLanguage | An enum representing the possible values of an |
PaymentMethodEpsBank | An enum representing the possible values of an |
PaymentMethodFpxBank | An enum representing the possible values of an |
PaymentMethodIdealBank | An enum representing the possible values of an |
PaymentMethodIdealBic | An enum representing the possible values of an |
PaymentMethodP24Bank | An enum representing the possible values of an |
PaymentMethodType | An enum representing the possible values of an |
PaymentMethodTypeFilter | An enum representing the possible values of an |
PaymentPagesCheckoutSessionCustomerDetailsTaxExempt | An enum representing the possible values of an |
PaymentPagesCheckoutSessionTaxIdType | An enum representing the possible values of an |
PaymentSource | A PaymentSource represents a payment method associated with a customer or charge. This value is usually returned as a subresource on another request. |
PaymentSourceId | |
PaymentSourceParams | A PaymentSourceParams represents all of the supported ways that can
be used to creating a new customer with a payment method or creating
a payment method directly for a customer via |
PayoutDestination | |
PayoutDestinationId | |
PayoutMethod | An enum representing the possible values of an |
PayoutSourceType | An enum representing the possible values of an |
PayoutType | An enum representing the possible values of an |
PersonParamsPoliticalExposure | An enum representing the possible values of an |
PersonPoliticalExposure | An enum representing the possible values of an |
PlanAggregateUsage | An enum representing the possible values of an |
PlanBillingScheme | An enum representing the possible values of an |
PlanInterval | An enum representing the possible values of an |
PlanTiersMode | An enum representing the possible values of an |
PlanUsageType | An enum representing the possible values of an |
PriceBillingScheme | An enum representing the possible values of an |
PriceTiersMode | An enum representing the possible values of an |
PriceType | An enum representing the possible values of an |
RangeQuery | A set of generic request parameters that can be used on list endpoints to filter their results by some timestamp. |
RecipientType | An enum representing the possible values of an |
RecurringAggregateUsage | An enum representing the possible values of an |
RecurringInterval | An enum representing the possible values of an |
RecurringUsageType | An enum representing the possible values of an |
RefundReason | An enum representing the possible values of an |
ReviewClosedReason | An enum representing the possible values of an |
ReviewOpenedReason | An enum representing the possible values of an |
ReviewReason | An enum representing the possible values of an |
Scheduled | |
ScheduledOther | |
SetupAttemptPaymentMethodDetailsBancontactPreferredLanguage | An enum representing the possible values of an |
SetupAttemptPaymentMethodDetailsIdealBank | An enum representing the possible values of an |
SetupAttemptPaymentMethodDetailsIdealBic | An enum representing the possible values of an |
SetupAttemptPaymentMethodDetailsSofortPreferredLanguage | An enum representing the possible values of an |
SetupIntentCancellationReason | An enum representing the possible values of an |
SetupIntentPaymentMethodOptionsCardRequestThreeDSecure | An enum representing the possible values of an |
SetupIntentStatus | An enum representing the possible values of an |
SetupIntentUsage | |
ShippingAddressCollectionAllowedCountries | An enum representing the possible values of an |
SourceAcceptanceParamsStatus | An enum representing the possible values of an |
SourceAcceptanceParamsType | An enum representing the possible values of an |
SourceFlow | An enum representing the possible values of an |
SourceMandateInterval | An enum representing the possible values of an |
SourceMandateNotificationMethod | An enum representing the possible values of an |
SourceRedirectFlowFailureReason | An enum representing the possible values of an |
SourceRedirectFlowStatus | An enum representing the possible values of an |
SourceRefundNotificationMethod | An enum representing the possible values of an |
SourceStatus | An enum representing the possible values of an |
SourceType | An enum representing the possible values of an |
SourceUsage | An enum representing the possible values of an |
SpendingLimitInterval | An enum representing the possible values of an |
SubscriptionBillingCycleAnchor | An enum representing the possible values of an |
SubscriptionPaymentBehavior | An enum representing the possible values of an |
SubscriptionProrationBehavior | An enum representing the possible values of an |
SubscriptionScheduleDefaultSettingsBillingCycleAnchor | An enum representing the possible values of an |
SubscriptionScheduleDefaultSettingsCollectionMethod | An enum representing the possible values of an |
SubscriptionScheduleDefaultSettingsParamsBillingCycleAnchor | An enum representing the possible values of an |
SubscriptionScheduleEndBehavior | An enum representing the possible values of an |
SubscriptionSchedulePhaseConfigurationBillingCycleAnchor | An enum representing the possible values of an |
SubscriptionScheduleStatus | An enum representing the possible values of an |
SubscriptionStatus | An enum representing the possible values of an |
SubscriptionStatusFilter | An enum representing the possible values of an |
SubscriptionsResourcePauseCollectionBehavior | An enum representing the possible values of an |
TaxIdType | An enum representing the possible values of an |
TaxIdVerificationStatus | An enum representing the possible values of an |
TokenId | |
TokenType | An enum representing the possible values of an |
TokenizationMethod | |
TopupStatus | An enum representing the possible values of an |
TopupStatusFilter | An enum representing the possible values of an |
TransferScheduleInterval | An enum representing the possible values of an |
TransferSourceType | An enum representing the possible values of an |
TransformQuantityRound | An enum representing the possible values of an |
TransformUsageRound | An enum representing the possible values of an |
UpTo | |
UpToOther | |
UpdateSetupIntentPaymentMethodOptionsCardRequestThreeDSecure | An enum representing the possible values of an |
UpdateSourceSourceOrderItemsType | An enum representing the possible values of an |
UpdateSubscriptionPauseCollectionBehavior | An enum representing the possible values of an |
UpdateSubscriptionSchedulePhasesBillingCycleAnchor | An enum representing the possible values of an |
UpdateSubscriptionSchedulePhasesItemsPriceDataRecurringInterval | An enum representing the possible values of an |
WalletDetailsType | An enum representing the possible values of an |
WebhookEndpointStatus | An enum representing the possible values of an |
WebhookError | An error encountered when communicating with the Stripe API webhooks. |
Weekday | A day of the week. |
Traits
Object | Implemented by types which represent stripe objects. |
Type Definitions
Client | |
InvoiceCollectionMethod | Deprecated |
Metadata | |
Response | |
Timestamp |