On This Page 
    Formatting Payment Blobs
    IMPORTANT
This section is only applicable if you are using the 
National Australia Bank
 decryption method.To prepare the Google Pay payload for submission to 
National Australia Bank
, 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 <outputString> encodeToString (byte[] <inputToken>, int DEFAULT)
Apple iPhone with Swift 3
This sample requires the Foundation utility.
extension String { func base64Encoded() -> <outputString> if let data = self.dat(using:.utf8) { return data.base64EncodedString() } return nil }