Visa Click to Pay is evolving to provide a better checkout experience with enhanced security features and improved performance. This guide will help you migrate from V1 to V2 in less than 30 minutes.
The evolution from Click to Pay V1 to V2 represents a fundamental shift in digital payment capabilities, addressing key merchant and consumer pain points while setting new standards for security and user experience. V2 introduces significant architectural improvements and feature enhancements that align with the industry's movement toward passwordless authentication and seamless checkout experiences. This transformation comes at a crucial time when digital commerce demands both frictionless transactions and robust security measures.
Feature Aspect
V1
V2
🔐 Security Features
⛔️ card data handling, prone to fraud.
✅ tokenization and biometric authentication, meeting FIDO standards.
🚀 Speed of Payment
⛔️ Requires multiple steps - OTPs are used for cardholder verification during online transactions, adding an extra layer of security but also introducing additional steps in the checkout process
✅ V2 integrates advanced authentication methods, such as biometrics and device recognition, reducing the reliance on OTPs. This shift enhances security while streamlining the user experience by minimizing interruptions during checkout.Biometric authentication reduces checkout time by 50%.
🛜 Integration
⛔️ Separate APIs and infrastructure for different card networks.
✅ Unified integration across multiple card network
⛔️ Separate authentication needed across different devices
⛔️ No device recognition capabilities
✅ Hybrid authentication approach:
Initial email/mobile verification still required
Optional biometric authentication for returning users
Payment passkey support being rolled out (not fully deployed)
Two-factor authentication for enhanced security
✅ Device-specific recognition:
"Remember me" option for trusted devices
Automatic recognition on returning to saved merchants
But requires initial setup per browser/device
💳 Push Provisioning
⛔️ Not supported. Users cannot add their cards directly to Click to Pay from the issuer's app.
✅ Supported. Issuers can enrol cardholders into Click to Pay directly from their banking app, streamlining the enrolment process.
🌏 Global Market Adoption
🚧 Limited deployment and compatibility with some regions and merchants.
✅ Available in 35+ countries, supported by major card networks
🔁 Recurring Payments
🚧 Limited support for saving credentials and managing recurring payments
✅ Built-in support for recurring payments and saved credentials
Seamless Migration with Hyperswitch
The migration to V2 is powered by Hyperswitch's specialized wrapper solution, ensuring a frictionless transition that protects your existing integration while unlocking next-generation features. Our wrapper automatically handles version detection, request/response mapping, and backward compatibility - eliminating the risk of business disruption during migration.
This guide will help you migrate from Visa Click to Pay SDK V1 to V2 in less than 30 minutes. Our wrapper maintains backward compatibility while giving you access to V2's enhanced features.
Integration Methods
Choose your integration path based on your business needs:
// Both V1 and V2 formats work with the wrapperconstcheckoutResponse=awaitvisaCheckout.checkout({ amount:'100.00', currency:'USD', merchantName:'Test Store'});
New V2 Features
Device Authentication Support
Before enabling biometric authentication, verify device capabilities:
// Check biometric availabilityconstcheckBiometricSupport=async () => {constcapabilities=awaitvisaCheckout.checkDeviceCapabilities();if (capabilities.biometrics) {// Enable biometric flowawaitvisaCheckout.enableBiometrics(); } else {// Fallback authentication methods in order of preference:// 1. Device binding (Remember this device)// 2. OTP verification// 3. Password authenticationawaitvisaCheckout.enableFallbackAuth({ preferDeviceBinding:true, allowOTP:true }); }};
Enable Biometric Authentication
if (visaCheckout.version ==='v2') {try {awaitvisaCheckout.enableBiometrics();console.log('Biometrics enabled successfully'); } catch (error) {console.error('Biometrics setup failed:', error);// Fallback to traditional authentication }}
Quick Checkout
if (visaCheckout.version ==='v2') {try {constquickCheckoutResponse=awaitvisaCheckout.quickCheckout(token);console.log('Quick checkout completed:', quickCheckoutResponse); } catch (error) {console.error('Quick checkout failed:', error);// Fallback to regular checkoutconstregularCheckoutResponse=awaitvisaCheckout.checkout(options); }}
Error Handling Guide
Common Error Scenarios:
// Network and Connection ErrorsNETWORK_ERROR:'Connection failed during API call'TIMEOUT_ERROR:'Request timed out'API_ERROR:'API endpoint not responding'// Authentication ErrorsAUTH_INVALID:'Invalid authentication credentials'AUTH_EXPIRED:'Authentication session expired'BIOMETRIC_FAILED:'Biometric authentication failed'// Transaction ErrorsCARD_DECLINED:'Card was declined'INSUFFICIENT_FUNDS:'Insufficient funds'RISK_DECLINE:'Transaction declined due to risk assessment'
Error Handling Best Practices:
try {constresponse=awaitvisaCheckout.checkout(options);handleSuccess(response);} catch (error) {switch(error.code) {case'NETWORK_ERROR':awaitretryWithBackoff(3); // Retry up to 3 timesbreak;case'AUTH_EXPIRED':awaitrefreshAuthSession();break;case'BIOMETRIC_FAILED':awaitfallbackToOTP();break;// Add more specific error handling }}
Authentication Methods
V2 supports multiple authentication methods:
// Configure authentication preferencesawaitvisaCheckout.init({ apiKey:'your_api_key', environment:'production', authentication: { preferBiometric:true,// Prefer biometric when available fallbackToPassword:true,// Allow password as fallback allowRememberMe:true// Enable "Remember Me" feature }});// Handle authentication eventsvisaCheckout.on('authentication_method_selected', (method) => {switch(method) {case'biometric':console.log('User selected biometric authentication');break;case'password':console.log('User selected password authentication');break;case'otp':console.log('One-time password required');break; }});
Migration Checklist
Best Practices
Use the wrapper for gradual migration
Test both V1 and V2 flows in sandbox first
Enable new features progressively
Implement proper error handling
Monitor for any issues after deployment
Use feature detection for V2-specific features
Maintain fallback options for all new features
Test across different browsers and devices
Monitor performance metrics
Keep error handling and logging comprehensive
Performance Considerations
Lazy Loading
// Lazy load the SDK when neededconstloadSDK=async () => {if (!window.visaCheckout) {awaitimport('@visa/click-to-pay-wrapper'); }returnwindow.visaCheckout;};
// Initialize in sandbox modeconstvisaCheckout=newVisaClickToPayWrapper({ apikey:'your_sandbox_api_key', environment:'sandbox', debug:true});// Test card numbersconsttestCards= { success:'4111111111111111', decline:'4000000000000002', error:'4000000000000069'};
Error Simulation
// Test error scenariosawaitvisaCheckout.simulateError('NETWORK_ERROR');awaitvisaCheckout.simulateError('AUTHENTICATION_FAILED');awaitvisaCheckout.simulateError('CARD_DECLINED');
Merchant & PSP Guide - Best practices and implementation paths for merchants and payment service providers
Remember to test thoroughly in the sandbox environment before deploying to production, and enable new features gradually to ensure a smooth transition for your users.