Configuring Apple Pay Response Handling {#applepay-web-configuring}
===================================================================

Configure one of the following decryption methods that will handle the response payload of a successful Apple Pay transaction.

1. After the payment token is received, the transaction is finalized when you extract and decrypt the payment data.
   * **`Cybersource` Decryption** :  
     This method forwards the encrypted payment data to your order management system. Use the `Cybersource` API to submit the authorization request, and include the Base64-encoded value obtained from the `paymentData` object in the paymentInformaton.fluidData.value field.  
     Example of `Cybersource` decryption:

     ```
     session.onpaymentauthorized = function (event) {
         var paymentDataString = JSON.stringify(event.payment.token.paymentData);
         var paymentDataBase64 = btoa(paymentDataString);
     }
     ```
   * **Merchant Decryption** :  
     This method forwards the encrypted payment data to your order management system to decrypt. Use the `Cybersource` API to submit the authorization request and include the decrypted payment data.  
     For detailed information about decryption, see [Payment Token Format Reference](https://developer.apple.com/library/ios/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.md#//apple_ref/doc/uid/TP40014929-CH8-SW1 "") in the Apple Developer Center.

