Stay organized with collections
Save and categorize content based on your preferences.
Once you have exchanged keys with Google and have your vendor ID (PIAID), you
are ready to establish connectivity with the Virtual Cards API is to
and complete a successful echo test. We provide
code samples to help you perform these tests
using the encryptions keys we exchange to ensure your configuration is correct
and that your infrastructure is properly routing our requests to your host.
Once you have successfully completed echo tests using one of our code
samples, you can update your implementation to communicate with our APIs.
Echo from Partner to Google
Google hosts an echo endpoint
which you can call to test your ability to successfully communicate with our
servers. You should use the encryption keys you exchanged with Google when
forming your echo request and parsing our response.
Using our code samples to echo Google
Once you have one of our code samples configured
and running, you can trigger an echo request to Google by using curl or a
similar tool as follows:
If your keys are properly set up, you should see a successful echo response.
Echo request code samples
Debugging errors during initial development to establish connectivity can be
difficult since our API returns 404s for requests with PGP encryption errors.
And, all responses are encrypted and sent as an octet-stream, which can further
complicate initial connectivity work.
There are a number of resources to help you get started:
Sample code showing how to successfully perform bidirectional echo tests
Codelabs that walk through our code samples
Code sample downloads
The following code samples are fully working examples that can call the Google
hosted echo API. Note that the samples also include code for hosting your
own echo endpoint. The Virtual Cards API does not need that
capability so you should focus your attention on the echo request to Google's
endpoint.
The following codelabs walk through our Java and Node.js sample implementations
to help you quickly come up to speed with how they work and the key
configuration settings you need to adjust to get them working.
All rights reserved. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-12-03 UTC."],[[["\u003cp\u003eAfter exchanging keys with Google and obtaining your vendor ID, you can establish connectivity with the Virtual Cards API by completing a successful echo test.\u003c/p\u003e\n"],["\u003cp\u003eGoogle provides code samples in Java and Node.js to help you perform these echo tests using the exchanged encryption keys and ensure proper configuration.\u003c/p\u003e\n"],["\u003cp\u003eThese code samples include instructions for sending an echo request to Google's endpoint and receiving a successful response, verifying connectivity.\u003c/p\u003e\n"],["\u003cp\u003eYou can utilize codelabs for step-by-step guidance through the Java and Node.js sample implementations, aiding in understanding their functionality and configuration settings.\u003c/p\u003e\n"]]],["After exchanging keys with Google and obtaining a vendor ID, establish connectivity with the Virtual Cards API by performing an echo test. Use provided code samples to ensure correct configuration and proper routing. Initiate an echo request to Google's endpoint via `curl` using the exchanged encryption keys. Successful echoes indicate proper setup. Code samples (Java, Node.js) and codelabs are available to aid with the encryption/decryption process and to successfully perform bidirectional echo tests.\n"],null,["Once you have exchanged keys with Google and have your vendor ID (PIAID), you\nare ready to establish connectivity with the Virtual Cards API is to\nand complete a successful echo test. We provide\n[code samples](#echo_request_code_samples) to help you perform these tests\nusing the encryptions keys we exchange to ensure your configuration is correct\nand that your infrastructure is properly routing our requests to your host.\nOnce you have successfully completed `echo` tests using one of our code\nsamples, you can update your implementation to communicate with our APIs.\n\nEcho from Partner to Google\n\nGoogle hosts an `echo` endpoint\nwhich you can call to test your ability to successfully communicate with our\nservers. You should use the encryption keys you exchanged with Google when\nforming your `echo` request and parsing our response.\n| **Note:** Google's `echo` endpoint returns a 404 error if there was an encryption error. You may want to first test `echo` with our [code samples](#echo_request_code_samples) before testing your own implementation.\n\nUsing our code samples to echo Google\n\nOnce you have one of our [code samples](#echo_request_code_samples) configured\nand running, you can trigger an `echo` request to Google by using `curl` or a\nsimilar tool as follows: \n\n curl -H \"Content-type: text/plain\" -X POST -d 'hello' https://{YOUR_HOST}/echo\n\nIf your keys are properly set up, you should see a successful echo response.\n\nEcho request code samples\n\nDebugging errors during initial development to establish connectivity can be\ndifficult since our API returns 404s for requests with PGP encryption errors.\nAnd, all responses are encrypted and sent as an octet-stream, which can further\ncomplicate initial connectivity work.\n\nThere are a number of resources to help you get started:\n\n- [Java implementation](https://github.com/google-pay/gsp-pgp-java) for encryption and decryption\n- Sample code showing how to successfully perform bidirectional `echo` tests\n- Codelabs that walk through our code samples\n\nCode sample downloads\n\nThe following code samples are fully working examples that can call the Google\nhosted `echo` API. Note that the samples also include code for hosting your\nown echo endpoint. The Virtual Cards API does not need that\ncapability so you should focus your attention on the `echo` request to Google's\nendpoint.\n\n[Java](/static/standard-payments/downloads/bidirectional-echo-sample-java.zip)\n[Node.js](/static/standard-payments/downloads/bidirectional-echo-sample-nodejs.zip)\n\nCodelab walkthroughs\n\nThe following codelabs walk through our Java and Node.js sample implementations\nto help you quickly come up to speed with how they work and the key\nconfiguration settings you need to adjust to get them working.\n\n[Java](/standard-payments/codelabs/java-connectivity-codelab)\n[Node.js](/standard-payments/codelabs/nodejs-connectivity-codelab)"]]