<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Nikhil Vashistha on Medium]]></title>
        <description><![CDATA[Stories by Nikhil Vashistha on Medium]]></description>
        <link>https://medium.com/@nikhilvashistha?source=rss-cee65acd55cc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*eEqMRkPnZKX2zKZYPlsblA.jpeg</url>
            <title>Stories by Nikhil Vashistha on Medium</title>
            <link>https://medium.com/@nikhilvashistha?source=rss-cee65acd55cc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 14:00:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nikhilvashistha/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Integrating Google TapAndPay SDK in Android for Push Tokenization]]></title>
            <link>https://nikhilvashistha.medium.com/integrating-google-tapandpay-sdk-in-android-for-push-tokenization-542b9013855d?source=rss-cee65acd55cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/542b9013855d</guid>
            <category><![CDATA[push-tokenization]]></category>
            <category><![CDATA[google-wallet]]></category>
            <category><![CDATA[gpay]]></category>
            <category><![CDATA[tap-and-pay]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Nikhil Vashistha]]></dc:creator>
            <pubDate>Wed, 27 Mar 2024 18:33:15 GMT</pubDate>
            <atom:updated>2024-04-08T18:01:25.454Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Push Tokenization" src="https://cdn-images-1.medium.com/max/1024/1*3C_txTeVbD8Wew2Jgf19_A.png" /></figure><p>In the realm of mobile payments, security and efficiency are paramount. Google’s TapAndPay SDK offers a robust solution for app developers looking to integrate payment tokenization into their Android applications. This blog post will guide you through integrating the TapAndPay SDK, emphasizing push tokenization for a seamless and secure payment experience.</p><h3>Prerequisites</h3><p>Before diving into the integration process, ensure you’ve completed the following prerequisites:</p><ul><li>Familiarize yourself with the Google Play services APIs.</li><li>Get your app whitelisted by Google for using the Push Provisioning API. Contact Google support for whitelisting.</li></ul><h3>Understanding Push Tokenization</h3><p>Push tokenization involves adding a virtual payment card to Google Pay, requiring coordination between your mobile app, Google Pay, the Card issuing platform, and the payment network. This process is crucial for enabling secure transactions within your app.</p><h3>Key Tasks for Your Android App</h3><ol><li>Synchronize the active wallet to ensure your app’s user interface is consistent with the underlying wallet state.</li><li>Display, add, activate, and remove cards within your app, integrating closely with Google Pay’s functionalities.</li></ol><h3>Step-by-Step Integration Guide</h3><h3>Step One: Set Up the API Client</h3><p>First, create a standard TapAndPay Client and initialise it:</p><pre>TapAndPayClient mTapAndPayClient = TapAndPay.getClient(context);</pre><h3>Step Two: Synchronize the Active Wallet</h3><p>To synchronize with the active wallet, call the getActiveWalletId() API. If no active wallet is found, you&#39;ll need to create one using the createWallet() API:</p><pre>mTapAndPayClient.getActiveWalletId(googleApiClient).setResultCallback(new ResultCallback&lt;GetActiveWalletIdResult&gt;() {<br>    @Override<br>    public void onResult(GetActiveWalletIdResult result) {<br>        if (result.getStatus().isSuccess()) {<br>            String walletID = result.getActiveWalletId();<br>            // Next steps: Look up token IDs for the active wallet.<br>        } else {<br>            if (result.getStatus().getStatusCode() == TapAndPayStatusCodes.TAP_AND_PAY_NO_ACTIVE_WALLET) {<br>                // Prompt to create the wallet.<br>                createWallet();<br>            }<br>        }<br>    }<br>});</pre><pre>private void createWallet() {<br>    mTapAndPayClient.createWallet(currentActivity, REQUEST_CREATE_WALLET);<br>}</pre><h3>Step Three: Implement the Card User Interface</h3><p>Implement UI components in your app to display the “Add to Google Pay” button, adhering to Google’s brand guidelines. Query each card’s status using the TapAndPay API to update the UI accordingly.</p><h3>Step Four: Implement the Push-Provisioning Flow</h3><ol><li>Create the Opaque Payment Card (OPC): Generate the OPC using the Card Issuing platform and prepare your app to provision the card in Google Pay.</li><li>Push Tokenize the OPC: Use the pushTokenize method from the TapAndPay API to tokenize the OPC for use in Google Pay.</li></ol><pre>UserAddress userAddress = UserAddress.newBuilder()<br>        .setName(userAddressJSON.optString(&quot;name&quot;))<br>        .setPhoneNumber(userAddressJSON.optString(&quot;phone&quot;))<br>        .setAddress1(userAddressJSON.optString(&quot;address1&quot;))<br>        .setAddress2(userAddressJSON.optString(&quot;address2&quot;))<br>        .setLocality(userAddressJSON.optString(&quot;city&quot;))<br>        .setAdministrativeArea(userAddressJSON.optString(&quot;state&quot;))<br>        .setCountryCode(userAddressJSON.optString(&quot;country&quot;))<br>        .setPostalCode(userAddressJSON.optString(&quot;postal_code&quot;))<br>        .build();<br><br>PushTokenizeRequest pushTokenizeRequest = new PushTokenizeRequest.Builder()<br>        .setOpaquePaymentCard(opc)<br>        .setNetwork(network)<br>        .setTokenServiceProvider(tsp)<br>        .setDisplayName(pushTokenizeData.optString(&quot;display_name&quot;))<br>        .setLastDigits(pushTokenizeData.optString(&quot;last_digits&quot;))<br>        .setUserAddress(userAddress)<br>        .build();<br><br>mTapAndPayClient<br>        .pushTokenize(currentActivity, pushTokenizeRequest, REQUEST_PUSH_TOKENIZE);</pre><h3>Step Five: Activate Cards</h3><p>Post-provisioning, some cards may require activation. Your app should detect this and request your backend to activate any cards pending activation. Optionally, use the tokenize() API to resume the identification and verification (ID&amp;V) process.</p><h3>Step Six: Remove Cards</h3><p>To remove a tokenized card, use the requestDeleteToken() API to present a dialog to the user, confirming the deletion of the card.</p><h3>Best Practices and Real-World Examples</h3><ul><li><strong>Error Handling:</strong> Implement comprehensive error handling to cover scenarios such as lack of device support for Google Pay or user cancellation of the provisioning process.</li><li><strong>User Experience:</strong> Design a seamless and intuitive user interface for card management within your app, ensuring users can easily add, activate, and remove cards.</li><li><strong>Security Considerations:</strong> Always adhere to best practices for security, especially when handling payment information. Ensure all communications with backend servers are encrypted and secure.</li></ul><h3>Benefits of Using TapAndPay SDK</h3><p>Integrating Google’s TapAndPay SDK for push tokenization in your Android app offers several advantages:</p><ul><li><strong>Enhanced Security:</strong> Tokenization abstracts sensitive card details, reducing the risk of fraud.</li><li><strong>Streamlined Payments:</strong> Users enjoy a seamless checkout experience without the need to enter payment details manually.</li><li><strong>Broad Compatibility:</strong> Supports a wide range of payment networks and card types, increasing your app’s versatility.</li></ul><h3>Conclusion</h3><p>Integrating Google TapAndPay SDK in your Android application is a strategic move to enhance payment security and user experience. By following the steps outlined in this guide, developers can implement push tokenization efficiently, ensuring a seamless integration process. Keep in mind the best practices and real-world examples provided to maximize the benefits of using TapAndPay SDK in your mobile applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=542b9013855d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Reusable JavaScript GitHub Action: A Step-by-Step Guide]]></title>
            <link>https://nikhilvashistha.medium.com/creating-a-reusable-javascript-github-action-a-step-by-step-guide-79bf538b90ab?source=rss-cee65acd55cc------2</link>
            <guid isPermaLink="false">https://medium.com/p/79bf538b90ab</guid>
            <category><![CDATA[github]]></category>
            <category><![CDATA[continuous-integration]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[github-secret]]></category>
            <category><![CDATA[github-actions]]></category>
            <dc:creator><![CDATA[Nikhil Vashistha]]></dc:creator>
            <pubDate>Fri, 14 Jul 2023 18:32:19 GMT</pubDate>
            <atom:updated>2023-07-14T18:32:19.803Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*eq7aiemb1qmKXZ8dGulZbA.png" /></figure><p><strong>Introduction:</strong> GitHub Actions are a powerful tool for automating workflows and tasks within your software development projects. With Actions, you can build, test, and deploy your code seamlessly. In this blog post, we will walk you through the process of <strong>creating a reusable JavaScript GitHub Action</strong>, using the <strong>“update-github-action-secret”</strong> action as an example. By examining the code and structure of the public GitHub repository <strong>(https://github.com/NikhilVashistha/update-github-action-secret)</strong>, you’ll gain a clear understanding of how to create your own custom Actions to streamline your development process.</p><p><strong>Prerequisites:</strong> Before we dive into creating a JavaScript GitHub Action, make sure you have the following prerequisites:</p><ol><li>Basic understanding of <strong>JavaScript </strong>and<strong> </strong><a href="https://docs.github.com/en/actions"><strong>GitHub Actions</strong></a>.</li><li>A <strong>GitHub</strong> account.</li><li>Familiarity with <strong>Git</strong> and <strong>version control</strong> concepts.</li><li><strong>Node.js</strong> and <strong>npm</strong> (Node Package Manager) installed on your local machine.</li></ol><p><strong>Step 1:</strong> Setting Up Your Local Environment To get started, create a new directory on your local machine for your GitHub Action project. Open a terminal or command prompt, navigate to the project directory, and initialize a new Node.js project by running the following command:</p><pre>$ npm init -y</pre><p>This will generate a package.json file for your project, which will allow you to manage dependencies and scripts.</p><p><strong>Step 2:</strong> Installing Dependencies Next, we need to install the required dependencies for our GitHub Action. In this example, we will be using the @actions/core package, which provides a set of tools for working with GitHub Actions. Run the following command to install it:</p><pre>$ npm install @actions/core</pre><p><strong>Step 3:</strong> Cloning the Example Repository To understand the structure and implementation of the <strong>“update-github-action-secret”</strong> GitHub Action, clone the example repository from GitHub by running the following command in your terminal:</p><pre>$ git clone https://github.com/NikhilVashistha/update-github-action-secret</pre><p>This will create a local copy of the repository on your machine.</p><p><strong>Step 4:</strong> Examining the Action Code Navigate to the cloned repository directory and open the index.js file in your code editor. Take the time to review the code and understand how it works. This will give you valuable insights into building your own GitHub Actions.</p><p><strong>Step 5:</strong> Understanding the Action Metadata In the repository, you’ll find an action.yml file. Open it in your code editor to examine the metadata for the Action. This YAML file defines the name, description, inputs, outputs, and execution details of the Action. Study it carefully to grasp how the example Action is structured.</p><p><strong>Step 6:</strong> Modifying and Customizing the Action Now that you have a solid understanding of the example Action, you can modify and customize it according to your specific requirements. Feel free to update the code, metadata, and any other relevant files to align with your desired functionality.</p><p><strong>Step 7:</strong> Committing and Pushing Your Custom Action Once you have made the necessary modifications to the example Action, it’s time to commit and push your code to a GitHub repository. Create a new repository on GitHub, initialize a new Git repository locally, add the required files, and push the code to your remote repository.</p><p><strong>Step 8:</strong> Using Your Custom Action in a Workflow To use your newly created Action in a GitHub workflow, navigate to your repository on GitHub and create a new workflow file (e.g., .github/workflows/main.yml). Define the workflow as needed and add a step that references your custom Action. For example:</p><pre>- name: Update Secret<br>  uses: your-username/your-repository-name@main<br>  with:<br>    secret_value: ${{ secrets.YOUR_SECRET_NAME }}</pre><p>Replace your-username and your-repository-name with your GitHub username and repository name, respectively. Also, update YOUR_SECRET_NAME with the actual name of the secret you want to update.</p><p><strong>Step 9:</strong> Commit and Run the Workflow Commit and push the workflow file to your repository. GitHub will automatically trigger the workflow whenever changes are pushed to the repository. You can also manually run the workflow from the Actions tab on your repository.</p><p><strong>Conclusion:</strong> Congratulations! You have successfully created a reusable JavaScript GitHub Action by examining the example <strong>“update-github-action-secret”</strong> repository. By understanding the code and structure of an existing Action, you now have the knowledge and confidence to create your own custom Actions to automate and streamline your development processes. GitHub Actions provide limitless possibilities for enhancing your software development workflow, and with your newfound skills, you can make the most of this powerful tool. Happy automating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=79bf538b90ab" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>