Better Payment 0.11.1 API
    Preparing search index...

    Interface ChaosRule

    One way to break operations. Every field is optional.

    interface ChaosRule {
        delay?: string | number;
        fail?:
            | "INSUFFICIENT_FUNDS"
            | "CARD_DECLINED"
            | "INVALID_CARD"
            | "EXPIRED_CARD"
            | "INVALID_CVC"
            | "THREEDS_FAILED"
            | "FRAUD_SUSPECTED"
            | "LIMIT_EXCEEDED"
            | "DUPLICATE_ORDER"
            | "CANCELLED_BY_CUSTOMER"
            | "INVALID_REQUEST"
            | "NETWORK_ERROR"
            | "INVALID_HASH"
            | "PROVIDER_ERROR"
            | "UNKNOWN"
            | PaymentErrorCode;
        message?: string;
        operation?: (keyof PaymentOperations)
        | (keyof PaymentOperations)[];
        probability?: number;
        provider?: string | string[];
    }
    Index
    delay?: string | number

    Wait before the call: milliseconds, or '500ms', '3s', '1m'

    fail?:
        | "INSUFFICIENT_FUNDS"
        | "CARD_DECLINED"
        | "INVALID_CARD"
        | "EXPIRED_CARD"
        | "INVALID_CVC"
        | "THREEDS_FAILED"
        | "FRAUD_SUSPECTED"
        | "LIMIT_EXCEEDED"
        | "DUPLICATE_ORDER"
        | "CANCELLED_BY_CUSTOMER"
        | "INVALID_REQUEST"
        | "NETWORK_ERROR"
        | "INVALID_HASH"
        | "PROVIDER_ERROR"
        | "UNKNOWN"
        | PaymentErrorCode

    Return a failure with this code instead of calling the provider. NETWORK_ERROR returns a pending result, like a lost response.

    message?: string

    The errorMessage of injected failures

    operation?: (keyof PaymentOperations) | (keyof PaymentOperations)[]

    Operations it applies to. Default: all

    probability?: number

    Chance that the rule fires on a matching call, from 0 to 1. Default: 1

    provider?: string | string[]

    Providers it applies to. Default: all