Formatting Payment 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:
Light Dark
JavaScript
123
let= paymentData.paymentMethodData.tokenizationData.token; console.log(token); var enc=window.btoa();
Android with Java
This sample uses the Android Studio Base64 utility.
1
publicstatic <outputString> encodeToString (byte[] <inputToken>, int)
Apple iPhone with Swift 3
This sample requires the Foundation utility.
123456
extensionString { func base64Encoded() -> <outputString> if let data = self.dat(using:.utf8) { return data.base64EncodedString() } return nil}