{"id":3556,"date":"2022-10-06T21:28:24","date_gmt":"2022-10-06T16:28:24","guid":{"rendered":"https:\/\/www.edopedia.com\/blog\/?p=3556"},"modified":"2022-10-06T21:38:08","modified_gmt":"2022-10-06T16:38:08","slug":"stripe-angular-integration-with-node-js-express-typescript","status":"publish","type":"post","link":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/","title":{"rendered":"Stripe Angular Integration with Node.js, Express &#038; TypeScript"},"content":{"rendered":"\n<p>In this tutorial, you will learn about <strong>Stripe Angular integration<\/strong>. Basically, we will integrate the Stripe payment gateway inside a project that is built using Angular 13, Node.js, Express, and TypeScript.<\/p>\n\n\n\n<p>I have provided the complete source code of the <strong>Stripe Angular integration example<\/strong> in this article.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Stripe Angular Integration Example Source Code<\/h2>\n\n\n\n<p>We start this project by creating a new Angular app inside the folder named &#8220;client&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">mkdir client<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">cd client<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">ng new sampletestapp<\/pre><\/div>\n\n\n\n<p>Now open\u00a0<code>app.module.ts<\/code>\u00a0file and copy\/paste the following code to import the\u00a0<code>httpclient<\/code>\u00a0module.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">app.module.ts<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application\/typescript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;TypeScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;typescript&quot;}\">import { NgModule } from '@angular\/core';\nimport { BrowserModule } from '@angular\/platform-browser';\nimport { AppComponent } from '.\/app.component';\nimport { HttpClientModule } from '@angular\/common\/http';\n\n\n@NgModule({\n  declarations: [AppComponent],\n  imports: [\n    BrowserModule,\n    HttpClientModule\n  ],\n  providers: [],\n  bootstrap: [AppComponent],\n})\nexport class AppModule {}<\/pre><\/div>\n\n\n\n<p>Its time to design an HTML <code>template<\/code>\u00a0for our Stripe Angular integration example app. So, open the app.component.html\u00a0file and copy\/paste the following code into it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">app.component.html<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text\/html&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}\">&lt;h2&gt;Angular Stripe Checkout Example&lt;\/h2&gt;\n\n&lt;button (click)=&quot;makePayment(15)&quot;&gt;Pay With Stripe&lt;\/button&gt;\n\n&lt;div *ngIf=&quot;success&quot;&gt;\n  &lt;h1&gt;Your Payment is complete successfully&lt;\/h1&gt;\n&lt;\/div&gt;\n&lt;div *ngIf=&quot;failure&quot;&gt;\n    &lt;h1&gt;Some Error is taken place inside the payment&lt;\/h1&gt;\n&lt;\/div<\/pre><\/div>\n\n\n\n<p>Here&#8217;s a screenshot of how the template looks.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"508\" height=\"109\" src=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/Angular-Stripe-Checkout-Example.jpg\" alt=\"Angular Stripe Checkout Example\" class=\"wp-image-3557\" srcset=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/Angular-Stripe-Checkout-Example.jpg 508w, https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/Angular-Stripe-Checkout-Example-300x64.jpg 300w\" sizes=\"auto, (max-width: 508px) 100vw, 508px\" \/><figcaption>Angular Stripe Checkout Example<\/figcaption><\/figure>\n\n\n\n<p>Now open the <code>app.component.ts<\/code> file and copy\/paste the following code into it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">app.component.ts<\/h3>\n\n\n\n<p>Important Note: On line # 24, replace <code>###yourkey###<\/code> text with your actual Stripe API key.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application\/typescript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;TypeScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;typescript&quot;}\">import { Component } from '@angular\/core';\nimport { CheckoutService } from '.\/services\/checkout.service';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: '.\/app.component.html',\n  styleUrls: ['.\/app.component.css'],\n})\nexport class AppComponent {\n  paymentHandler: any = null;\n\n  success: boolean = false\n  \n  failure:boolean = false\n\n  constructor(private checkout: CheckoutService) {}\n\n  ngOnInit() {\n    this.invokeStripe();\n  }\n\n  makePayment(amount: number) {\n    const paymentHandler = (&lt;any&gt;window).StripeCheckout.configure({\n      key: '###yourkey###',\n      locale: 'auto',\n      token: function (stripeToken: any) {\n        console.log(stripeToken);\n        paymentstripe(stripeToken);\n      },\n    });\n\n    const paymentstripe = (stripeToken: any) =&gt; {\n      this.checkout.makePayment(stripeToken).subscribe((data: any) =&gt; {\n        console.log(data);\n        if (data.data === &quot;success&quot;) {\n          this.success = true\n        }\n        else {\n          this.failure = true\n        }\n      });\n    };\n\n    paymentHandler.open({\n      name: 'Edopedia.com Payment',\n      description: 'Some sample description of product',\n      amount: amount * 100,\n    });\n  }\n\n  invokeStripe() {\n    if (!window.document.getElementById('stripe-script')) {\n      const script = window.document.createElement('script');\n      script.id = 'stripe-script';\n      script.type = 'text\/javascript';\n      script.src = 'https:\/\/checkout.stripe.com\/checkout.js';\n      script.onload = () =&gt; {\n        this.paymentHandler = (&lt;any&gt;window).StripeCheckout.configure({\n          key: '###yourkey###',\n          locale: 'auto',\n          token: function (stripeToken: any) {\n            console.log(stripeToken);\n          },\n        });\n      };\n\n      window.document.body.appendChild(script);\n    }\n  }\n}<\/pre><\/div>\n\n\n\n<p>Now we are ready to carry out the payment. So, lets make a new service using the below command which will actually make the <code>POST<\/code> request to the backend.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">ng g s services\/checkout<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application\/typescript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;TypeScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;typescript&quot;}\">import { Injectable } from '@angular\/core';\nimport { HttpClient } from '@angular\/common\/http';\nimport { Observable } from 'rxjs';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class CheckoutService {\n\n  constructor(private http: HttpClient) { }\n  \n  makePayment(stripeToken: any): Observable&lt;any&gt;{\n    const url = &quot;http:\/\/localhost:5000\/checkout\/&quot;\n\n    return this.http.post&lt;any&gt;(url,{token:stripeToken})\n  }\n}<\/pre><\/div>\n\n\n\n<p>Here we are making the <code>POST<\/code> request to the backend which does not exist yet. So, let&#8217;s create the backend for our <strong>Stripe Angular integration<\/strong> app using <strong>Node.js<\/strong> and <strong>Express<\/strong>.<\/p>\n\n\n\n<p>First of all, make a new directory to hold our backend files. For the sake of this tutorial, I name it &#8220;server&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">mkdir server<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">cd server<\/pre><\/div>\n\n\n\n<p>Initialize the project.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm init -y<\/pre><\/div>\n\n\n\n<p>Now we will install the required packages from npm.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm i express<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm i cors<\/pre><\/div>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text\/x-sh&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}\">npm i stripe<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">index.js<\/h3>\n\n\n\n<p><strong>Important Note:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>On line # 6, replace <code>###stripe_secret_key###<\/code> with your actual Stripe secret key. You will get it from the Stripe dashboard.<\/li><li>On line # 17, replace <code>###your_email###<\/code> with your real email.<\/li><\/ul>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:true,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const express = require(&quot;express&quot;);\nconst bodyparser = require('body-parser')\nconst app = express();\napp.use(bodyparser.urlencoded({ extended: false }))\napp.use(bodyparser.json())\nconst stripe = require(&quot;stripe&quot;)(&quot;###stripe_secret_key###&quot;);\nconst cors = require('cors')\n\napp.use(cors())\n\napp.post('\/checkout', async(req, res) =&gt; {\n    try {\n        console.log(req.body);\n        token = req.body.token\n      const customer = stripe.customers\n        .create({\n          email: &quot;###your_email###&quot;,\n          source: token.id\n        })\n        .then((customer) =&gt; {\n          console.log(customer);\n          return stripe.charges.create({\n            amount: 1000,\n            description: &quot;Test Purchase using express and Node&quot;,\n            currency: &quot;USD&quot;,\n            customer: customer.id,\n          });\n        })\n        .then((charge) =&gt; {\n          console.log(charge);\n            res.json({\n              data:&quot;success&quot;\n          })\n        })\n        .catch((err) =&gt; {\n            res.json({\n              data: &quot;failure&quot;,\n            });\n        });\n      return true;\n    } catch (error) {\n      return false;\n    }\n})\n\napp.listen(5000, () =&gt; {\n    console.log(&quot;App is listening on Port 5000&quot;)\n})<\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Project Screenshots<\/h2>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"554\" height=\"558\" src=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_payment.jpg\" alt=\"Stripe Angular payment\" class=\"wp-image-3559\" srcset=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_payment.jpg 554w, https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_payment-298x300.jpg 298w, https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_payment-150x150.jpg 150w, https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_payment-120x120.jpg 120w\" sizes=\"auto, (max-width: 554px) 100vw, 554px\" \/><figcaption>Stripe Angular payment<\/figcaption><\/figure>\n\n\n\n<p>Here, you can use the following Stripe demo cards for testing.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Number<\/strong><\/td><td><strong>Brand<\/strong><\/td><td><strong>CVC<\/strong><\/td><td><strong>Date<\/strong><\/td><\/tr><tr><td>4242424242424242<\/td><td>Visa<\/td><td>Any 3 digits<\/td><td>Any future date<\/td><\/tr><tr><td>5555555555554444<\/td><td>Mastercard<\/td><td>Any 3 digits<\/td><td>Any future date<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"741\" height=\"187\" src=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/angular_stripe_payment_successful.jpg\" alt=\"Angular Stripe payment successful\" class=\"wp-image-3560\" srcset=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/angular_stripe_payment_successful.jpg 741w, https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/angular_stripe_payment_successful-300x76.jpg 300w\" sizes=\"auto, (max-width: 741px) 100vw, 741px\" \/><figcaption>Angular Stripe payment successful<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn about Stripe Angular integration. Basically, we will integrate the Stripe payment gateway inside a project that is built using Angular 13, Node.js, Express, and TypeScript. I have provided the complete source code of the Stripe Angular integration example in this article. Stripe Angular Integration Example Source Code We start &#8230; <a title=\"Stripe Angular Integration with Node.js, Express &#038; TypeScript\" class=\"read-more\" href=\"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/\" aria-label=\"Read more about Stripe Angular Integration with Node.js, Express &#038; TypeScript\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":3562,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[112],"tags":[],"class_list":["post-3556","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Stripe Angular Integration with Node.js, Express &amp; TypeScript<\/title>\n<meta name=\"description\" content=\"In this tutorial, you will learn about Stripe Angular integration. Basically, we will integrate the Stripe payment gateway inside a project that is built\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Stripe Angular Integration with Node.js, Express &amp; TypeScript\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, you will learn about Stripe Angular integration. Basically, we will integrate the Stripe payment gateway inside a project that is built\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/\" \/>\n<meta property=\"og:site_name\" content=\"Edopedia\" \/>\n<meta property=\"article:author\" content=\"trulyfurqan\" \/>\n<meta property=\"article:published_time\" content=\"2022-10-06T16:28:24+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-10-06T16:38:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_integration.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"880\" \/>\n\t<meta property=\"og:image:height\" content=\"495\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Furqan\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Furqan\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Stripe Angular Integration with Node.js, Express & TypeScript","description":"In this tutorial, you will learn about Stripe Angular integration. Basically, we will integrate the Stripe payment gateway inside a project that is built","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/","og_locale":"en_US","og_type":"article","og_title":"Stripe Angular Integration with Node.js, Express & TypeScript","og_description":"In this tutorial, you will learn about Stripe Angular integration. Basically, we will integrate the Stripe payment gateway inside a project that is built","og_url":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/","og_site_name":"Edopedia","article_author":"trulyfurqan","article_published_time":"2022-10-06T16:28:24+00:00","article_modified_time":"2022-10-06T16:38:08+00:00","og_image":[{"width":880,"height":495,"url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_integration.jpg","type":"image\/jpeg"}],"author":"Furqan","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Furqan","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#article","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/"},"author":{"name":"Furqan","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339"},"headline":"Stripe Angular Integration with Node.js, Express &#038; TypeScript","datePublished":"2022-10-06T16:28:24+00:00","dateModified":"2022-10-06T16:38:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/"},"wordCount":318,"commentCount":0,"publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_integration.jpg","articleSection":["Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/","url":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/","name":"Stripe Angular Integration with Node.js, Express & TypeScript","isPartOf":{"@id":"https:\/\/www.edopedia.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#primaryimage"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#primaryimage"},"thumbnailUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_integration.jpg","datePublished":"2022-10-06T16:28:24+00:00","dateModified":"2022-10-06T16:38:08+00:00","description":"In this tutorial, you will learn about Stripe Angular integration. Basically, we will integrate the Stripe payment gateway inside a project that is built","breadcrumb":{"@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#primaryimage","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_integration.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2022\/10\/stripe_angular_integration.jpg","width":880,"height":495,"caption":"Stripe Angular Integration"},{"@type":"BreadcrumbList","@id":"https:\/\/www.edopedia.com\/blog\/stripe-angular-integration-with-node-js-express-typescript\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.edopedia.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Stripe Angular Integration with Node.js, Express &#038; TypeScript"}]},{"@type":"WebSite","@id":"https:\/\/www.edopedia.com\/blog\/#website","url":"https:\/\/www.edopedia.com\/blog\/","name":"Edopedia","description":"Coding\/Programming Blog","publisher":{"@id":"https:\/\/www.edopedia.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.edopedia.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.edopedia.com\/blog\/#organization","name":"Edopedia","url":"https:\/\/www.edopedia.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","contentUrl":"https:\/\/www.edopedia.com\/blog\/wp-content\/uploads\/2017\/10\/edopedia_icon_text_10.jpg","width":400,"height":100,"caption":"Edopedia"},"image":{"@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.edopedia.com\/blog\/#\/schema\/person\/3951cb19e3aa56df09e408c98aa02339","name":"Furqan","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e5e68aef3ad8f0b83d56f4953c512c8e57bd2e6dc64daec33b5d0495d9058f51?s=96&d=mm&r=g","caption":"Furqan"},"description":"Well. I've been working for the past three years as a web designer and developer. I have successfully created websites for small to medium sized companies as part of my freelance career. During that time I've also completed my bachelor's in Information Technology.","sameAs":["http:\/\/www.edopedia.com\/blog\/","trulyfurqan"],"url":"https:\/\/www.edopedia.com\/blog\/author\/furqan\/"}]}},"_links":{"self":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/comments?post=3556"}],"version-history":[{"count":3,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3556\/revisions"}],"predecessor-version":[{"id":3564,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/posts\/3556\/revisions\/3564"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media\/3562"}],"wp:attachment":[{"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/media?parent=3556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/categories?post=3556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.edopedia.com\/blog\/wp-json\/wp\/v2\/tags?post=3556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}