{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-heading","admonition","br","details"]},"type":"markdown"},"seo":{"title":"3DS transactions","description":"Transform your commerce with PXP's unified platform—seamless payments, real-time insights, and global growth in one powerful integration.","lang":"en-UK","siteUrl":"https://developer.pxp.io","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"3ds-transactions","__idx":0},"children":["3DS transactions"]},{"$$mdtype":"Tag","name":"SubHeading","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Learn about 3D Secure authentication with Google Pay for enhanced transaction security."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"overview","__idx":1},"children":["Overview"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["By implementing 3DS authentication with Google Pay, you benefit from:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Enhanced security:"]}," Additional authentication layer protects against fraudulent transactions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Liability shift:"]}," Shifts liability from merchant to card issuer for authenticated transactions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Reduced chargebacks:"]}," Significantly decreases chargeback rates through strong authentication."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Regulatory compliance:"]}," Meets Strong Customer Authentication (SCA) requirements under PSD2 and similar regulations."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Higher success rate:"]}," Banks are more likely to approve 3DS-authenticated transactions."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Fraud prevention:"]}," Real-time risk assessment and challenge when necessary."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["However, the 3DS payment flow is longer than the non-3DS one due to the additional authentication steps. It may also require active customer participation if a challenge is presented."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["3D Secure authentication is strongly recommended for high-value transactions, subscription services, and any scenario where enhanced security is required. It significantly reduces fraud risk and chargebacks whilst providing liability shift benefits."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["3DS is applied only to Google Pay FPAN (Full Primary Account Number). DPAN (Device Primary Account Number) transactions from Google Pay do not undergo 3DS authentication."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"payment-flow","__idx":2},"children":["Payment flow"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The 3DS Google Pay payment flow consists of nine key steps."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-button-interaction","__idx":3},"children":["Step 1: Button interaction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The customer clicks the Google Pay button, triggering the payment sheet to open. Google Pay handles device authentication (biometric or PIN) internally."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-payment-method-selection","__idx":4},"children":["Step 2: Payment method selection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Within the Google Pay payment sheet, the customer selects their preferred payment method. Google Pay tokenises the payment data using its secure tokenisation system."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-payment-sheet-completion","__idx":5},"children":["Step 3: Payment sheet completion"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The customer confirms the payment in the Google Pay sheet. The SDK receives the encrypted payment token from Google Pay."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-pre-initiation","__idx":6},"children":["Step 4: Pre-initiation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the initial step in the 3DS authentication flow. It establishes the authentication session by sending transaction and card details to the payment processor."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This step has two associated callbacks:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreInitiateAuthentication"]},": Returns configuration for the authentication setup."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostInitiateAuthentication"]},": Receives the result of the pre-initiation call."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-5-fingerprinting","__idx":7},"children":["Step 5: Fingerprinting"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["During this step, device information and browser characteristics are collected by the fingerprinting component. It creates a hidden iframe that submits transaction details to the issuer's fingerprint URL, enabling risk assessment based on the user's device profile."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-6-authentication","__idx":8},"children":["Step 6: Authentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The 3DS server evaluates the transaction risk and determines the authentication path:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Frictionless flow:"]}," If the transaction is low-risk, authentication completes automatically without customer interaction."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Challenge flow:"]}," If additional verification is needed, the customer completes the 3DS authentication challenge (PIN entry, SMS code, biometric verification, etc.)"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The authentication step has two associated callbacks:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthentication"]},": Configures the main authentication parameters."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthentication"]},": Receives authentication results and challenge data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-7-authentication-result","__idx":9},"children":["Step 7: Authentication result"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The SDK receives the 3DS authentication result indicating whether authentication was successful, failed, or requires additional action."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-8-authorisation","__idx":10},"children":["Step 8: Authorisation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This is the final processing step where the SDK sends the authorisation request to the payment gateway, including the 3DS authentication data. You receive the transaction data along with the 3DS authentication results and decide whether to proceed."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The authorisation step has two associated callbacks:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]},":"]}," Provides final transaction data, including 3DS authentication results. This is your last chance to modify the transaction before authorisation."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]},":"]}," Receives the transaction identifiers (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},"). Use these identifiers to call the Unity Backend and retrieve the full transaction outcome."]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," callback only returns transaction identifiers, not the full transaction result. To obtain the complete transaction outcome (Authorised, Captured, Refused, etc.), you must call the Unity backend using the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/transaction/other/get-transaction-details"},"children":["Get transaction details"]}," API with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-9-authorisation-result","__idx":11},"children":["Step 9: Authorisation result"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["You receive the final authorisation response from the payment gateway. The transaction is either approved or declined and final transaction details are available, along with 3DS authentication confirmation."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"implementation","__idx":12},"children":["Implementation"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"before-you-start","__idx":13},"children":["Before you start"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To use 3DS with Google Pay payments:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Ensure 3D Secure is enabled in the Unity Portal for your merchant group."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Configure Google Pay in the Unity Portal with your gateway merchant ID."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Whitelist your domain in the Unity Portal."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Get your 3DS provider ID from your payment processor."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-initialise-the-sdk","__idx":14},"children":["Step 1: Initialise the SDK"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Initialise the PXP SDK with your merchant credentials."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { PxpCheckout } from '@pxpio/web-components-sdk';\n\nconst pxpSdk = PxpCheckout.initialize({\n  environment: 'test', // or 'live' for production\n  session: sessionData, // Get from your backend\n  ownerId: 'your-owner-id',\n  ownerType: 'MerchantGroup',\n  kountDisabled: false, // OPTIONAL: Set to true to disable Kount fraud detection\n  transactionData: {\n    currency: 'GBP',\n    amount: 299.99,\n    merchantTransactionId: crypto.randomUUID(),\n    merchantTransactionDate: () => new Date().toISOString(),\n    entryType: 'Ecom',\n    intent: {\n      card: 'Authorisation'\n    }\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-implement-callbacks","__idx":15},"children":["Step 2: Implement callbacks"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Configure the Google Pay button with the required callbacks for 3DS authentication."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import FailedAuthenticationResult from '@pxpio/web-components-sdk/src/services/threeDSServices/types/FailedAuthenticationResult';\nimport MerchantAuthenticationResult from '@pxpio/web-components-sdk/src/services/threeDSServices/types/MerchantAuthenticationResult';\n\nconst googlePayButton = pxpSdk.create('google-pay-button', {\n  paymentDataRequest: {\n    allowedPaymentMethods: [{\n      type: 'CARD',\n      parameters: {\n        allowedCardNetworks: ['VISA', 'MASTERCARD', 'AMEX'],\n        allowedAuthMethods: ['CRYPTOGRAM_3DS'] // Prefer 3DS cryptogram\n      }\n      // Note: tokenizationSpecification is automatically configured by the SDK from session data\n    }],\n    transactionInfo: {\n      currencyCode: 'GBP',\n      totalPriceStatus: 'FINAL',\n      totalPrice: '299.99'\n    }\n  },\n  \n  // OPTIONAL: Use Unity authentication strategy\n  useUnityAuthenticationStrategy: true,\n  \n  // REQUIRED: Provide 3DS configuration\n  onPreInitiateAuthentication: () => {\n    return {\n      providerId: 'your_3ds_provider_id', // optional\n      requestorAuthenticationIndicator: '01', // Payment transaction\n      timeout: 300 // 5 minutes\n    };\n  },\n  \n  // OPTIONAL: Handle the pre-initiation result\n  onPostInitiateAuthentication: async (data) => {\n    if (data instanceof FailedAuthenticationResult) {\n      console.error('3DS pre-initiation failed:', data.errorReason);\n      return;\n    }\n\n    const result = data as MerchantAuthenticationResult;\n    console.log('Authentication ID:', result.authenticationId);\n    console.log('3DS supported:', result.threeDSecureSupported);\n\n    if (!result.authenticationId) {\n      return;\n    }\n\n    const authResult = await fetchAuthenticationResultFromBackend(result.authenticationId);\n    await evaluateAuthenticationAndUpdateSession(authResult);\n  },\n  \n  // REQUIRED: Configure main authentication\n  onPreAuthentication: async () => {\n    // Get authentication decision evaluated after onPostInitiateAuthentication\n    const decision = await getAuthenticationDecision();\n    \n    if (!decision) {\n      // Not proceeding with authentication\n      return null;\n    }\n    \n    return {\n      merchantCountryNumericCode: '826', // United Kingdom\n      merchantLegalName: 'Your Store Limited',\n      challengeWindowSize: 5, // Fullscreen\n      requestorChallengeIndicator: decision.challengeIndicator || '01',\n      timeout: decision.timeout || 300\n    };\n  },\n  \n  // OPTIONAL: Handle the authentication result\n  onPostAuthentication: async (data) => {\n    console.log('3DS authentication completed. Authentication ID:', data.authenticationId);\n    \n    // Send authenticationId to backend to retrieve authentication result\n    const authResult = await fetchAuthenticationResultFromBackend(data.authenticationId);\n    \n    // Evaluate authentication result to update authorisation decision\n    await evaluateAuthenticationAndUpdateAuthorization(authResult);\n  },\n  \n  // REQUIRED: Final transaction review before authorisation\n  onPreAuthorisation: async (data) => {\n    console.log('Processing 3DS Google Pay payment');\n    console.log('Gateway Token ID:', data.gatewayTokenId);\n    \n    // Retrieve token details and make authorisation decision\n    const transactionDecision = await getAuthorisationDecision(data.gatewayTokenId);\n    \n    if (!transactionDecision) {\n      // Not proceeding\n      return null;\n    }\n    \n    // Add risk screening data for fraud detection\n    return {\n      riskScreeningData: {\n        performRiskScreening: true,\n        userIp: \"192.168.1.100\",\n        account: {\n          id: \"user_12345678\",\n          creationDateTime: \"2024-01-15T10:30:00.000Z\"\n        },\n        items: [{\n          price: 99.99,\n          quantity: 1,\n          category: \"Electronics\",\n          sku: \"GPAY-PROD-001\"\n        }],\n        fulfillments: [{\n          type: \"Shipped\",\n          shipping: {\n            shippingMethod: \"Express\"\n          },\n          recipientPerson: {\n            phoneNumber: \"+1234567890\",\n            email: \"customer@example.com\"\n          }\n        }]\n      }\n    };\n  },\n  \n  // REQUIRED: Handle the final result\n  onPostAuthorisation: (result, paymentData) => {\n    console.log('Payment result:', result);\n    \n    if (result && 'merchantTransactionId' in result) {\n      // Success - MerchantSubmitResult\n      console.log('Payment successful with 3DS!');\n      console.log('Transaction ID:', result.merchantTransactionId);\n      console.log('System Transaction ID:', result.systemTransactionId);\n      \n      // Redirect to success page\n      window.location.href = '/payment-success?txn=' + result.merchantTransactionId;\n    } else if (result && 'errorCode' in result) {\n      // Failure - FailedSubmitResult\n      console.error('Payment declined:', result.errorReason);\n      showError('Payment declined. Please try another payment method.');\n    }\n  },\n  \n  // OPTIONAL: Handle errors\n  onError: (error) => {\n    console.error('Payment error:', error);\n    showError('An error occurred. Please try again.');\n  },\n  \n  // OPTIONAL: Handle cancellation\n  onCancel: () => {\n    console.log('Payment cancelled by user');\n    showMessage('Payment cancelled');\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-handle-common-scenarios","__idx":16},"children":["Step 3: Handle common scenarios"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"conditional-3ds","__idx":17},"children":["Conditional 3DS"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the following snippet to only trigger 3DS authentication above a certain amount."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const googlePayButton = pxpSdk.create('google-pay-button', {\n  // ... basic configuration\n  \n  onPreInitiateAuthentication: () => {\n    const amount = getTransactionAmount();\n    \n    if (amount > 100) {\n      return {\n        providerId: 'your_provider',\n        requestorAuthenticationIndicator: '01',\n        timeout: 300\n      };\n    }\n    \n    // Return null to skip 3DS for low-value transactions\n    return null;\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"challenge-indicator-selection","__idx":18},"children":["Challenge indicator selection"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Select appropriate challenge indicators based on transaction risk."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"function selectChallengeIndicator(transaction) {\n  // High-value transactions\n  if (transaction.amount > 500) {\n    return '04'; // Mandate challenge\n  }\n  \n  // Subscription first payment\n  if (transaction.type === 'subscription' && transaction.isFirstPayment) {\n    return '03'; // Challenge requested (merchant preference)\n  }\n  \n  // Trusted returning customers\n  if (transaction.customerTrust === 'HIGH') {\n    return '02'; // No challenge requested\n  }\n  \n  // Default\n  return '01'; // No preference\n}\n\nconst googlePayButton = pxpSdk.create('google-pay-button', {\n  // ... basic configuration\n  \n  onPreAuthentication: async () => {\n    const decision = await getAuthenticationDecision();\n    \n    if (!decision) {\n      return null;\n    }\n    \n    const transaction = getCurrentTransaction();\n    const challengeIndicator = selectChallengeIndicator(transaction);\n    \n    return {\n      merchantCountryNumericCode: '826',\n      merchantLegalName: 'Your Store Ltd',\n      challengeWindowSize: 5,\n      requestorChallengeIndicator: challengeIndicator\n    };\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"soft-decline-retry","__idx":19},"children":["Soft decline retry"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Handle soft declines by retrying with forced 3DS challenge."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const googlePayButton = pxpSdk.create('google-pay-button', {\n  // ... other configuration\n  \n  onPreRetrySoftDecline: (result) => {\n    console.log('Soft decline detected, retrying with 3DS challenge');\n    \n    // Track soft decline\n    trackEvent('payment-soft-decline', {\n      transactionId: result.merchantTransactionId,\n      reason: result.errorReason\n    });\n    \n    // Retry with forced 3DS challenge\n    return {\n      retry: true,\n      updatedConfigs: {\n        onPreInitiateAuthentication: () => ({\n          providerId: 'pxpfinancial',\n          timeout: 12\n        }),\n        onPreAuthentication: async () => ({\n          merchantCountryNumericCode: '826',\n          merchantLegalName: 'Your Store Ltd',\n          challengeWindowSize: 5,\n          requestorChallengeIndicator: '04' // Force challenge on retry\n        })\n      }\n    };\n  }\n});\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-handle-errors","__idx":20},"children":["Step 4: Handle errors"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Implement comprehensive error handling for 3DS payments."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"const googlePayButton = pxpSdk.create('google-pay-button', {\n  // ... basic configuration\n  \n  onPostAuthentication: async (data) => {\n    // Retrieve authentication result from backend\n    const authResult = await fetchAuthenticationResultFromBackend(data.authenticationId);\n    \n    // Handle authentication failures\n    if (authResult.state === 'AuthenticationFailed') {\n      console.log('Authentication failed:', authResult.errorReason);\n      showError('Card authentication failed');\n      // Don't proceed to authorisation - update session accordingly\n      await updateSessionDecision(data.authenticationId, { proceed: false });\n      return;\n    }\n\n    console.log('Authentication successful, proceeding to payment');\n    // Update authorisation decision\n    await evaluateAuthenticationAndUpdateAuthorization(authResult);\n  },\n  \n  onError: (error) => {\n    console.error('Payment error:', error);\n    \n    // Handle specific 3DS error types\n    if (error.code === 'AUTHENTICATION_FAILED') {\n      showError('Card verification failed. Please try again.');\n    } else if (error.code === 'AUTHENTICATION_TIMEOUT') {\n      showError('Verification timed out. Please try again.');\n    } else if (error.code === 'AUTHENTICATION_REJECTED') {\n      showError('Payment was rejected during verification.');\n    } else if (error.code === 'BUYER_ACCOUNT_ERROR') {\n      showError('There was an issue with your Google Pay account. Please try another payment method.');\n    } else if (error.code === 'MERCHANT_CONFIGURATION_ERROR') {\n      showError('Payment system configuration error. Please contact support.');\n      logError('Google Pay merchant configuration error', error);\n    } else if (error.code === 'NETWORK_ERROR') {\n      showError('Connection failed. Please check your internet and try again.');\n    } else {\n      showError('Payment failed. Please try again or use a different payment method.');\n    }\n  },\n  \n  onPostAuthorisation: (result, paymentData) => {\n    if (result && 'merchantTransactionId' in result) {\n      // Success - MerchantSubmitResult\n      handlePaymentSuccess(result, paymentData);\n    } else if (result && 'errorCode' in result) {\n      // Failure - FailedSubmitResult\n      handlePaymentFailure(result);\n    }\n  }\n});\n\nfunction handlePaymentSuccess(result, paymentData) {\n  console.log('✅ Payment successful with 3DS');\n  console.log('Transaction ID:', result.merchantTransactionId);\n  console.log('System Transaction ID:', result.systemTransactionId);\n  \n  // Store transaction details\n  storeTransactionRecord({\n    transactionId: result.merchantTransactionId,\n    systemTransactionId: result.systemTransactionId,\n    processingType: '3ds',\n    paymentMethod: 'google-pay',\n    timestamp: new Date().toISOString()\n  });\n  \n  // Redirect to success page\n  window.location.href = '/payment-success?txn=' + result.merchantTransactionId;\n}\n\nfunction handlePaymentFailure(result) {\n  console.error('❌ Payment failed');\n  console.error('Error code:', result.errorCode);\n  console.error('Error reason:', result.errorReason);\n  console.error('Correlation ID:', result.correlationId);\n  \n  // Map error codes to user-friendly messages\n  const errorMessages = {\n    'INSUFFICIENT_FUNDS': 'Insufficient funds. Please try a different payment method.',\n    'CARD_DECLINED': 'Payment declined by your bank. Please try another card.',\n    'EXPIRED_CARD': 'This card has expired. Please use a different payment method.',\n    'INVALID_CARD': 'Invalid card details. Please try another payment method.',\n    'FRAUD_DETECTED': 'Payment could not be processed. Please contact your bank.',\n    'PROCESSING_ERROR': 'Payment processing error. Please try again.',\n    'LIMIT_EXCEEDED': 'Transaction exceeds your card limit. Try a smaller amount.',\n    'DO_NOT_HONOR': 'Payment declined by your bank. Please try a different payment method.'\n  };\n  \n  const userMessage = errorMessages[result.errorCode] || \n    'Payment could not be completed. Please try a different payment method.';\n  \n  showError(userMessage);\n  \n  // Log for analysis\n  logPaymentDecline({\n    errorCode: result.errorCode,\n    errorReason: result.errorReason,\n    correlationId: result.correlationId,\n    httpStatusCode: result.httpStatusCode,\n    timestamp: new Date().toISOString()\n  });\n  \n  // Offer alternative payment methods\n  showAlternativePaymentOptions();\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"example","__idx":21},"children":["Example"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example shows a complete 3DS Google Pay implementation."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import { useEffect, useState } from 'react';\nimport FailedAuthenticationResult from '@pxpio/web-components-sdk/src/services/threeDSServices/types/FailedAuthenticationResult';\nimport MerchantAuthenticationResult from '@pxpio/web-components-sdk/src/services/threeDSServices/types/MerchantAuthenticationResult';\n\nfunction GooglePay3DSCheckout() {\n  const [googlePayButton, setGooglePayButton] = useState(null);\n  const [isProcessing, setIsProcessing] = useState(false);\n  const [error, setError] = useState(null);\n  \n  useEffect(() => {\n    // Initialise SDK\n    const pxpSdk = PxpCheckout.initialize({\n      environment: 'test',\n      session: sessionData, // Get from your backend\n      ownerId: 'your-owner-id',\n      ownerType: 'MerchantGroup',\n      kountDisabled: false, // OPTIONAL: Set to true to disable Kount fraud detection\n      transactionData: {\n        currency: 'GBP',\n        amount: 299.99,\n        merchantTransactionId: crypto.randomUUID(),\n        merchantTransactionDate: () => new Date().toISOString(),\n        entryType: 'Ecom',\n        intent: {\n          card: 'Authorisation'\n        }\n      }\n    });\n    \n    // Create Google Pay button with 3DS\n    const button = pxpSdk.create('google-pay-button', {\n      paymentDataRequest: {\n        allowedPaymentMethods: [{\n          type: 'CARD',\n          parameters: {\n            allowedCardNetworks: ['VISA', 'MASTERCARD', 'AMEX'],\n            allowedAuthMethods: ['CRYPTOGRAM_3DS']\n          }\n          // Note: tokenizationSpecification is automatically configured by the SDK from session data\n        }],\n        transactionInfo: {\n          currencyCode: 'GBP',\n          countryCode: 'GB',\n          totalPriceStatus: 'FINAL',\n          totalPrice: '299.99'\n        }\n      },\n      \n      // Use Unity authentication strategy\n      useUnityAuthenticationStrategy: true,\n      \n      // Step 1: Set up 3DS\n      onPreInitiateAuthentication: () => {\n        console.log('🔐 Initiating 3DS authentication');\n        return {\n          providerId: process.env.REACT_APP_THREEDS_PROVIDER_ID,\n          requestorAuthenticationIndicator: '01',\n          timeout: 300\n        };\n      },\n      \n      // Step 2: Handle pre-initiation result\n      onPostInitiateAuthentication: async (data) => {\n        if (data instanceof FailedAuthenticationResult) {\n          console.error('3DS pre-initiation failed:', data.errorReason);\n          return;\n        }\n\n        const result = data as MerchantAuthenticationResult;\n        console.log('Pre-authentication check complete:', result.authenticationId);\n        console.log('3DS supported:', result.threeDSecureSupported);\n\n        if (!result.authenticationId) {\n          return;\n        }\n\n        const authResult = await fetchAuthenticationResultFromBackend(result.authenticationId);\n        await evaluateAuthenticationAndUpdateSession(authResult);\n\n        if (authResult.scaMandated) {\n          console.log('SCA mandated - full authentication required');\n        }\n      },\n      \n      // Step 3: Configure authentication\n      onPreAuthentication: async () => {\n        console.log('🔍 Configuring full 3DS authentication');\n        \n        const decision = await getAuthenticationDecision();\n        \n        if (!decision) {\n          return null; // Skip authentication\n        }\n        \n        // Assess transaction risk\n        const amount = getTransactionAmount();\n        const customerHistory = await getCustomerHistory();\n        const isHighRisk = amount > 500 || customerHistory.chargebacks > 0;\n        \n        let challengeIndicator = '01'; // No preference\n        if (isHighRisk) {\n          challengeIndicator = '04'; // Mandate challenge\n        } else if (amount < 30 && customerHistory.successfulTransactions > 10) {\n          challengeIndicator = '02'; // No challenge requested\n        }\n        \n        return {\n          merchantCountryNumericCode: '826',\n          merchantLegalName: 'Your Store Limited',\n          challengeWindowSize: 5,\n          requestorChallengeIndicator: challengeIndicator\n        };\n      },\n      \n      // Step 4: Handle authentication result\n      onPostAuthentication: async (data) => {\n        console.log('✅ 3DS authentication completed:', data.authenticationId);\n        \n        const authResult = await fetchAuthenticationResultFromBackend(data.authenticationId);\n        \n        if (authResult.state === 'AuthenticationFailed') {\n          setError('Card verification failed. Please try again.');\n          return;\n        }\n        \n        await evaluateAuthenticationAndUpdateAuthorization(authResult);\n      },\n      \n      // Step 5: Final authorisation\n      onPreAuthorisation: async (data) => {\n        console.log('💳 Processing payment with 3DS data');\n        \n        const transactionDecision = await getAuthorisationDecision(data.gatewayTokenId);\n        \n        if (!transactionDecision) {\n          return null;\n        }\n        \n        return {\n          riskScreeningData: {\n            performRiskScreening: true,\n            userIp: \"192.168.1.100\",\n            account: {\n              id: \"user_12345678\",\n              creationDateTime: \"2024-01-15T10:30:00.000Z\"\n            },\n            fulfillments: [{\n              type: \"Shipped\",\n              recipientPerson: {\n                phoneNumber: \"+1234567890\"\n              }\n            }]\n          }\n        };\n      },\n      \n      // Step 6: Handle success/failure\n      onPostAuthorisation: (result, paymentData) => {\n        setIsProcessing(false);\n        \n        if (result && 'merchantTransactionId' in result) {\n          console.log('✅ Payment authorised with 3DS');\n          window.location.href = '/payment-success?txn=' + result.merchantTransactionId;\n        } else if (result && 'errorCode' in result) {\n          console.error('❌ Payment declined:', result.errorReason);\n          setError('Payment declined. Please try another payment method.');\n        }\n      },\n      \n      // Step 7: Error handling\n      onError: (error) => {\n        console.error('Error during 3DS flow:', error);\n        setIsProcessing(false);\n        \n        if (error.code === 'AUTHENTICATION_FAILED') {\n          setError('Card verification failed. Please try again.');\n        } else if (error.code === 'AUTHENTICATION_TIMEOUT') {\n          setError('Verification timed out. Please try again.');\n        } else {\n          setError('An error occurred. Please try again.');\n        }\n      },\n      \n      onCancel: () => {\n        console.log('Payment cancelled by user');\n        setIsProcessing(false);\n        setError(null);\n      }\n    });\n    \n    // Mount button\n    button.mount('google-pay-button-container');\n    setGooglePayButton(button);\n    \n    // Cleanup\n    return () => {\n      if (button) {\n        button.unmount();\n      }\n    };\n  }, []);\n  \n  return (\n    <div className=\"checkout-container\">\n      <div className=\"order-summary\">\n        <h2>Order summary</h2>\n        <div className=\"order-items\">\n          <div className=\"order-item\">\n            <span>Premium Product</span>\n            <span>£299.99</span>\n          </div>\n          <div className=\"order-total\">\n            <span>Total</span>\n            <span>£299.99</span>\n          </div>\n        </div>\n      </div>\n      \n      <div className=\"payment-section\">\n        <h2>Pay with Google Pay (3DS Secure)</h2>\n        \n        {error && (\n          <div className=\"error-message\">\n            {error}\n          </div>\n        )}\n        \n        <div id=\"google-pay-button-container\"></div>\n        \n        {isProcessing && (\n          <div className=\"processing-indicator\">\n            Processing secure payment...\n          </div>\n        )}\n        \n        <div className=\"payment-info\">\n          <p>✓ Protected by 3D Secure authentication</p>\n          <p>✓ Fast and secure checkout with Google Pay</p>\n          <p>✓ Additional verification for your safety</p>\n        </div>\n      </div>\n    </div>\n  );\n}\n\nexport default GooglePay3DSCheckout;\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"callback-data","__idx":22},"children":["Callback data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This section describes the data received by the different callbacks as part of the 3DS Google Pay flow."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Note that the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreInitiateAuthentication"]}," callback doesn't receive anything so isn't included. Instead, it returns your 3DS configuration in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PreInitiateIntegratedAuthenticationData"]}," object."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpostinitiateauthentication","__idx":23},"children":["onPostInitiateAuthentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostInitiateAuthentication"]}," callback receives a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantAuthenticationResult"]}," on success, or a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedAuthenticationResult"]}," on failure. On success, the SDK exposes two fields: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["authenticationId"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecureSupported"]},". Use the ID to retrieve full pre-initiate details from your backend."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When both ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["authenticationId"]}," is absent and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecureSupported"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},", the SDK skips the remaining 3DS flow and does not invoke ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthentication"]},". This early-exit check applies when ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useUnityAuthenticationStrategy"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["false"]},". When ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["useUnityAuthenticationStrategy"]}," is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["true"]},", the SDK uses Unity's authentication strategy API instead."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data","__idx":24},"children":["Event data"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["AuthenticationResult"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Authentication initiation result. Success is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantAuthenticationResult"]},"; failure is ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedAuthenticationResult"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.authenticationId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string | null | undefined"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The unique identifier for this 3DS session. May be null when 3DS isn't required. Use this ID to retrieve the full PreInitiateAuthentication result from the Unity backend."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.threeDSecureSupported"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether 3DS authentication is supported for this transaction."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["authenticationId"]}," with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/three-d-secure-authentication/integrated-authentication/get-preinitiate-authentication-details"},"children":["Get 3DS pre-initiate authentication details"]}," API to retrieve pre-authentication results including SCA mandates, exemptions, and state."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation","__idx":25},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"import FailedAuthenticationResult from '@pxpio/web-components-sdk/src/services/threeDSServices/types/FailedAuthenticationResult';\nimport MerchantAuthenticationResult from '@pxpio/web-components-sdk/src/services/threeDSServices/types/MerchantAuthenticationResult';\n\nonPostInitiateAuthentication: async (data) => {\n  if (data instanceof FailedAuthenticationResult) {\n    console.error('3DS pre-initiation failed:', data.errorReason);\n    return;\n  }\n\n  const result = data as MerchantAuthenticationResult;\n  console.log('Authentication ID:', result.authenticationId);\n  console.log('3DS supported:', result.threeDSecureSupported);\n\n  if (!result.authenticationId && !result.threeDSecureSupported) {\n    console.log('3DS not supported — SDK skips authentication');\n    return;\n  }\n\n  if (!result.authenticationId) {\n    return;\n  }\n\n  const authResult = await fetchAuthenticationResultFromBackend(result.authenticationId);\n  \n  if (authResult.state === 'PendingClientData') {\n    console.log('Waiting for client data collection');\n  }\n  \n  if (authResult.scaMandated) {\n    console.log('SCA is required - 3DS must complete successfully');\n    showMessage('Additional verification required');\n  }\n  \n  if (authResult.applicableExemptions === 'LVP') {\n    console.log('Low value exemption available');\n  } else if (authResult.applicableExemptions === 'TRA') {\n    console.log('Transaction risk analysis exemption available');\n  }\n  \n  const decision = await evaluateAuthenticationAndUpdateSession(authResult);\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpreauthentication","__idx":26},"children":["onPreAuthentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthentication"]}," callback receives no parameters. You should use the authentication decision evaluated after ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostInitiateAuthentication"]}," to determine whether to proceed."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-1","__idx":27},"children":["Event data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This callback receives no parameters."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation-1","__idx":28},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"onPreAuthentication: async () => {\n  // Get authentication decision evaluated after onPostInitiateAuthentication\n  const decision = await getAuthenticationDecision();\n  \n  if (!decision) {\n    // Not proceeding with authentication\n    console.log('Skipping authentication based on backend decision');\n    return null;\n  }\n  \n  console.log('Proceeding with authentication');\n  \n  // Check if SCA is mandated to adjust challenge preference\n  let challengeIndicator = '01'; // No preference\n  \n  if (decision.scaMandated) {\n    challengeIndicator = '04';\n    console.log('SCA mandated - requesting challenge');\n  } else if (decision.applicableExemptions === 'LVP') {\n    challengeIndicator = '10'; \n    console.log('Low value exemption - requesting no challenge');\n  } else if (decision.applicableExemptions === 'TRA') {\n    challengeIndicator = '05';\n    console.log('TRA exemption - requesting no challenge');\n  }\n  \n  return {\n    merchantCountryNumericCode: '826',\n    merchantLegalName: 'Your Company Ltd',\n    challengeWindowSize: 5,\n    requestorChallengeIndicator: challengeIndicator,\n    timeout: decision.scaMandated ? 600 : 300\n  };\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"challenge-window-sizes","__idx":29},"children":["Challenge window sizes"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Dimensions"},"children":["Dimensions"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["250x400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Compact window"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["390x400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Standard window"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["500x600"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Medium window"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["600x400"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Wide window"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["5"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Fullscreen"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Full-screen window"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"challenge-indicators","__idx":30},"children":["Challenge indicators"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Value"},"children":["Value"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"When to use"},"children":["When to use"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["01"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No preference"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Standard transactions"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["02"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No challenge requested"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Low-risk transactions"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["03"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Challenge requested: Your preference"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When additional security desired"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["04"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Challenge requested: Mandate"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["High-value or high-risk transactions"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["05"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No challenge requested (transaction risk analysis performed)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["When you have performed risk analysis"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No challenge requested (Low value exemption)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Low-value transactions under exemption thresholds"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpostauthentication","__idx":31},"children":["onPostAuthentication"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthentication"]}," callback receives only the authentication identifier. Use this ID to retrieve full authentication details from your backend."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-2","__idx":32},"children":["Event data"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object containing authentication result."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.authenticationId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The unique identifier for the authentication attempt. Use this ID to retrieve full authentication details from the Unity backend."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["authenticationId"]}," with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/three-d-secure-authentication/integrated-authentication/get-authentication-details"},"children":["Get 3DS authentication details"]}," API to retrieve the full authentication results including transaction status, ECI values, and CAVV data."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation-2","__idx":33},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"onPostAuthentication: async (data) => {\n  console.log('3DS authentication completed. Authentication ID:', data.authenticationId);\n  \n  // Send authenticationId to backend to retrieve authentication result\n  const authResult = await fetchAuthenticationResultFromBackend(data.authenticationId);\n  \n  console.log('Authentication result:', authResult);\n  \n  // Check transaction status\n  switch (authResult.transactionStatus) {\n    case 'Y':\n      console.log('Authentication successful - no challenge needed');\n      showMessage('Card verified successfully');\n      break;\n      \n    case 'C':\n      console.log('Challenge completed - checking result...');\n      if (authResult.state === 'AuthenticationSuccessful') {\n        console.log('Challenge completed successfully');\n        showMessage('Verification completed');\n      } else {\n        console.log('Challenge failed');\n        showError('Verification failed. Please try again.');\n        return; // Stop payment\n      }\n      break;\n      \n    case 'N':\n      console.log('Authentication failed');\n      showError('Card verification failed');\n      return; // Stop payment\n      \n    case 'R':\n      console.log('Authentication rejected');\n      showError('Payment was rejected by your bank');\n      return; // Stop payment\n  }\n  \n  // Evaluate authentication result to update authorisation decision\n  const authorisationDecision = await evaluateAuthenticationAndUpdateAuthorization(authResult);\n  \n  console.log('Proceeding to final authorisation...');\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpreauthorisation","__idx":34},"children":["onPreAuthorisation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPreAuthorisation"]}," callback receives only the gateway token ID. Use this ID to retrieve token details and make authorisation decisions on your backend."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-3","__idx":35},"children":["Event data"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object containing token information."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.gatewayTokenId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The token ID from the payment gateway. Use this ID to retrieve full token details from the Unity backend and update transaction decision."]}]}]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["gatewayTokenId"]}," with the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/token-vault/other/get-masked-card-related-to-gateway-token"},"children":["Get masked card data related to gateway token"]}," API to retrieve full token details including card scheme, funding source (credit/debit), masked PAN, and expiry date."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation-3","__idx":36},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"onPreAuthorisation: async (data) => {\n  console.log('Pre-authorisation for token:', data.gatewayTokenId);\n  \n  // Retrieve token details and make authorisation decision\n  const transactionDecision = await getAuthorisationDecision(data.gatewayTokenId);\n  \n  if (!transactionDecision) {\n    // Not proceeding\n    console.log('Not proceeding with authorisation');\n    return null;\n  }\n  \n  // Perform pre-payment validation\n  const isHighRisk = await checkCustomerRiskProfile();\n  const customerTier = await getCustomerTier();\n  \n  // Get billing address if AVS is enabled\n  const billingAddress = await getBillingAddress();\n  \n  return {\n    addressVerification: billingAddress ? {\n      countryCode: billingAddress.countryCode,\n      houseNumberOrName: billingAddress.address,\n      postalCode: billingAddress.postalCode,\n      city: billingAddress.city,\n      state: billingAddress.state\n    } : undefined,\n    riskScreeningData: {\n      performRiskScreening: true,\n      userIp: \"192.168.1.100\",\n      account: {\n        id: \"user_12345678\",\n        creationDateTime: \"2024-01-15T10:30:00.000Z\"\n      },\n      items: [{\n        price: 99.99,\n        quantity: 1,\n        category: \"Electronics\"\n      }],\n      fulfillments: [{\n        type: \"Shipped\",\n        shipping: {\n          shippingMethod: \"Express\"\n        },\n        recipientPerson: {\n          phoneNumber: \"+1234567890\",\n          email: \"customer@example.com\"\n        }\n      }]\n    }\n  };\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important:"]}," 3DS external data (obtained from external authentication sources) should no longer be provided via the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["threeDSecureData"]}," return parameter. Instead, provide this data to the backend via the Unity session update endpoint."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"retrieved-transaction-data-structure","__idx":37},"children":["Retrieved transaction data structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When you retrieve the full token/transaction details from your backend, you'll get detailed information including 3DS authentication results."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"{\n  initiateIntegratedSuccessAuthenticationResult: {\n    status: 200,\n    authenticationId: \"auth_12345678-abcd-1234-efgh-123456789012\",\n    uniqueId: \"unique_98765\",\n    state: \"Completed\",\n    transactionStatus: \"Y\",\n    electronicCommerceIndicator: \"05\",\n    exemptionGranted: false,\n    exemptionGrantedByIssuer: \"79\",\n    threeDSecureVersion: \"2.2.0\",\n    directoryServerTransactionId: \"ds_trans_12345\",\n    cardholderAuthenticationVerificationValue: \"jGvQIvG/5UhjAREALGYYemQLXPI=\",\n    acsUrl: null, \n    challengeData: null,\n    stateData: {\n      code: \"SUCCESS\",\n      reason: \"Authentication completed successfully\"\n    },\n    cardholderInfo: \"Additional cardholder verification completed\"\n  },\n  transactionInitiationData: {\n    psd2Data: {\n      scaExemption: null\n    },\n    threeDSecureData: {\n      threeDSecureVersion: \"2.2.0\",\n      electronicCommerceIndicator: \"05\",\n      cardHolderAuthenticationVerificationValue: \"jGvQIvG/5UhjAREALGYYemQLXPI=\",\n      directoryServerTransactionId: \"ds_trans_12345\",\n      threeDSecureTransactionStatus: \"Y\"\n    },\n    identityVerification: {\n      nameVerification: true\n    },\n    addressVerification: {\n      countryCode: \"GB\",\n      houseNumberOrName: \"123\",\n      postalCode: \"SW1A 1AA\"\n    }\n  },\n  cardTokenData: null\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Details about the successful 3DS authentication."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.status"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The HTTP status code."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.authenticationId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The unique identifier for this 3DS session."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.uniqueId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The unique identifier for this authentication attempt."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.state"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The state of the authentication."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.transactionStatus"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The status of the transaction.",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"Possible values:",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"* ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Y"]}," - Authentication verification successful",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"* ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["N"]}," - Not authenticated",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"* ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["U"]}," - Authentication couldn't be performed",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"* ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["A"]}," - Attempts processing performed",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"* ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["C"]}," - Challenge required",{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},"* ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["R"]}," - Authentication rejected"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.electronicCommerceIndicator"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Electronic Commerce Indicator (ECI)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.exemptionGranted"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["boolean"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Whether an exemption was granted."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.exemptionGrantedByIssuer"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The type of exemption granted by the issuer."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.threeDSecureVersion"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The 3DS version used."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.directoryServerTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The Directory Server transaction ID."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.cardholderAuthenticationVerificationValue"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The CAVV value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.acsUrl"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string or null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ACS URL (null if no challenge)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.challengeData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string or null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Challenge data (null if no challenge)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.stateData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["State information."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["initiateIntegratedSuccessAuthenticationResult.cardholderInfo"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Additional cardholder information."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Transaction initiation details."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.psd2Data"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["PSD2 related data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.threeDSecureData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3DS authentication data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.threeDSecureData.threeDSecureVersion"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The 3DS version."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.threeDSecureData.electronicCommerceIndicator"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The ECI value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.threeDSecureData.cardHolderAuthenticationVerificationValue"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The CAVV value."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.threeDSecureData.directoryServerTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The DS transaction ID."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.threeDSecureData.threeDSecureTransactionStatus"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The transaction status."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.identityVerification"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Identity verification data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transactionInitiationData.addressVerification"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Address verification data."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardTokenData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object or null"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card token data (null for new cards)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onpostauthorisation","__idx":38},"children":["onPostAuthorisation"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," callback receives the transaction identifiers and the original payment data from Google Pay. Use these identifiers to call the Unity Backend and retrieve the full transaction outcome."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"warning"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onPostAuthorisation"]}," callback doesn't return the transaction outcome (Authorised, Captured, Refused, etc.). You must call the Unity Backend to obtain the full transaction result. Use the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/apis/transaction/other/get-transaction-details"},"children":["Get transaction details"]}," API with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]}," to retrieve the complete transaction outcome."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-4","__idx":39},"children":["Event data"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["MerchantSubmitResult or FailedSubmitResult"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object containing the transaction identifiers. Can be either a success result (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]},") or failure result (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.merchantTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(Success only) Your unique identifier for the transaction. Use this with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]}," to retrieve full authorisation details from the Unity backend."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.systemTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(Success only) The system's unique identifier for the transaction. Use this with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]}," to retrieve full authorisation details from the Unity backend."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.errorCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(Failure only) The error code indicating the type of failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.errorReason"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(Failure only) The human-readable error message."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.correlationId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(Failure only) The correlation ID for tracking and debugging."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result.httpStatusCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["(Failure only) The HTTP status code of the failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["paymentData"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The original payment data from Google Pay, including payment method details and billing information."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation-4","__idx":40},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"onPostAuthorisation: (result, paymentData) => {\n  console.log('3DS Google Pay payment result');\n  \n  if (result && 'merchantTransactionId' in result) {\n    // Success - MerchantSubmitResult\n    console.log('✅ Payment successful with 3DS!');\n    console.log('Merchant Transaction ID:', result.merchantTransactionId);\n    console.log('System Transaction ID:', result.systemTransactionId);\n    \n    // Store transaction details\n    storeTransactionRecord({\n      merchantTransactionId: result.merchantTransactionId,\n      systemTransactionId: result.systemTransactionId,\n      paymentMethod: 'google-pay',\n      processingType: '3ds',\n      liabilityShift: true,\n      timestamp: new Date().toISOString()\n    });\n    \n    // Redirect to success page\n    window.location.href = `/payment-success?txn=${result.merchantTransactionId}`;\n    \n  } else if (result && 'errorCode' in result) {\n    // Failure - FailedSubmitResult\n    console.error('❌ Payment failed');\n    console.error('Error code:', result.errorCode);\n    console.error('Error reason:', result.errorReason);\n    console.error('Correlation ID:', result.correlationId);\n    \n    // Handle specific error types\n    handlePaymentFailure(result);\n  }\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"success-result-structure","__idx":41},"children":["Success result structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the payment is successful, you'll receive a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["MerchantSubmitResult"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"{\n  merchantTransactionId: \"order-123456\",\n  systemTransactionId: \"sys-txn-789012\"\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your unique identifier for the transaction that was provided during SDK initialisation."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["systemTransactionId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The system's unique identifier for the transaction. Use this with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["merchantTransactionId"]}," to retrieve full authorisation details from the Unity backend."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"failure-result-structure","__idx":42},"children":["Failure result structure"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When the payment fails, you'll receive a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FailedSubmitResult"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"{\n  errorCode: \"AUTHENTICATION_FAILED\",\n  errorReason: \"3DS authentication failed\",\n  correlationId: \"corr_abc123def456\",\n  httpStatusCode: 402\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The error code indicating the type of failure."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["errorReason"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A human-readable description of the error."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["correlationId"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A unique identifier for this transaction attempt. Use this for support inquiries and debugging."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["httpStatusCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["number"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The HTTP status code associated with the failure."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"onerror","__idx":43},"children":["onError"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onError"]}," callback is triggered when an error occurs during the Google Pay flow (including 3DS authentication failures)."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-5","__idx":44},"children":["Event data"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Object containing error information."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.code"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The error code indicating the type of error."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.message"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A human-readable description of the error."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error.statusCode"]},{"$$mdtype":"Tag","name":"Break","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"Details","attributes":{},"children":["string or undefined"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Status code, if available."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation-5","__idx":45},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"onError: (error) => {\n  console.error('3DS Google Pay error:', error);\n  \n  // Handle specific error types\n  switch (error.code) {\n    case 'AUTHENTICATION_FAILED':\n      showError('Card verification failed. Please try again.');\n      trackError('3ds-authentication-failed', error);\n      break;\n      \n    case 'AUTHENTICATION_TIMEOUT':\n      showError('Verification timed out. Please try again.');\n      trackError('3ds-authentication-timeout', error);\n      break;\n      \n    case 'AUTHENTICATION_REJECTED':\n      showError('Payment was rejected during verification.');\n      trackError('3ds-authentication-rejected', error);\n      break;\n      \n    case 'BUYER_ACCOUNT_ERROR':\n      showError('There was an issue with your Google Pay account. Please try another payment method.');\n      trackError('google-pay-account-error', error);\n      break;\n      \n    case 'MERCHANT_CONFIGURATION_ERROR':\n      showError('Payment system configuration error. Please contact support.');\n      logError('Google Pay merchant configuration error', error);\n      notifySupport(error);\n      break;\n      \n    case 'NETWORK_ERROR':\n      showError('Connection failed. Please check your internet and try again.');\n      enableRetry();\n      break;\n      \n    case 'DEVELOPER_ERROR':\n      console.error('Google Pay implementation error:', error.message);\n      logError('Google Pay developer error', error);\n      showError('Payment system error. Please try again later.');\n      break;\n      \n    default:\n      showError('Payment failed. Please try again or use a different payment method.');\n      logError('Unknown 3DS Google Pay error', error);\n  }\n  \n  // Re-enable payment form\n  hideLoadingSpinner();\n  enablePaymentOptions();\n}\n","lang":"typescript"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"oncancel","__idx":46},"children":["onCancel"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["onCancel"]}," callback is triggered when the customer closes the Google Pay payment sheet without completing the payment."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"event-data-6","__idx":47},"children":["Event data"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This callback does not receive any parameters."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-implementation-6","__idx":48},"children":["Example implementation"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"typescript","header":{"controls":{"copy":{}}},"source":"onCancel: () => {\n  console.log('3DS Google Pay payment cancelled by user');\n  \n  // Track cancellation for analytics\n  trackEvent('payment-cancelled', {\n    paymentMethod: 'google-pay',\n    authenticationType: '3ds',\n    timestamp: new Date().toISOString()\n  });\n  \n  // Show message to user\n  showMessage('Payment cancelled. Your order is still in your basket.');\n  \n  // Reset UI state\n  hideLoadingSpinner();\n  enablePaymentOptions();\n}\n","lang":"typescript"},"children":[]}]},"headings":[{"value":"3DS transactions","id":"3ds-transactions","depth":1},{"value":"Overview","id":"overview","depth":2},{"value":"Payment flow","id":"payment-flow","depth":2},{"value":"Step 1: Button interaction","id":"step-1-button-interaction","depth":3},{"value":"Step 2: Payment method selection","id":"step-2-payment-method-selection","depth":3},{"value":"Step 3: Payment sheet completion","id":"step-3-payment-sheet-completion","depth":3},{"value":"Step 4: Pre-initiation","id":"step-4-pre-initiation","depth":3},{"value":"Step 5: Fingerprinting","id":"step-5-fingerprinting","depth":3},{"value":"Step 6: Authentication","id":"step-6-authentication","depth":3},{"value":"Step 7: Authentication result","id":"step-7-authentication-result","depth":3},{"value":"Step 8: Authorisation","id":"step-8-authorisation","depth":3},{"value":"Step 9: Authorisation result","id":"step-9-authorisation-result","depth":3},{"value":"Implementation","id":"implementation","depth":2},{"value":"Before you start","id":"before-you-start","depth":3},{"value":"Step 1: Initialise the SDK","id":"step-1-initialise-the-sdk","depth":3},{"value":"Step 2: Implement callbacks","id":"step-2-implement-callbacks","depth":3},{"value":"Step 3: Handle common scenarios","id":"step-3-handle-common-scenarios","depth":3},{"value":"Conditional 3DS","id":"conditional-3ds","depth":4},{"value":"Challenge indicator selection","id":"challenge-indicator-selection","depth":4},{"value":"Soft decline retry","id":"soft-decline-retry","depth":4},{"value":"Step 4: Handle errors","id":"step-4-handle-errors","depth":3},{"value":"Example","id":"example","depth":3},{"value":"Callback data","id":"callback-data","depth":2},{"value":"onPostInitiateAuthentication","id":"onpostinitiateauthentication","depth":3},{"value":"Event data","id":"event-data","depth":4},{"value":"Example implementation","id":"example-implementation","depth":4},{"value":"onPreAuthentication","id":"onpreauthentication","depth":3},{"value":"Event data","id":"event-data-1","depth":4},{"value":"Example implementation","id":"example-implementation-1","depth":4},{"value":"Challenge window sizes","id":"challenge-window-sizes","depth":4},{"value":"Challenge indicators","id":"challenge-indicators","depth":4},{"value":"onPostAuthentication","id":"onpostauthentication","depth":3},{"value":"Event data","id":"event-data-2","depth":4},{"value":"Example implementation","id":"example-implementation-2","depth":4},{"value":"onPreAuthorisation","id":"onpreauthorisation","depth":3},{"value":"Event data","id":"event-data-3","depth":4},{"value":"Example implementation","id":"example-implementation-3","depth":4},{"value":"Retrieved transaction data structure","id":"retrieved-transaction-data-structure","depth":4},{"value":"onPostAuthorisation","id":"onpostauthorisation","depth":3},{"value":"Event data","id":"event-data-4","depth":4},{"value":"Example implementation","id":"example-implementation-4","depth":4},{"value":"Success result structure","id":"success-result-structure","depth":4},{"value":"Failure result structure","id":"failure-result-structure","depth":4},{"value":"onError","id":"onerror","depth":3},{"value":"Event data","id":"event-data-5","depth":4},{"value":"Example implementation","id":"example-implementation-5","depth":4},{"value":"onCancel","id":"oncancel","depth":3},{"value":"Event data","id":"event-data-6","depth":4},{"value":"Example implementation","id":"example-implementation-6","depth":4}],"frontmatter":{"seo":{"title":"3DS transactions"}},"lastModified":"2026-07-10T10:50:04.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/checkout/components/web/google-pay/3ds","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}