MIT Tokenization Examples
Test Redsys MIT (Merchant Initiated Transactions) tokenization functionality with test cards. MIT is used for recurring payments and subscriptions where the merchant initiates transactions without customer presence. Uses COF type "M".
Step 1: First Payment with MIT Tokenization
Create a payment form that will request Redsys to generate a token. After successful payment, the token will be returned in the notification.
Step 2: Extract Token from Notification
After completing Step 1 and making a successful payment, the token will be automatically extracted and logged in your server console. Copy the token from the logs and paste it below.
How to find the token:
- Complete Step 1 and submit the payment form
- Check your server console/terminal where Next.js is running
- Look for the log message that shows:
🔑 Token generated for order... - Copy the token value from the log
- Paste it in the input field below
Example of what you'll see in your server console:
✅ Payment for order ORDER-123456 succeeded
🔑 Token generated for order ORDER-123456:
Token: 12345678901234567890
COF Transaction ID: ABC123XYZ
📋 Copy this token to Step 2 in /examples/mit to test token paymentsStep 3: Payment with Existing Token (MIT)
Use the stored token to make a payment without requiring the customer to enter card details again. This is a Merchant Initiated Transaction (MIT).
Please enter a token in Step 2 first.