pub fn pay_invoice_with_id<M: Deref, T: Deref, ES: Deref, NS: Deref, SP: Deref, F: Deref, R: Deref, L: Deref>(
    invoice: &Invoice,
    payment_id: PaymentId,
    retry_strategy: Retry,
    channelmanager: &ChannelManager<M, T, ES, NS, SP, F, R, L>
) -> Result<(), PaymentError>where
    M::Target: Watch<<SP::Target as SignerProvider>::Signer>,
    T::Target: BroadcasterInterface,
    ES::Target: EntropySource,
    NS::Target: NodeSigner,
    SP::Target: SignerProvider,
    F::Target: FeeEstimator,
    R::Target: Router,
    L::Target: Logger,
Expand description

Pays the given Invoice with a custom idempotency key, retrying if needed based on Retry.

Note that idempotency is only guaranteed as long as the payment is still pending. Once the payment completes or fails, no idempotency guarantees are made.

You should ensure that the Invoice::payment_hash is unique and the same PaymentHash has never been paid before.

See pay_invoice for a variant which uses the PaymentHash for the idempotency token.