<?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>DEV Community: IBIZAVIC</title>
    <description>The latest articles on DEV Community by IBIZAVIC (@sibizavic).</description>
    <link>https://dev.to/sibizavic</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%2F8691%2F9530995.png</url>
      <title>DEV Community: IBIZAVIC</title>
      <link>https://dev.to/sibizavic</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sibizavic"/>
    <language>en</language>
    <item>
      <title>The easiest way to add Stripe payments in your app, website or elsewhere</title>
      <dc:creator>IBIZAVIC</dc:creator>
      <pubDate>Sat, 04 Mar 2017 14:39:16 +0000</pubDate>
      <link>https://dev.to/sibizavic/the-easiest-way-to-add-stripe-payments-in-your-app-website-or-elsewhere</link>
      <guid>https://dev.to/sibizavic/the-easiest-way-to-add-stripe-payments-in-your-app-website-or-elsewhere</guid>
      <description>&lt;p&gt;&lt;em&gt;You can download the complete source code of this tutorial &lt;a href="https://www.noodl.io/market/product/P201604181926406/noodlio-pay-smooth-payments-with-stripe-accept-payments-without-a-server-side-setup" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Whether you're building a marketplace, mobile app, online storefront, or subscription service, Stripe has the features you need to quickly get started. It is therefore not a surprise it is heavily used by Lyft, TaskRabbit, Instacart, and many other well-known companies. One the main advantages of this payment gateway is that it's built for developers with the eye on easy integration. This is an important advantage; taking away development time on implementing a payment infrastructure helps developers focus on the more important aspects of their applications.&lt;/p&gt;

&lt;h1&gt;
  
  
  Challenges
&lt;/h1&gt;

&lt;p&gt;Nevertheless, integrating payments remains having its challenges and drawbacks. One of the major issues that is faced by the community (see &lt;a href="http://stackoverflow.com/search?q=stripe" rel="noopener noreferrer"&gt;threads&lt;/a&gt; on StackOverflow) is the integration of the payment server. Despite the very elaborate documentation of Stripe, there are still a lot of unanswered questions, especially if you have never implemented a server before. Also, once you have successfully achieved to integrate a server, you'll need to make a link with your client side and afer that find a way to run it 24/7 on a VPS like Heroku, Cloud9, etc. This might be an costly undertaking as you will see yourself easily paying too much for unused server capacity.&lt;/p&gt;

&lt;h1&gt;
  
  
  Solution
&lt;/h1&gt;

&lt;p&gt;In this tutorial I am going to introduce you a new way to integrate Stripe payments, which takes away all the drawbacks that we just mentioned. We'll be leveraging the new but amazing &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe" rel="noopener noreferrer"&gt;Stripe Payments API&lt;/a&gt; (also called Noodlio Pay) to replace our server-side. As you will see, this will save you a lot of precious time to learn a new server language, test, validate and so.&lt;/p&gt;

&lt;h1&gt;
  
  
  Benefits of this approach
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It's quick&lt;/strong&gt;: You can have a working payment server set up within a few minutes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No server-side setup needed&lt;/strong&gt;: Simply send &lt;code&gt;HTTP POST&lt;/code&gt; requests to the Noodlio Pay API from the client-side and the rest will be taken care of.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost efficient&lt;/strong&gt;: Hosting a complete server-side 24/7 can be a costly undertaking. This won't be a worry anymore: because the Noodlio Pay server is already hosted for you, you don't have to spend money on unused server capacity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instantaneous&lt;/strong&gt;: Thanks to the Stripe setup, you'll see the funds transferred immediately to your Stripe Account&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unlimited&lt;/strong&gt;: There are no restrictions on the number of requests that you can send through the Noodlio Pay server.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Broad support&lt;/strong&gt;: You can charge your customers with any client-side language through &lt;code&gt;HTTP POST&lt;/code&gt; requests (for instance &lt;code&gt;Angular&lt;/code&gt;, &lt;code&gt;React&lt;/code&gt;, &lt;code&gt;Javascript&lt;/code&gt;, etc.). In addition, there is support for dedicated server-languages such as &lt;code&gt;CURL&lt;/code&gt;, &lt;code&gt;Java&lt;/code&gt;, &lt;code&gt;NodeJS&lt;/code&gt;, &lt;code&gt;PHP&lt;/code&gt;, &lt;code&gt;Python&lt;/code&gt;, &lt;code&gt;Objective-C&lt;/code&gt;, &lt;code&gt;Ruby&lt;/code&gt; and &lt;code&gt;.NET&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Tested, pre-configured and maintained&lt;/strong&gt;: The team is constantly monitoring, testing and updating the server to conform to the latest developments.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure&lt;/strong&gt;: The servers are secure and they never store any transaction data.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  How it works
&lt;/h1&gt;

