atum-escrow as a payment method on your mppx client, and your agent can pay for any MPP-gated resource that accepts it — no example repo required.
What’s happening
registerClientbuilds anatum-escrowclient method formppx— the sameMethod.toClient()idiom every MPP payment method (Stripe, Tempo) implements. The source account is derived from your key.- When the resource server returns a
402with a challenge namingatum-escrow,mppxhands it to this method’screateCredential. createCredentialreads the challenge’s corridor terms (destination, deadlines, settlement vault/proxy/role addresses), checks them (see below), builds the AtumPaymentRequest, and signs the source-side Permit2 authorization with your key.mppxattaches the resulting credential to the retried request asAuthorization: Payment, and returns the200with aPayment-Receiptheader.
createCredential checks the merchant’s terms and refuses the challenge with an AtumEscrowTrustError if they fail. See What payers check before signing. Paying through a deployment other than Atum’s production gateways? Pass your own trust to registerClient, or every payment is refused.
Expect pending, not a hung request. The acceptance side submits and returns; when settlement is still in flight it answers pending and your client re-attempts the same purchase. Size the client’s HTTP read timeout for the gateway’s wait plus a small buffer, not for the full delivery deadline.