Expand description
stripe-pay-server
Server-side transport for the Stripe payment SDK: signed webhook
verification over the shared stripe-pay-core domain types.
Modules§
- self
- Utilities for formatting and printing
Strings.
Macros§
- json
- Construct a
serde_json::Valuefrom a JSON literal.
Structs§
- Card
Details - The non-sensitive card details Stripe exposes on a PaymentMethod.
- Charge
- A Charge as returned by Stripe’s REST API.
- Decimal
Decimalrepresents a 128 bit representation of a fixed-precision decimal number. The finite set of values of typeDecimalare 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.- Form
Field - A form field destined for Stripe’s
application/x-www-form-urlencodedrequest body. - Form
Params - An ordered collection of Stripe form parameters.
- Formatter
- Configuration for formatting.
- Hmac
- Generic HMAC instance.
- Money
- A currency amount stored in Stripe’s smallest denomination.
- Payment
Intent - A PaymentIntent as returned by Stripe’s REST API.
- Refund
- A Refund as returned by Stripe’s REST API.
- Sha256
- SHA-256 hasher.
- Stripe
Id - A typed Stripe object identifier such as
pi_3Abc...orcus_9Xyz.... - Webhook
Event - A webhook payload whose signature Stripe vouches for.
Enums§
- Card
Brand - The card network a non-sensitive card belongs to.
- Charge
Status - Whether the charge actually took the customer’s money.
- Currency
- A unit of currency, using Stripe’s own naming for each variant.
- Payment
Intent Next Action - What the customer must do to move a PaymentIntent forward.
- Payment
Intent Status - The lifecycle state of a PaymentIntent.
- Payment
Method Kind - How the customer paid.
- Refund
Reason - Why Stripe moved a charge’s money back to the customer.
- Stripe
Error - A failure Stripe reported, or a transport failure on the way there.
- Stripe
IdKind - The resource family a
StripeIdaddresses. - Stripe
Parse Error - A failure raised while constructing or interpreting core types.
- Value
- Represents any valid JSON value.
- Webhook
Error - Why a webhook signature was rejected.
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
typediscriminator for a successful charge. - DEFAULT_
CURRENCY_ EXPONENT - Number of decimal places a two-decimal currency stores.
- DEFAULT_
TOLERANCE_ SECONDS - Drift Stripe recommends tolerating, in seconds.
- DEFAULT_
WEBHOOK_ TOLERANCE_ SECONDS - Default tolerance, in seconds, when validating a webhook timestamp.
- DIGEST_
HEX_ CHARS - Number of hex characters in one SHA-256 digest.
- EXPAND_
PREFIX - Prefix of the bracketed key carrying Stripe
expandentries. - 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=valuepairs 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.
- HEADER_
SIGNATURE - Header carrying the signed timestamp and digest.
- ID_
PREFIX - Literal prefix shared by Stripe’s legacy object identifiers.
- KEY_
VALUE_ SEPARATOR - Separator between a header key and its value.
- MESSAGE_
EMPTY_ SECRET - Diagnostic when the configured signing secret is empty.
- MESSAGE_
NO_ SIGNATURE - Diagnostic when the signature header carries no digest at all.
- MESSAGE_
SIGNATURE_ MISMATCH - Diagnostic when the signed body and the digest disagree.
- MESSAGE_
TIMESTAMP_ OUT_ OF_ TOLERANCE - Diagnostic when the signed timestamp falls outside the tolerance.
- 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
objectname for a Charge. - OBJECT_
CHECKOUT_ SESSION - Stripe
objectname for a Checkout Session. - OBJECT_
CUSTOMER - Stripe
objectname for a Customer. - OBJECT_
DISCRIMINATOR - Stripe’s
objectdiscriminator shared by every Stripe object. - OBJECT_
EVENT - Stripe
objectname for a webhook Event. - OBJECT_
PAYMENT_ INTENT - Stripe
objectname for a PaymentIntent. - OBJECT_
PAYMENT_ METHOD - Stripe
objectname for a PaymentMethod. - OBJECT_
REFUND - Stripe
objectname 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. - SECRET_
KEY - Environment variable holding the endpoint’s signing secret.
- SIGNATURE_
SCHEME - Signature scheme Stripe prefixes to every webhook digest.
- 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.
- TIMESTAMP_
FIELD - Header key whose value is the signed timestamp.
- TIMESTAMP_
SEPARATOR - Separator between the timestamp and each digest in the header.
- 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.
- Digest
- Convenience wrapper trait covering functionality of cryptographic hash functions with fixed output size.
- Display
- Format trait for an empty format,
{}. - From
Primitive - A generic trait for converting a number to a value.
- KeyInit
- Types which can be initialized from a key.
- Mac
- Convenience wrapper trait covering functionality of Message Authentication algorithms.
- 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§
- Custom
Debug - A procedural macro that implements the
std::fmt::Debugtrait 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"]. - Display
Debug - A procedural macro that implements the
std::fmt::Displaytrait for a type, using the standard debug format ({:?}) for formatting. - Display
Debug Format - A procedural macro that implements the
std::fmt::Displaytrait for a type, using the detailed debug format ({:#?}) for formatting. - Getter
- A procedural macro that automatically generates getter methods for struct and enum fields.
- Getter
Mut - 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.