Skip to main content

Crate stripe_pay_core

Crate stripe_pay_core 

Source
Expand description

stripe-pay-core

Shared Stripe domain types for the stripe-pay-sdk workspace: money handling, typed Stripe identifiers, payment intents, charges, refunds, structured errors, and Stripe’s bracketed form encoding.

Macros§

json
Construct a serde_json::Value from a JSON literal.

Structs§

CardDetails
The non-sensitive card details Stripe exposes on a PaymentMethod.
Charge
A Charge as returned by Stripe’s REST API.
Decimal
Decimal represents a 128 bit representation of a fixed-precision decimal number. The finite set of values of type Decimal are of the form m / 10e, where m is an integer such that -296 < m < 296, and e is an integer between 0 and 28 inclusive.
FormField
A form field destined for Stripe’s application/x-www-form-urlencoded request body.
FormParams
An ordered collection of Stripe form parameters.
Money
A currency amount stored in Stripe’s smallest denomination.
PaymentIntent
A PaymentIntent as returned by Stripe’s REST API.
Refund
A Refund as returned by Stripe’s REST API.
StripeId
A typed Stripe object identifier such as pi_3Abc... or cus_9Xyz....

Enums§

CardBrand
The card network a non-sensitive card belongs to.
ChargeStatus
Whether the charge actually took the customer’s money.
Currency
A unit of currency, using Stripe’s own naming for each variant.
PaymentIntentNextAction
What the customer must do to move a PaymentIntent forward.
PaymentIntentStatus
The lifecycle state of a PaymentIntent.
PaymentMethodKind
How the customer paid.
RefundReason
Why Stripe moved a charge’s money back to the customer.
StripeError
A failure Stripe reported, or a transport failure on the way there.
StripeIdKind
The resource family a StripeId addresses.
StripeParseError
A failure raised while constructing or interpreting core types.
Value
Represents any valid JSON value.

Constants§

