Simple Order API | Visa Platform Connect

Formatting Payment Blobs

This section is only applicable if you are using the
Cybersource
decryption method.
To prepare the google 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.tokenizationDta.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 }