&lt;h2&gt;
  
  
  0. Stripe and Mashape Setup
&lt;/h2&gt;

&lt;p&gt;We first need to define a couple of constants in our app. If you are working with Angular/Ionic &lt;code&gt;v1.x&lt;/code&gt;, head over to &lt;code&gt;app.js&lt;/code&gt; and copy and paste the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Stripe Payments API
// Obtain from:
// - https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe
var NOODLIO_PAY_API_URL         = "https://noodlio-pay.p.mashape.com";
var NOODLIO_PAY_API_KEY         = "&amp;lt;YOUR-MASHAPE-API-KEY&amp;gt;";

// Stripe Account
// Connect on both:
// - https://www.noodl.io/pay/connect and
// - https://www.noodl.io/pay/connect/test
var STRIPE_ACCOUNT_ID           = "&amp;lt;YOUR-STRIPE-ACCOUNT-ID&amp;gt;"

// Define whether you are in development mode (TEST_MODE: true) or production mode (TEST_MODE: false)
var TEST_MODE = false;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;NOODLIO_PAY_API_URL&lt;/code&gt; is basically the location of the server and is fixed. The variable &lt;code&gt;TEST_MODE&lt;/code&gt; simply takes the values &lt;code&gt;true&lt;/code&gt; or &lt;code&gt;false&lt;/code&gt; and defines whether we are in test mode (development) or production (actually charging the user). Now let's define two constants:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Mashape&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To consume the Stripe Payments API, we'll need to obtain our unique &lt;code&gt;NOODLIO_PAY_API_KEY&lt;/code&gt;. To do so, head over to &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe" rel="noopener noreferrer"&gt;Mashape&lt;/a&gt; and click on the right "Get your API Keys and Start Hacking" or press on "Sign up free".&lt;/p&gt;

