Card
Card payments via encrypted network tokens
The Card method enables payments using encrypted, single use network payment tokens and dynamic data provided by a card network for machine-initiated transactions. Payment tokens, such as those provided by Visa Intelligent Commerce, settle through existing card infrastructure, and the client and server can each use independent payment providers rather than sharing a single platform.
The mpp-card SDK implements the card method with the charge intent. The protocol is defined in the Card Network Charge Intent specification.
Installation
How it works
- Client requests a resource from the server.
- Server responds with
402and a Challenge containing the amount, currency, accepted card networks, and an RSA public key (encryptionJwk). - Client sends the card identifier and challenge context to a credential issuer.
- Credential Issuer provisions a network token, generates a cryptogram, and encrypts both as a JWE using the server's public key. The encrypted token is returned to the client.
- Client retries the original request with an
Authorization: Paymentheader containing the encrypted credential. - Server decrypts the token using its private key and forwards it to the payment gateway for authorization through the card network.
- Server returns the resource with a
Payment-Receiptheader confirming the charge.