<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Prem Prakash</title>
    <description>The latest articles on Forem by Prem Prakash (@premprakashdev).</description>
    <link>https://forem.com/premprakashdev</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2017993%2F8ea9b7d7-27c4-46f3-8869-c1a7f1fd2b50.jpg</url>
      <title>Forem: Prem Prakash</title>
      <link>https://forem.com/premprakashdev</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/premprakashdev"/>
    <language>en</language>
    <item>
      <title>Integrating Payment Gateways in Next.js 14</title>
      <dc:creator>Prem Prakash</dc:creator>
      <pubDate>Mon, 02 Sep 2024 23:08:31 +0000</pubDate>
      <link>https://forem.com/premprakashdev/integrating-payment-gateways-in-nextjs-14-3o1a</link>
      <guid>https://forem.com/premprakashdev/integrating-payment-gateways-in-nextjs-14-3o1a</guid>
      <description>&lt;p&gt;Managing payments in a web application can be challenging, especially when dealing with multiple payment gateways. To make this easier, I’ve created a demo project that integrates &lt;strong&gt;Stripe&lt;/strong&gt;, &lt;strong&gt;Razorpay&lt;/strong&gt;, &lt;strong&gt;PayPal&lt;/strong&gt;, and &lt;strong&gt;Coinbase&lt;/strong&gt; using &lt;strong&gt;Next.js 14&lt;/strong&gt;. This project showcases how to seamlessly implement these popular payment solutions in a web app, with a focus on user-friendly UI and responsive design.&lt;/p&gt;

&lt;h2&gt;
  
  
  🚀 Live Demo
&lt;/h2&gt;

&lt;p&gt;Curious to see it in action? Check out the live demo &lt;a href="https://payment-gateways-demo.vercel.app" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Installation Guide
&lt;/h2&gt;

&lt;p&gt;If you’d like to run this project locally, follow these steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Clone the repository&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   git clone https://github.com/PremPrakashCodes/payment-gateways.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to the project directory&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   &lt;span class="nb"&gt;cd &lt;/span&gt;payment-gateways
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Install dependencies&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Set up environment variables&lt;/strong&gt;:
Create a &lt;code&gt;.env.local&lt;/code&gt; file in the root directory and add the necessary API keys and configuration settings for the payment gateways.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   NEXT_PUBLIC_BASE_URL=http://localhost:3000

   NEXT_PUBLIC_STRIPE_PUBLIC_KEY=
   STRIPE_SECRET_KEY=
   STRIPE_WEBHOOK_SECRET=

   NEXT_PUBLIC_RAZORPAY_KEY_ID=
   RAZORPAY_KEY_SECRET=

   PAYPAL_CLIENT_ID=
   PAYPAL_CLIENT_SECRET=

   COINBASE_API_KEY=
   COINBASE_WEBHOOK_SECRET=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Run the development server&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   npm run dev
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Open your browser&lt;/strong&gt;:
Visit &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; to see the app in action.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  🎉 How to Use
&lt;/h2&gt;

&lt;p&gt;Simply select a payment gateway from the available options, enter the required payment details, and proceed with the payment. This demo offers a straightforward look at how each gateway can be integrated into your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  🤝 Contributing
&lt;/h2&gt;

&lt;p&gt;Contributions are always welcome! If you’d like to contribute, please fork the repository and submit a pull request. For significant changes, it’s best to open an issue first to discuss your ideas.&lt;/p&gt;

&lt;h2&gt;
  
  
  📄 License
&lt;/h2&gt;

&lt;p&gt;This project is licensed under the MIT License. Feel free to use and modify the code in your own projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  🙌 Acknowledgements
&lt;/h2&gt;

&lt;p&gt;A big thank you to the developers and communities behind:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://nextjs.org/" rel="noopener noreferrer"&gt;Next.js&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stripe.com/" rel="noopener noreferrer"&gt;Stripe&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://razorpay.com/" rel="noopener noreferrer"&gt;Razorpay&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.paypal.com/" rel="noopener noreferrer"&gt;PayPal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.coinbase.com/" rel="noopener noreferrer"&gt;Coinbase&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  📬 Contact
&lt;/h2&gt;

&lt;p&gt;If you have any questions or feedback, I’d love to hear from you!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/premprakashsharma/" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.buymeacoffee.com/premprakash.dev" rel="noopener noreferrer"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--rUPU4284--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://img.buymeacoffee.com/button-api/%3Ftext%3DBuy%2520me%2520a%2520coffee%26emoji%3D%26slug%3Dpremprakash.dev%26button_colour%3DFFDD00%26font_colour%3D000000%26font_family%3DCookie%26outline_colour%3D000000%26coffee_colour%3Dffffff" width="235" height="50"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>nextjs</category>
      <category>react</category>
      <category>stripe</category>
      <category>coinbase</category>
    </item>
  </channel>
</rss>
