

One other important thing The main goal of this entire project is to retrieve a Stripe User ID/Stripe Account ID on successful authentication to a user’s Stripe Account. webViewDidStartLoad, webViewDidFinishLoad, webView_didFailLoadWithError and webView_shouldStartLoadWith represent the different states of the UIWebView as alluded to earlier when we defined the UIWebViewDelegate. The secret source of this app is actually contained in viewDidLoad, where the request to access your Stripe Account is made.

The instance variable declared as url represents the url of your Heroku hosted Node.js app, which you deployed in Part 1 of this tutorial. The UIWebViewDelegate (which is defined in-line with the class definition) is required in order for the class to listen-in on, and handle events as per different states of the UIWebView.
#Appcode swift 3 stripe payment code#
Modify the rest of the class as shown in the code block below. NB: you can access the repo for Part 2 of this project here>Ĭreate a Single View Application and assign it an appropriate name. With your Node.js App setup and running on Heroku, we will now go through the simple task of creating the client Swift App that will work with your Node.js backend, to authenticate to your Stripe Account - in just 15 easy steps!
#Appcode swift 3 stripe payment how to#
The ReadMe file provided will walk you through instructions of how to clone the repo, perform the necessary edits and deploy it on Heroku. Head over to this> Git repo to access the Node.js app, which has already been setup for you. We will go through each in turn by starting with the Node.js App. The tutorial is comprised of 2 components a client iOS Swift App and a backend Node.js App. This will hopefully be the first of many Swift/Stripe tutorials to come. This tutorial assumes you already have a Stripe Account setup. In this tutorial, we will go through the process of initiating authentication to a Stripe Account via a Swift App.

Stripe has especially been popular around the developer community - with its friendly API that allows developers to plug it in to their websites/apps really quickly. In the last few years, Stripe has grown to become a prominent platform in the Online Payments space.
