Skip to content

Commit

Permalink
Version 3.0b2: Target SDK iOS 11, deployment target iOS 8
Browse files Browse the repository at this point in the history
* Drop support for audio connection to first generation PIN+ devices.
  This implies that the `YTLibResources.bundle` has been removed.
* Add CocoaPods support, see SumUpSDK.podspec
* Added module map for Swift integration without bridging headers
  • Loading branch information
mollidor committed Nov 3, 2017
1 parent 3fcbb21 commit 000c5e2
Show file tree
Hide file tree
Showing 38 changed files with 62 additions and 43 deletions.
15 changes: 10 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,36 @@
# SumUp iOS SDK Changelog

## Version 3.0b1
## Version 3.0b2

* Updated target SDK to iOS 11, deployment target raised to iOS 8.0
* Drop support for audio connection to first generation PIN+ devices.
This implies that the `YTLibResources.bundle` has been removed.

* Added module map for Swift integration without bridging headers

Sample application:

* Update deployment target of Obj-C app to iOS 8
* AVFoundation is linked as required as weak linking was only needed
when running on iOS 5
* Swift sample app uses modular imports instead of bridging headers


## Transition Guide to 3.0

When improving imported Swift names we took the opportunity to rename
and prefix some classes and enums. We've also renamed the SDK to
SumUpSDK to make it easier to integrate with CocoaPods.
Migrating your code base is easy.

* Remove the `SumupSDK.embeddedframework` and add the new
one called `SumUpSDK.embeddedframework`.
one called `SumUpSDK.embeddedframework`. Make sure your target still links
against the framework and still copies the resource bundle.
* Rename your imports `<SumupSDK/SumupSDK.h>` to `<SumUpSDK/SumUpSDK.h>`
* If your project uses modules, you can use `@import SumUpSDK;` in Objective-C
* Swift projects should always use `import SumUpSDK` instead global bridging header imports
* Rename all occurrences of `SumUpCompletionBlock` to `SMPCompletionBlock`
* In Obj-C: rename all case-sensitive occurrences of
`SumupSDK` to `SMPSumUpSDK`
* In ObjC: rename all case-sensitive occurrences of
`SumupSDK` to `SMPSumUpSDK` (except for imports, see above)
* In Swift: rename all case-sensitive occurrences of
`SumupSDK` and `SMPSumupSDK` to `SumUpSDK`

Expand Down
67 changes: 41 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# SumUp mPOS SDK - iOS