&lt;p&gt;&lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe" rel="noopener noreferrer"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/http%3A%2F%2Fnoodlio-templates.firebaseapp.com%2Fnoodlio-pay%2Fimg%2Fmashape-api-keys.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After you are signed in, you'll find your unique API Key in the request example on the &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe" rel="noopener noreferrer"&gt;Stripe Payments API page&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST --include 'https://noodlio-pay.p.mashape.com/charge/token' \
  -H 'X-Mashape-Key: &amp;lt;YOUR-MASHAPE-API-KEY&amp;gt;' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Accept: application/json' \
  ... other values
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace the &lt;code&gt;NOODLIO_PAY_API_KEY&lt;/code&gt; with this unique identifier.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stripe Account&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you haven't already &lt;a href="https://www.stripe.com" rel="noopener noreferrer"&gt;sign up for a Stripe Account&lt;/a&gt;. After that, you'll need to retrieve your unique Stripe Account ID (field: &lt;code&gt;stripe_account&lt;/code&gt;), which you can obtain on the following pages (Note: you'll need to visit both links once):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For the production mode:
&lt;a href="https://www.noodl.io/pay/connect" rel="noopener noreferrer"&gt;https://www.noodl.io/pay/connect&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;For the development mode:
&lt;a href="https://www.noodl.io/pay/connect/test" rel="noopener noreferrer"&gt;https://www.noodl.io/pay/connect/test&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Stripe Account ID looks something like &lt;code&gt;acct_12abcDEF34GhIJ5K&lt;/code&gt;. Replace the constant &lt;code&gt;STRIPE_ACCOUNT_ID&lt;/code&gt; wherever you have defined it.&lt;/p&gt;

&lt;p&gt;That's it. Our server is configured and ready to receive payments.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Obtain the Stripe token (&lt;code&gt;source&lt;/code&gt;)
&lt;/h2&gt;

&lt;p&gt;Now we can head over to the fun part and start integrating the payments in our application. To do so, we'll first need to obtain the crucial parameter &lt;code&gt;source&lt;/code&gt;. This parameter can be either a token (which we will obtain in this exercise) or a customer ID (mostly used for recurring payments which we will discuss in another tutorial). As we will be charging the client's credit card, we'll therefore need to obtain the token. Note that when obtaining the token, the server also validates the credit card input of the user.&lt;/p&gt;

&lt;p&gt;There are two options to obtain a Stripe token:&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Use the Stripe Payments API (Noodlio Pay)
&lt;/h3&gt;

&lt;p&gt;This corresponds to sending a &lt;code&gt;HTTP POST&lt;/code&gt; request with the credit card input (&lt;code&gt;number&lt;/code&gt;, &lt;code&gt;cvc&lt;/code&gt;, &lt;code&gt;exp_month&lt;/code&gt; and &lt;code&gt;exp_year&lt;/code&gt;) to the route &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe#tokens-create" rel="noopener noreferrer"&gt;&lt;code&gt;/tokens/create&lt;/code&gt;&lt;/a&gt; of the &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe" rel="noopener noreferrer"&gt;Stripe Payments API (Noodlio Pay)&lt;/a&gt;. For that we'll need to implement a custom form in which your customer can add their credit card details. The form data is subsequently send to the Stripe Payments API and returns the token upon success.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add the HTML form&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's start with integrating the form with the credit card details. In Angular &lt;code&gt;v1.x&lt;/code&gt; we can do this as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div ng-controller="ExampleCtrl"&amp;gt;
  &amp;lt;!-- html form --&amp;gt;
  &amp;lt;label class="item item-input"&amp;gt;
    &amp;lt;span class="input-label"&amp;gt;Card number&amp;lt;/span&amp;gt;
    &amp;lt;input type="text" size="20" ng-model="FormData.number" placeholder="4242 4242 4242 4242"/&amp;gt;
  &amp;lt;/label&amp;gt;

  &amp;lt;label class="item item-input"&amp;gt;
    &amp;lt;span class="input-label"&amp;gt;Exp. Mth (MM)&amp;lt;/span&amp;gt;
    &amp;lt;input type="text" size="2" ng-model="FormData.exp_month"/ placeholder="01"&amp;gt;
  &amp;lt;/label&amp;gt;

  &amp;lt;label class="item item-input"&amp;gt;
    &amp;lt;span class="input-label"&amp;gt;Exp. Year (YYYY)&amp;lt;/span&amp;gt;
    &amp;lt;input type="text" size="4" ng-model="FormData.exp_year"/ placeholder="2020"&amp;gt;
  &amp;lt;/label&amp;gt;

  &amp;lt;label class="item item-input"&amp;gt;
    &amp;lt;span class="input-label"&amp;gt;Sec. Code (CVC)&amp;lt;/span&amp;gt;
    &amp;lt;input type="text" size="4" ng-model="FormData.cvc"/ placeholder="123"&amp;gt;
  &amp;lt;/label&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and a Submit button that is linked to our controller &lt;code&gt;ExampleCtrl&lt;/code&gt; through the function &lt;code&gt;charge()&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;div class="padding center"&amp;gt;
  &amp;lt;button class="button button-block button-balanced" ng-click="charge()"&amp;gt;Submit&amp;lt;/button&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Extend the &lt;code&gt;HTTP&lt;/code&gt; headers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To send the FormData to the Stripe Payments API, we'll need to make a HTTP request to the &lt;code&gt;NOODLIO_PAY_API_URL&lt;/code&gt;, which in Angular &lt;code&gt;v1.x&lt;/code&gt; can be achieved with the dependency &lt;code&gt;$http&lt;/code&gt;. We define our controller therefore as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.controller('ExampleCtrl', ['$scope', '$http', function($scope, $http) {

  // ...

}]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Note: for best practices you should do this in a factory or service&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Since it is hosted through Mashape, we'll also need to add authentication headers in our request. We can do this by using the &lt;code&gt;NOODLIO_PAY_API_KEY&lt;/code&gt; and including it in the headers of the &lt;code&gt;$http&lt;/code&gt; method. If you look at the &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe#charge-token" rel="noopener noreferrer"&gt;documentation of the route &lt;code&gt;charge/token&lt;/code&gt;&lt;/a&gt;, the first part of the cURL request looks something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST --include 'https://noodlio-pay.p.mashape.com/charge/token'
  -H 'X-Mashape-Key: 3fEagjJCGAmshMqVnwTR70bVqG3yp1lerJNjsnTzx5ODeOa99V'
  -H 'Content-Type: application/x-www-form-urlencoded'
  -H 'Accept: application/json'
  ... other variables
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From that we can see that in order to send requests to the API, we'll need to include the headers &lt;code&gt;X-Mashape-Key&lt;/code&gt;, &lt;code&gt;Content-Type&lt;/code&gt; and &lt;code&gt;Accept&lt;/code&gt;. In Angular &lt;code&gt;v1.x&lt;/code&gt; this translates to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.controller('ExampleCtrl', ['$scope', '$http', function($scope, $http) {

  // add the following headers for authentication
   $http.defaults.headers.common['X-Mashape-Key']  = NOODLIO_PAY_API_KEY;
   $http.defaults.headers.common['Content-Type']   = 'application/x-www-form-urlencoded';
   $http.defaults.headers.common['Accept']         = 'application/json';


}]);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Obtain the token&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now that our headers are configured, we can continue by implementing the function to obtain the token for our &lt;code&gt;source&lt;/code&gt; parameter. Here is the example code that we used to obtain the Stripe token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// part of ExampleCtrl