CARD_BRAND_AMEX
Wire string for an American Express card.
CARD_BRAND_DINERS
Wire string for a Diners Club card.
CARD_BRAND_DISCOVER
Wire string for a Discover card.
CARD_BRAND_JCB
Wire string for a JCB card.
CARD_BRAND_MASTERCARD
Wire string for a Mastercard card.
CARD_BRAND_OTHER
Wire string for a brand outside the set this crate enumerates.
CARD_BRAND_UNIONPAY
Wire string for a UnionPay card.
CARD_BRAND_VISA
Wire string for a Visa card.
CARD_LAST4_CHARS
Number of trailing digits Stripe retains for a card.
CHARGE_STATUS_AUTHORIZED
Wire string for ChargeStatus::Authorized.
CHARGE_STATUS_FAILED
Wire string for ChargeStatus::Failed.
CHARGE_STATUS_PENDING
Wire string for ChargeStatus::Pending.
CHARGE_STATUS_SUCCEEDED
Wire string for ChargeStatus::Succeeded.
CHARGE_TYPE_CHARGE
Stripe’s type discriminator for a successful charge.
DEFAULT_CURRENCY_EXPONENT
Number of decimal places a two-decimal currency stores.
DEFAULT_WEBHOOK_TOLERANCE_SECONDS
Default tolerance, in seconds, when validating a webhook timestamp.
EXPAND_PREFIX
Prefix of the bracketed key carrying Stripe expand entries.
FORM_AMOUNT
Form parameter carrying a PaymentIntent or Refund amount.
FORM_CARD_EXP_MONTH
Form parameter carrying a non-sensitive card’s expiry month.
FORM_CARD_EXP_YEAR
Form parameter carrying a non-sensitive card’s expiry year.
FORM_CARD_LAST4
Form parameter carrying a non-sensitive card’s last four digits.
FORM_CHARGE
Form parameter carrying a Stripe charge identifier.
FORM_CLOSE_BRACKET
Close bracket used in Stripe’s bracketed parameter names.
FORM_CONFIRM
Form parameter requesting immediate confirmation.
FORM_CURRENCY
Form parameter carrying an ISO 4217 currency code.
FORM_CUSTOMER
Form parameter carrying a Stripe customer identifier.
FORM_DESCRIPTION
Form parameter carrying a customer’s internal description.
FORM_EMAIL
Form parameter carrying a customer’s email address.
FORM_KEY_VALUE_SEPARATOR
Separator between a form key and its value.
FORM_OPEN_BRACKET
Open bracket used in Stripe’s bracketed parameter names.
FORM_PAIR_SEPARATOR
Separator between two key=value pairs in an encoded form body.
FORM_PAYMENT_INTENT
Form parameter naming the PaymentIntent being confirmed.
FORM_PAYMENT_METHOD
Form parameter naming the payment method used to confirm.
FORM_REASON
Form parameter carrying a refund’s reason.
FORM_RETURN_URL
Form parameter carrying the browser return URL after 3-D Secure.
ID_PREFIX
Literal prefix shared by Stripe’s legacy object identifiers.
METADATA_KEY_LIMIT_MESSAGE
Diagnostic for a metadata key outside Stripe’s documented limit.
METADATA_KEY_MAX_CHARS
Longest metadata key Stripe accepts.
METADATA_PREFIX
Prefix of the bracketed key carrying Stripe metadata entries.
METADATA_VALUE_LIMIT_MESSAGE
Diagnostic for a metadata value outside Stripe’s documented limit.
METADATA_VALUE_MAX_CHARS
Longest metadata value Stripe accepts.
METHOD_KIND_BANK_TRANSFER
Wire string for PaymentMethodKind::BankTransfer.
METHOD_KIND_CARD
Wire string for PaymentMethodKind::Card.
METHOD_KIND_SEPA_DEBIT
Wire string for PaymentMethodKind::SepaDebit.
METHOD_KIND_WALLET
Wire string for PaymentMethodKind::Wallet.
MINOR_UNITS_DIVISOR
Divisor converting a major-unit amount into minor units.
OBJECT_CHARGE
Stripe object name for a Charge.
OBJECT_CHECKOUT_SESSION
Stripe object name for a Checkout Session.
OBJECT_CUSTOMER
Stripe object name for a Customer.
OBJECT_DISCRIMINATOR
Stripe’s object discriminator shared by every Stripe object.
OBJECT_EVENT
Stripe object name for a webhook Event.
OBJECT_PAYMENT_INTENT
Stripe object name for a PaymentIntent.
OBJECT_PAYMENT_METHOD
Stripe object name for a PaymentMethod.
OBJECT_REFUND
Stripe object name for a Refund.
PLUS_SIGN
The character a space becomes in a form body.
REASON_DUPLICATE
Wire string for RefundReason::Duplicate.
REASON_FRAUDULENT
Wire string for RefundReason::Fraudulent.
REASON_ORDER_CANCELLATION
Wire string for RefundReason::OrderCancellation.
REASON_REQUESTED_BY_CUSTOMER
Wire string for RefundReason::RequestedByCustomer.
SPACE
The byte a space encodes to in a form body.
STATUS_CANCELED
Wire string for PaymentIntentStatus::Canceled.
STATUS_PROCESSING
Wire string for PaymentIntentStatus::Processing.
STATUS_REQUIRES_ACTION
Wire string for PaymentIntentStatus::RequiresAction.
STATUS_REQUIRES_CAPTURE
Wire string for PaymentIntentStatus::RequiresCapture.
STATUS_REQUIRES_CONFIRMATION
Wire string for PaymentIntentStatus::RequiresConfirmation.
STATUS_REQUIRES_PAYMENT_METHOD
Wire string for PaymentIntentStatus::RequiresPaymentMethod.
STATUS_SUCCEEDED
Wire string for PaymentIntentStatus::Succeeded.
STRIPE_API_BASE_URL
Base URL of the Stripe REST API.
STRIPE_API_VERSION
Stripe API version this crate is written against.
STRIPE_ERROR_API_CONNECTION
Stripe error code for a request that never reached the API.
STRIPE_ERROR_CARD_DECLINED
Stripe error code for a declined card, which is a settled answer.
STRIPE_ERROR_LOCK_TIMEOUT
Stripe error code for a lock the account is still holding.
STRIPE_ERROR_RATE_LIMIT
Stripe error code for a request rejected by the rate limiter.
TRUE_LITERAL
Wire value Stripe reads as boolean true in a form body.
UNRESERVED_DASH
Byte of the hyphen form encoding passes through unescaped.
UNRESERVED_DOT
Byte of the dot form encoding passes through unescaped.
UNRESERVED_TILDE
Byte of the tilde form encoding passes through unescaped.
UNRESERVED_UNDERSCORE
Byte of the underscore form encoding passes through unescaped.
ZERO_DECIMAL_EXPONENT
Number of decimal places a zero-decimal currency stores.

Traits§

Deserialize
A data structure that can be deserialized from any data format supported by Serde.
FromPrimitive
A generic trait for converting a number to a value.
Serialize
A data structure that can be serialized into any data format supported by Serde.
ToPrimitive
A generic trait for converting a value to a number.

Derive Macros§

CustomDebug
A procedural macro that implements the std::fmt::Debug trait for a type, with support for the #[debug(skip)] attribute to skip specific fields.
Data
A procedural macro that combines getter, mutable getter, and setter functionality in a single derive.
Deserialize
Derive macro available if serde is built with features = ["derive"].
DisplayDebug
A procedural macro that implements the std::fmt::Display trait for a type, using the standard debug format ({:?}) for formatting.
DisplayDebugFormat
A procedural macro that implements the std::fmt::Display trait for a type, using the detailed debug format ({:#?}) for formatting.
Getter
A procedural macro that automatically generates getter methods for struct and enum fields.
GetterMut
A procedural macro that automatically generates mutable getter methods for struct and enum fields.
New
A procedural macro that generates a constructor function for structs.
Serialize
Derive macro available if serde is built with features = ["derive"].
Setter
A procedural macro that automatically generates setter methods for struct and enum fields.