Worldpay Card Payments API — modular card authorization.
Supports CITs, MITs, partial auth, fast refunds, AFTs, account updater, PayFac, Level 2/3, airline data, MOTO, co-badged card routing, and more.
Use Worldpay.CardPayments.Features to build advanced instruction maps.
CIT example
body = Worldpay.CardPayments.build_cit(
transaction_reference: "txn-001",
narrative: "My Store",
amount: 1999,
currency: "GBP",
payment_instrument: %{"type" => "card/plain", ...}
)
{:ok, auth} = Worldpay.CardPayments.authorize(body, config)MIT (subscription) example
body = Worldpay.CardPayments.build_mit(
transaction_reference: "sub-002",
narrative: "Monthly Plan",
amount: 999,
currency: "USD",
payment_instrument: %{"type" => "card/token", "href" => token_href},
scheme_reference: scheme_ref
)
{:ok, _} = Worldpay.CardPayments.mit(body, config)
Summary
Functions
Customer Initiated Transaction (CIT) authorization.
Subsequent CIT with real-time Account Updater (Visa).
Build a standard CIT instruction map.
Build a standard MIT subscription instruction map.
Cancel an authorization.
Retrieve payment events.
Fast refund (≤30 min credit to eligible cards).
Retrieve a single payment by ID.
Merchant Initiated Transaction (MIT) — subscription / installment / unscheduled.
Partial refund.
Partial settlement.
Full refund.
Full settlement of an authorized payment.
Functions
@spec authorize(map(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Customer Initiated Transaction (CIT) authorization.
@spec authorize_with_account_updater(map(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Subsequent CIT with real-time Account Updater (Visa).
Sets requestAccountUpdater: true in the instruction body.
If the card was reissued, the response includes updatedPaymentInstrument.
Build a standard CIT instruction map.
Build a standard MIT subscription instruction map.
@spec cancel(String.t(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Cancel an authorization.
@spec events(String.t(), Worldpay.Config.t()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Retrieve payment events.
@spec fast_refund(String.t(), map(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Fast refund (≤30 min credit to eligible cards).
@spec get(String.t(), Worldpay.Config.t()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Retrieve a single payment by ID.
@spec mit(map(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Merchant Initiated Transaction (MIT) — subscription / installment / unscheduled.
@spec partial_refund( String.t(), non_neg_integer(), String.t(), Worldpay.Config.t(), keyword() ) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Partial refund.
@spec partial_settle( String.t(), non_neg_integer(), String.t(), Worldpay.Config.t(), keyword() ) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Partial settlement.
@spec refund(String.t(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Full refund.
@spec settle(String.t(), Worldpay.Config.t(), keyword()) :: {:ok, map()} | {:error, Worldpay.Error.t()}
Full settlement of an authorized payment.