$scope.FormData = {
    number: "4242424242424242",
    cvc: "256",
    exp_month: "08",
    exp_year: "2018",
    test: TEST_MODE,
  };

$scope.charge = function() {

  // init for the DOM
  $scope.ResponseData = {
    loading: true
  };

  // create a token and validate the credit card details
  $http.post(NOODLIO_PAY_API_URL + "/tokens/create", $scope.FormData)
  .success(
    function(response){

      if(response.hasOwnProperty('id')) {
        var token = response.id; $scope.ResponseData['token'] = token;

        // --&amp;gt; success, proceed with charging the user
        proceedCharge(token);
      } else {
        $scope.ResponseData['token'] = 'Error, see console';
        $scope.ResponseData['loading'] = false;
      };

    }
  )
  .error(
    function(response){
      $scope.ResponseData['token'] = 'Error, see console';
      $scope.ResponseData['loading'] = false;
    }
  );
};

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see from this example, we're sending a &lt;code&gt;HTTP POST&lt;/code&gt; request to the url &lt;code&gt;NOODLIO_PAY_API_URL + "/tokens/create"&lt;/code&gt; with the form encoded parameters corresponding to the credit card details of the user. When the response has a property &lt;code&gt;id&lt;/code&gt;, i.e. a token (&lt;code&gt;source&lt;/code&gt;), then we continue with charging the user through the function &lt;code&gt;proceedCharge(token)&lt;/code&gt; (which we discuss below). We bind the variable &lt;code&gt;ResponseData&lt;/code&gt; to the &lt;code&gt;$scope&lt;/code&gt; to update the user through the DOM on the status of the payment (this is optional). You can see how a successful response looks like in the &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe#tokens-create" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; (on the right under RESPONSE BODY).&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Use Stripe's native Checkout form
&lt;/h3&gt;

&lt;p&gt;The Checkout form is an embeddable payment form for desktop, tablet, and mobile devices. It works within your site: customers can pay instantly, without being redirected to complete the transaction.&lt;/p&gt;

&lt;p&gt;The integration of the checkout form is to be discussed in another tutorial. If you would to integrate it yourself already, you can obtain an example source code or read guides/tutorials on how to embed the Checkout form in your application in the following languages: &lt;a href="https://github.com/noodlio/noodlio-pay-ionic-example" rel="noopener noreferrer"&gt;Ionic/Angular&lt;/a&gt;, &lt;a href="https://stripe.com/docs/checkout/sinatra" rel="noopener noreferrer"&gt;Sinatra&lt;/a&gt;, &lt;a href="https://stripe.com/docs/checkout/rails" rel="noopener noreferrer"&gt;Rails&lt;/a&gt;, &lt;a href="https://stripe.com/docs/checkout/flask" rel="noopener noreferrer"&gt;Flask&lt;/a&gt;, and &lt;a href="https://stripe.com/docs/checkout/php" rel="noopener noreferrer"&gt;PHP&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Charge the client
&lt;/h2&gt;

&lt;p&gt;Now that you have obtained the token (&lt;code&gt;source&lt;/code&gt;) from Step 1, let's proceed with charging the user. We can do so by sending another &lt;code&gt;HTTP POST&lt;/code&gt; request to another route of the Stripe Payments API: &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe#charge-token" rel="noopener noreferrer"&gt;&lt;code&gt;charge/token&lt;/code&gt;&lt;/a&gt;. As we can read from the docs, the form encode parameters are in this case &lt;code&gt;amount&lt;/code&gt;, &lt;code&gt;description&lt;/code&gt; (optional), &lt;code&gt;currency&lt;/code&gt; and &lt;code&gt;stripe_account&lt;/code&gt;. With the integration in Step 1 behind us, this is now a piece of cake and corresponds to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// part of ExampleCtrl
// includes also the header extensions at the top

