On This Page

{#jumplink-list}  
[Markdown](/docs/cybs/en-us/google-pay/developer/ctv/rest/googlepay/googpay-pay-data-intro/googpay-pay-data-formatting-blobs.md)  
Filter  
FILTER BY TAG

Formatting Payment Blobs {#googpay-pay-data-formatting-blobs}
=============================================================

> IMPORTANT
> This section is only applicable if you are using the ` Cybersource ` decryption method.  
> To prepare the Google Pay payload for submission to `Cybersource`, you must extract the token data element from the Google Pay payload and encode the token data element using Base64.  
> These samples can be used to Base64-encode payment responses:  
> JavaScript

```
let token = paymentData.paymentMethodData.tokenizationData.token;
console.log(token);
var enc=window.btoa(token);
```

Android with Java  
This sample uses the Android Studio Base64 utility.

```
public static &lt;outputString&gt; encodeToString (byte[] &lt;inputToken&gt;, int DEFAULT)
```

Apple iPhone with Swift 3  
This sample requires the Foundation utility.

```
extension String {
     func base64Encoded() -&gt; &lt;outputString&gt;
          if let data = self.dat(using:.utf8) {
               return data.base64EncodedString()
          }
          return nil
}
```

RELATED TO THIS PAGE

