Following the previously developed SDK for the Windows Universal App (
which we already talked about in Habré ) and node.js, in May we developed and published an SDK for iOS. About what applications on iOS can accept payments through a third-party payment service, why it is needed and how to integrate the payment service into a mobile application, read under the cat. And also - delicious fresh statistics on the share of mobile users in PayOnline payment traffic for the last 3 years. Only for residents HabraHabr!
Before proceeding to a detailed review of the Payment SDK for iOS and discuss the specifics of the requirements for the App Store, we want to share with you the statistics of PayOnline mobile payments for the last three years.
')
The explosion of mobile traffic in 2013 - 2015
When in the early 2010s we launched a product for receiving payments from mobile devices and from mobile applications
Pay-Mobile , we didn’t even know what wild growth mobile traffic will show in the next few years.
Today, the story of the beginning of the era of mobile commerce rushes from each iron, but to get adequate, accurate, and most importantly, statistical data localized in Russia is obtained with difficulty. By entering into Google the query “the share of iOS in Russia”, we get a lot of approximate figures based on world statistics and device sales figures according to reports of the largest retail chains.
Fortunately, we process tens of thousands of payments every day and have access to real indicators of how Russians pay on the Internet. Today we will show you the data from 2013 to 2015, for which the read percent of payments from mobile devices turned into one fifth of our payment traffic.
In 2013, mobile traffic grew more than 2 times faster than desktop, and in 2014 - more than 6 times. And, apparently, in the coming years this movement will not stop. The diagram below shows mobile traffic indicators for the last 3 years, divided by key mobile operating systems.
Note that these numbers are distributed to the devices from which payments were successfully made through PayOnline. Net commercial traffic without admixture of Internet surfers and users of free applications :)
Go to Payment SDK PayOnline for iOS
The Payment SDK for iOS applications allows developers to easily and seamlessly integrate accepting bank card payments into a mobile application. Why the developer of the Payment SDK application can be found in the material that we published on the blog
at the beginning of the year .
What is most important? The main thing is that by integrating payment acceptance using the iOS SDK, you will avoid WebView. All elements of the payment process are embedded in the mobile application and customized for its design.
Explaining in a nutshell: the SDK allows you to avoid diving into the depths of integration with the payment gateway, implementing the 3-D Secure security protocol and other non-targeted time and effort expenditures. But before moving on to issues of integration, it is necessary to understand the difficult rules of Apple in relation to third-party payment services in applications.
What applications can accept payments in iOS applications other than through the App Store?
The question of whether it is possible at all to accept payments in iOS applications has been worrying the minds of developers and owners for more than a year, causing many discussions.
To understand this question, we turned to the original source - “App Store Review Guidelines”, chapter 11 “Purchasing and currencies”.
Read the sourcePurchasing and currencies
11.1 Apps that unlock or enable the app Store will be rejected
11.2 IAP Acquisition Purchase (API) IAP to Acquire Content
11.3 Apps using IAP to purchase will be rejected
11.4 Apps that use IAP to purchase currencies within the App
11.5 Apps that use IAP to purchase currencies that expire will be rejected
11.6 Content Subcategories IAP
11.7 Apps for IAP to purchase items
11.8 Apps for use with iOS, such as the camera or the gyroscope, will be rejected
11.9 Apply for a specific approved meeting (eg, films, television, music, books)
11.10 Insurance IAPs
11.11 In general, you will review it
11.12 Apps: IAP, Apple IAP;
11.13 Apps, such as a "buy" button, will be rejected
11.14 App (app) or the app. purchase the approved content. Apple will only receive a portion of the app.
11.15 Apps may use auto-renewal subscriptions for business and business apps (video, audio, voice, voice), and apps.
11.16 Apps may be used in combination with specific approved physical hardware (such as a toy), so that there is no need for additional features and functionality telescope) or also available through the App without any physical products, such as IAP
App. 17.17.
If you do not go into the literal translation, the essence of the requirements of Apple is as follows: all goods and services of the virtual and digital plan must be paid through the App Store. Otherwise, the application will be deleted.
Thus, our Payment SDK will not be able to be used by owners of gaming, entertainment applications, digital content sellers, etc. The issue of virtual goods is borderline, but more often it is also decided in favor of accepting payments through the App Store. For example, the online store of digital books Liters accepts payments in the Android application through PayOnline, but on iOS - through the App Store.
Another thing, if you made a mobile application for your online store, travel agency or ticket office. The result of the transaction between you and your customer is a physical product or physical document confirming the right to use the service. In this case, you can safely integrate payment acceptance through a third-party payment service and quickly receive funds to your bank account without losing time and money on the bad App Store commission.
How does the PayOnline Payment SDK for iOS work?
To connect the SDK, you need to add the libPayOnlineSdk.a library to the project and the PayOnlineSdk folder containing header files (you can download the library
here ).
To make a payment you need:
1. Create a PayOnlineConfiguration configuration object.
Code example:
PayOnlineConfiguration *payOnlineConfiguration = [PayOnlineConfiguration configurationWithMerchantId:12345 privateKey: @"12-34-5"];
2. Implement PayOnlineDelegate protocol methods.
Code example:
@implementation ViewController ... #pragma mark - PayOnlineDelegate methods (void)payOnlineSuccess:(PayOnlinePayResponse *)response { // } (void)payOnlineDeclined:(PayOnlinePayResponse *)response { // } // 3DS (void)payOnlineThreeDsRequired:(PayOnlinePayResponse *)response { // UIWebView *webView = [[UIWebView alloc] initWithFrame:self.view.bounds]; [self.view addSubview:webView]; // - [self.processing navigateToAcsUrl:response delegate:self webView:webView]; } (void)payOnlineError:(PayOnlineError *)error { // } @end
3. Create payment object PayOnlinePayRequest.
Code example:
PayOnlinePayRequest *payRequest = [[PayOnlinePayRequest alloc] init]; payRequest.email = @"test@payonline.com"; payRequest.cardNumber = @"4444333322221111"; payRequest.ip = @"127.0.0.1"; payRequest.cardExpMonth = 1; payRequest.cardExpYear = 2015; payRequest.cardHolderName = @"NAME SURNAME"; payRequest.cardCvv = 123; payRequest.amount = [NSDecimalNumber decimalNumberWithString:@"120.00"]; payRequest.currency = PayOnlineCurrencyRub; payRequest.orderId = @"order12345";
4. Create a PayOnlineProcessing object based on the runtime configuration and call the pay method.
Code example:
PayOnlineProcessing *processing = [PayOnlineProcessing processingWithConfig:payOnlineConfiguration]; [processing pay:payRequest delegate:payOnlineDelegate];
5. The work of the pay method will end with a call to one of the payOnlineDelegate methods.
Example of implementation - Ural Airlines mobile app for iOS
One of the first customers of our company to use the SDK to integrate a payment service into a mobile application for iOS was Ural Airlines.
If you want to see how the process of booking and paying for an in-app purchase occurs, click here.It all starts with the entry of flight parameters:
In the search results, select the appropriate flight:
Confirm the number of passengers and cost:
Enter the passenger data:
And data of the payer. PayOnline will send a payment receipt to the entered email address immediately after the payment is completed:
After that, the ticket is booked so that at the moment when you make the payment, no one bought your ticket directly “in front of you” (which can be especially offensive if the ticket was last):
And finally, payment. As you can see, the design of the payment form is no different from the design of the rest of the mobile application screens. And the conciseness of the form allows to minimize the proportion of failures at the payment stage:
The payment processing screen also corresponds to the overall design of the application:
We did not make the payment completion screen, because at that time Ekaterinburg nobody was going to fly :)
But monitoring data daily report successful payments through the app.
What besides technical integration?
Entity
Only a legal entity or an individual entrepreneur can enter into a contract with PayOnline.
Site
The easiest way to connect accept payments in a mobile application, if you already have an online store or another commercial site. During the connection of accepting payments through the processing center (or through a bank directly) you will be given a so-called “terminal” - your site identifier. Directly with the mobile applications, the vast majority of banks in Russia do not work. They are connected after the site and issue an additional terminal to the application.
Therefore, if you do not have a website, for a painless and easy connection to accept payments in applications, you will need to make a simple business card site that meets the minimum requirements.
Commission rate
The commission rate is determined individually depending on the turnover of payments in the application and the level of risk with your business segment. The logic is clear: higher turnover - lower rate, higher risks - higher rate.
Payouts
Funds are transferred to your bank account on the 2nd or 6th day (depending on the selected base payment product).
That's all that we wanted to tell today about the Payment SDK for iOS and the specifics of setting payment acceptance in mobile apps on iOS. We are pleased to answer your questions in the comments!