Skip to content

Instantly share code, notes, and snippets.

const { KeyManagementServiceClient } = require('@google-cloud/kms');
const projectId = <YourProjectID>;
const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1
const keyRingId = <KeyRingID>;
const keyId = <YourKeyId>;
const kmsClient = new KeyManagementServiceClient();
const locationName = kmsClient.locationPath(projectId, locationId);
const projectId = <YourProjectID>;
const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1
const keyRingId = <KeyRingID>;
const keyId = <YourKeyId>;
const kmsClient = new KeyManagementServiceClient();
const locationName = kmsClient.locationPath(projectId, locationId);
async function encryptAndStoreToken(token: any) {
const { KeyManagementServiceClient } = require('@google-cloud/kms');
const projectId = <YourProjectID>;
const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1
const keyRingId = <KeyRingID>;
const keyId = <YourKeyId>;
const kmsClient = new KeyManagementServiceClient();
const locationName = kmsClient.locationPath(projectId, locationId);
const { KeyManagementServiceClient } = require('@google-cloud/kms');
const projectId = <YourProjectID>;
const locationId = <YourPreferedStorageLocationID>; //Based on the google cloud regions e.g. us-central1
const keyRingId = <KeyRingID>;
const keyId = <YourKeyId>;
const kmsClient = new KeyManagementServiceClient();
const locationName = kmsClient.locationPath(projectId, locationId);
const { SecretManagerServiceClient } = require('@google-cloud/secret-manager');
const secretManagerclient = new SecretManagerServiceClient();
const parent = 'projects/<YourProjectId>';
const tokenId = <YourTokenId>
async function storeAppLevelSecret(appLevelSecretToStore) {
const [secret] = await secretManagerclient.createSecret({
parent: parent,
secretId: tokenId,
const { SecretManagerServiceClient } = require('@google-cloud/secret-manager');
const secretManagerclient = new SecretManagerServiceClient();
const parent = 'projects/<YourProjectId>';
const tokenId = <YourTokenId>
async function getSecret() {
const [version] = await client.accessSecretVersion({
name: parent + '/secrets/' + tokenId + '/versions/latest',
});
<resources>
<style name="bt_add_card_activity_theme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">#E10A0A</item>
<item name="windowNoTitle">true</item>
<item name="titleTextColor">#fff</item>
<item name="colorAccent">#1d1d1d</item>
<item name="android:textAllCaps">false</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="UnusedResources">
<color name="bt_blue" tools:override="true">#E10A0A</color>
</resources>
BTUIKAppearance.sharedInstance().navigationBarTitleTextColor = UIColor.white
BTUIKAppearance.sharedInstance().barBackgroundColor = UIColor.red
val threeDSecureRequest = ThreeDSecureRequest()
.amount(YOUR_AMOUNT)
.email(EMAIL)
.billingAddress(ADDRESS)
.versionRequested(ThreeDSecureRequest.VERSION_2)
val googlePaymentRequest = GooglePaymentRequest()
.transactionInfo(
TransactionInfo.newBuilder()
.setTotalPrice(YOUR_AMOUNT)