global_id/payment.rs

hyperswitch · crates/common_utils/src/id_type/global_id/payment.rs · rust · Apache-2.0
payments

Provides globally unique IDs for payments, attempts, and groups with helper methods.

// Source: https://github.com/juspay/hyperswitch | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
use common_enums::enums;
use error_stack::ResultExt;

use crate::errors;

crate::global_id_type!(
    GlobalPaymentId,
    "A global id that can be used to identify a payment.

The format will be `<cell_id>_<entity_prefix>_<time_ordered_id>`.

Example: `0a_pay_uu1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p`"
);

// Database related implementations so that this field can be used directly in the database tables
#[cfg(feature = "diesel")]
crate::impl_queryable_id_type!(GlobalPaymentId);
#[cfg(feature = "diesel")]
crate::impl_to_sql_from_sql_global_id_type!(GlobalPaymentId);

impl GlobalPaymentId {
  

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key