[![Platform](https://img.shields.io/badge/Platform-iOS-lightgrey.svg?style=flat-square)](#prerequisites)
[![Created](https://img.shields.io/badge/Made%20by-SumUp-blue.svg?style=flat-square)]()
[![Created](https://img.shields.io/badge/Made%20by-SumUp-blue.svg?style=flat-square)](https://sumup.com)
[![Supports](https://img.shields.io/badge/Requires-iOS%208+-red.svg?style=flat-square)]()
[![Version](https://img.shields.io/badge/Version-3.0b1-yellowgreen.svg?style=flat-square)](CHANGELOG.md)
[![Version](https://img.shields.io/badge/Version-3.0b2-yellowgreen.svg?style=flat-square)](CHANGELOG.md)
[![License](https://img.shields.io/badge/License-SumUp-brightgreen.svg?style=flat-square)](LICENSE)

[![CocoaPods](https://img.shields.io/cocoapods/v/SumUpSDK.svg?style=flat-square)]()

This repository provides a native iOS SDK that enables you to integrate SumUp's proprietary
card terminal(s) and its payment platform to accept credit and debit card payments
(incl. VISA, MasterCard, American Express and more). SumUp's SDK communicates transparently
to the card terminal(s) via Bluetooth (BLE 4.0) or an audio cable connection. Upon initiating
a checkout, the SDK guides your user using appropriate screens through each step of the payment
process. As part of the process, SumUp provides also the card terminal setup screen, along with the
process. As part of the process, SumUp also provides the card terminal setup screen, along with the
cardholder signature verification screen. The checkout result is returned with the relevant
data for your records.

Expand All @@ -33,24 +33,27 @@ For more information, please refer to SumUp's

### Table of Contents
* [Installation](#installation)
* [Preparing your Xcode project](#preparing-your-xcode-project)
* [Supported device orientation](#supported-device-orientation)
* [Privacy Info plist keys](#privacy-info-plist-keys)
* [Manual Integration](#manual-integration)
* [Integration via CocoaPods](#integration-via-cocoapods)
* [Supported device orientation](#supported-device-orientation)
* [Privacy Info plist keys](#privacy-info-plist-keys)
* [Getting started](#getting-started)
* [Import the SDK](#import-the-sdk)
* [Authenticate app](#authenticate-app)
* [Login](#login)
* [Accept card payments](#accept-card-payments)
* [Update checkout preferences](#update-checkout-preferences)
* [Out of Scope](#out-of-scope)
* [Community](#community)
* [Changelog](#changelog)
* [License](#license)

## Installation

### Preparing your Xcode project
### Manual Integration

The SumUp SDK is provided as an embedded framework `SumUpSDK.embeddedframework`
that combines a static library, its headers and bundles containing resources such as
that combines a static library, its headers, and bundles containing resources such as
images and localizations. Please follow the steps below to prepare your project:

1. Add the `SumUpSDK.embeddedframework` to your Xcode project.
Expand All @@ -70,21 +73,33 @@ images and localizations. Please follow the steps below to prepare your project:


> Note:
> You can use the [sample app](https://github.com/sumup/sumup-ios-sdk/tree/master/SampleApp/SumUpSDKSampleApp)
> You can use the [sample app](SampleApp/SumUpSDKSampleApp)
> that is provided with the SumUp SDK as a reference project.
> The Xcode project contains sample apps written in Objective-C and Swift.
> In your debug setup you can also call `+[SMPSumUpSDK testSDKIntegration]`.
> It will run various checks and print its findings to the console.
> It will run various checks and print its findings to the console.
> Please do not call it in your Release build.
### Integration via CocoaPods

The SumUp SDK can be integrated via CocoaPods. Regardless if you use dynamic
frameworks (`use_frameworks!`), SumUp will always be added to your app as a
staticly linked library.

```ruby
target '<Your Target Name>' do
pod 'SumUpSDK'
end
```

To learn more about setting up your project for CocoaPods, please refer to the [official documentation](https://cocoapods.org/#install).

### Supported device orientation
The SDK supports all device orientations on iPad and portrait on iPhone.
Feel free to support other orientations on iPhone but please keep in mind that
the SDK's UI will be presented in portrait on iPhone.
See `UISupportedInterfaceOrientations` in the sample app's
[Info.plist](SampleApp/SumUpSDKSampleApp/SumUpSDKSampleApp-Info.plist#L56-L67)
[Info.plist](SampleApp/SumUpSDKSampleApp/SumUpSDKSampleApp-Info.plist#L54-L65)
or the "General" tab in Xcode's Target Editor.

### Privacy Info plist keys
Expand All @@ -104,19 +119,23 @@ for more information regarding the listed permissions required.
[InfoPlist.strings](SampleApp/SumUpSDKSampleApp/en.lproj/InfoPlist.strings) file.
> - For further information, see the iOS Developer Library on
[location usage on iOS 8 and later](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW26),
[Bluetooth peripheral usage](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW20)
[Bluetooth peripheral usage](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW20),
and [microphone access in iOS 7 and later](https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW25).


## Getting started

### Import the SDK

To import the SDK in Objective-C source files, you can use `#import <SumUpSDK/SumUpSDK.h>`. If module
support is enabled in your project, you can use `@import SumUpSDK;` instead.

In Swift, use `import SumUpSDK`. You do not have to add any headers to your bridging header.

### Authenticate app
Before calling any additional feature of the SumUp SDK, you are required to set up the SDK with your Affiliate (Access) Key:
```objc
#import <SumUpSDK/SumUpSDK.h>

// ...

[SumUpSDK setupWithAPIKey:@"MyAPIKey"];
[SMPSumUpSDK setupWithAPIKey:@"MyAPIKey"];
```
> Note:
Expand All @@ -143,14 +162,10 @@ Once logged in, you can start using the SumUp SDK to accept card payments.
#### Prepare checkout request
Prepare a checkout request that encapsulates the information regarding the transaction.

For this, you will need to create an instance `SMPCheckoutRequest`:
For this, you will need to create an instance of `SMPCheckoutRequest`:


```objc
#import <SumUpSDK/SumUpSDK.h>

// ...

SMPCheckoutRequest *request = [SMPCheckoutRequest requestWithTotal:[NSDecimalNumber decimalNumberWithString:@"10.00"]
title:@"your title"
currencyCode:[[SMPSumUpSDK currentMerchant] currencyCode]
Expand All @@ -165,7 +180,7 @@ convenience method of `NSNumber` to create an `NSDecimalNumber`.
When setting up the `SMPCheckoutRequest` object, the following optional parameters can be included:
##### Tip amount
An tip amount can be processed in addition to the `totalAmount` using the `tipAmount` parameter.
A tip amount can be processed in addition to the `totalAmount` using the `tipAmount` parameter.
The tip amount will then be shown during the checkout process and be included in the response.
Please note that a tip amount cannot be changed during/after the checkout.
Just like the `totalAmount` it is an `NSDecimalNumber` so make sure to
Expand All @@ -188,9 +203,9 @@ To skip the screen shown at the end of a successful transaction, the
`SMPSkipScreenOptionSuccess` option can be used.
When setting this option your application is responsible for displaying
the transaction result to the customer.
In combination with the Receipts API your application can also send your own receipts,
In combination with the Receipts API, your application can also send your own receipts,
see [API documentation](http://docs.sumup.com/rest-api/transactions-api/) for details.
Please note success screens will still be shown when using the SumUp Air Lite readers.
Please note that success screens will still be shown when using the SumUp Air Lite readers.
#### Initiate Checkout Request
Start a payment by using the checkout request below:
Expand Down
4 changes: 0 additions & 4 deletions SampleApp/SumUpSDKSampleApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

/* Begin PBXFileReference section */
1B584F181DE60F7100642029 /* SumUpSDKSampleAppSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SumUpSDKSampleAppSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
1B584F2A1DE60F9D00642029 /* SumUpSDKSampleAppSwift-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "SumUpSDKSampleAppSwift-Bridging-Header.h"; path = "SrcSwift/SumUpSDKSampleAppSwift-Bridging-Header.h"; sourceTree = "<group>"; };
1B584F301DE60FEE00642029 /* SUSAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUSAppDelegate.h; path = SrcObjC/SUSAppDelegate.h; sourceTree = "<group>"; };
1B584F311DE60FEE00642029 /* SUSAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = SUSAppDelegate.m; path = SrcObjC/SUSAppDelegate.m; sourceTree = "<group>"; };
1B584F321DE60FEE00642029 /* SUSViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUSViewController.h; path = SrcObjC/SUSViewController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -118,7 +117,6 @@
isa = PBXGroup;
children = (
1B584F471DE6146000642029 /* Main-Swift.storyboard */,
1B584F2A1DE60F9D00642029 /* SumUpSDKSampleAppSwift-Bridging-Header.h */,
);
name = "Supporting Files";
sourceTree = "<group>";
Expand Down Expand Up @@ -371,7 +369,6 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SUS_STORYBOARD_NAME = "Main-Swift";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "SumUpSDKSampleApp/SrcSwift/SumUpSDKSampleAppSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -404,7 +401,6 @@
PRODUCT_BUNDLE_IDENTIFIER = "com.sumup.sample-swift";
PRODUCT_NAME = "$(TARGET_NAME)";
SUS_STORYBOARD_NAME = "Main-Swift";
SWIFT_OBJC_BRIDGING_HEADER = "SumUpSDKSampleApp/SrcSwift/SumUpSDKSampleAppSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 4.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
1 change: 1 addition & 0 deletions SampleApp/SumUpSDKSampleApp/SrcSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import SumUpSDK

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions SampleApp/SumUpSDKSampleApp/SrcSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//

import UIKit
import SumUpSDK

class ViewController: UIViewController {
private var appearCompleted = false
Expand Down
1 change: 1 addition & 0 deletions SumUpSDK.embeddedframework/SumUpSDK.framework/Modules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
framework module SumUpSDK {
umbrella header "SumUpSDK.h"
export *
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified SumUpSDK.embeddedframework/SumUpSDK.framework/Versions/A/SumUpSDK
Binary file not shown.
7 changes: 4 additions & 3 deletions SumUpSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Pod::Spec.new do |s|

s.name = "SumUpSDK"
s.version = "3.0b1"
s.version = "3.0b2"
s.summary = "This SDK enables you to integrate SumUp's proprietary card terminal(s) and its payment platform to accept credit and debit card payments."

s.description = <<-DESC
This SDK enables you to integrate SumUp's proprietary card terminal(s) and its payment platform to accept credit and debit card payments (incl. VISA, MasterCard, American Express and more). SumUp's SDK communicates transparently to the card terminal(s) via Bluetooth (BLE 4.0) or an audio cable connection. Upon initiating a checkout, the SDK guides your user using appropriate screens through each step of the payment process. As part of the process, SumUp provides also the card terminal setup screen, along with the cardholder signature verification screen. The checkout result is returned with the relevant data for your records.
This SDK enables you to integrate SumUp's proprietary card terminal(s) and its payment platform to accept credit and debit card payments (incl. VISA, MasterCard, American Express and more). SumUp's SDK communicates transparently to the card terminal(s) via Bluetooth (BLE 4.0) or an audio cable connection. Upon initiating a checkout, the SDK guides your user using appropriate screens through each step of the payment process. As part of the process, SumUp also provides the card terminal setup screen, along with the cardholder signature verification screen. The checkout result is returned with the relevant data for your records.
DESC

s.homepage = "https://sumup.com/"
s.homepage = "https://github.com/sumup/sumup-ios-sdk"
s.social_media_url = "https://twitter.com/SumUp"
s.license = { :file => "LICENSE", :type => "Proprietary" }
s.author = { "SumUp" => "[email protected]" }
Expand All @@ -26,6 +26,7 @@ Pod::Spec.new do |s|
s.resources = [
"SumUpSDK.embeddedframework/Resources/SMPSharedResources.bundle"
]
s.module_map = "SumUpSDK.embeddedframework/SumUpSDK.framework/Modules/module.modulemap"

s.frameworks = "Accelerate", "AVFoundation", "MapKit"
s.user_target_xcconfig = { "OTHER_LDFLAGS" => "-ObjC" }
Expand Down

0 comments on commit 000c5e2

Please sign in to comment.