// charge the customer with the token from Step 1
function proceedCharge(token) {

  var param = {
    source: token,
    amount: 100, // amount in cents
    currency: "usd",
    description: "Your custom description here",
    stripe_account: STRIPE_ACCOUNT_ID,
    test: TEST_MODE,
  };

  $http.post(NOODLIO_PAY_API_URL + "/charge/token", param)
  .success(
    function(response){

      // --&amp;gt; success
      $scope.ResponseData['loading'] = false;

      if(response.hasOwnProperty('id')) {
        // success, check your Stripe account
        var paymentId = response.id; $scope.ResponseData['paymentId'] = paymentId;
      } else {
        $scope.ResponseData['paymentId'] = 'Error, see console';
      };

    }
  )
  .error(
    function(response){
      $scope.ResponseData['paymentId'] = 'Error, see console';
      $scope.ResponseData['loading'] = false;
    }
  );
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The setup is similar and if the response has an &lt;code&gt;id&lt;/code&gt; then this corresponds to the &lt;code&gt;paymentId&lt;/code&gt; (store it in your database for your reference) which equals to a successful charge. This also means that you should have received the funds on your Stripe Account, visible in your &lt;a href="https://dashboard.stripe.com/dashboard" rel="noopener noreferrer"&gt;Dashboard&lt;/a&gt;. Don't forget to define the &lt;code&gt;amount&lt;/code&gt; in cents. The parameter &lt;code&gt;stripe_account&lt;/code&gt; thus indicates to which Stripe Account the funds should be transferred. Make sure you have included the right ID (see Step 0).&lt;br&gt;
You can see how a successful response looks like in the &lt;a href="https://market.mashape.com/noodlio/noodlio-pay-smooth-payments-with-stripe#charge-token" rel="noopener noreferrer"&gt;official documentation&lt;/a&gt; (on the right under RESPONSE BODY).&lt;/p&gt;

&lt;h1&gt;
  
  
  Wrapping up
&lt;/h1&gt;

&lt;p&gt;That's it, you have successfully integrated Stripe payments in your work. As you see, it was actually a piece of cake and the setup was quite short. Now you can focus on the more important aspects of your app and actually start making money from it.&lt;/p&gt;

&lt;p&gt;If you have question, comments or some suggestions, please let us know. We love to hear from you.&lt;/p&gt;

&lt;h1&gt;
  
  
  Templates &amp;amp; Source Code
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Ionic 1.x / Angular 1.x&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can download the complete source code from &lt;a href="https://www.noodl.io/market/product/P201604181926406/noodlio-pay-smooth-payments-with-stripe-accept-payments-without-a-server-side-setup" rel="noopener noreferrer"&gt;this repository&lt;/a&gt;. It also includes an example with Stripe Checkout. While the examples are made in AngularJS in an Ionic App, it is easy to reuse most of the code in other projects (whether native or hybrid)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ionic 2.x / Angular 2.x&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you are looking for a starter that is built with the latest version of Ionic 2.x / Angular 2.x, then have a look at &lt;a href="https://www.noodl.io/market/product/P201702241736843/stripe-with-ionic2-quickly-and-easily-integrate-stripe-in-your-ionic2-app" rel="noopener noreferrer"&gt;this great starter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Your own template&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have implemented your own template/starter/tutorial with the Stripe Payments API (Noodlio Pay) and would like to list it here, please &lt;a href="//mailto:noodlio@seipel-ibisevic.com"&gt;let the owner know&lt;/a&gt; and you can receive an award.&lt;/p&gt;

&lt;h1&gt;
  
  
  Pricing
&lt;/h1&gt;

&lt;p&gt;The use of the API hosted on Mashape is free and you can make unlimited requests. &lt;a href="https://www.noodl.io/pay/plans" rel="noopener noreferrer"&gt;&lt;strong&gt;Click here for an overview of complementary licenses&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>stripe</category>
      <category>payments</category>
      <category>creditcard</category>
      <category>noodlio</category>
    </item>
  </channel>
</rss>
