Skip to content

Commit

Permalink
Merge pull request #3 from realexpayments-developers/master
Browse files Browse the repository at this point in the history
Updated HPP URL for TLS 1.2, license and Podfile for Cocoapods v1+
  • Loading branch information
RealexITSO authored Jan 26, 2017
2 parents 8623200 + 18fb13d commit b3b5237
Show file tree
Hide file tree
Showing 15 changed files with 227 additions and 273 deletions.
6 changes: 2 additions & 4 deletions Example/Podfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
source 'https://github.com/CocoaPods/Specs.git'
use_frameworks!

target 'RXPiOS_Example', :exclusive => true do
target 'RXPiOS_Example' do
pod "RXPiOS", :path => "../"
end

target 'RXPiOS_Tests', :exclusive => true do
target 'RXPiOS_Tests' do
pod "RXPiOS", :path => "../"


end
14 changes: 0 additions & 14 deletions Example/Podfile.lock

This file was deleted.

4 changes: 2 additions & 2 deletions Example/Pods/Local Podspecs/RXPiOS.podspec.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 0 additions & 14 deletions Example/Pods/Manifest.lock

This file was deleted.

4 changes: 0 additions & 4 deletions Example/RXPiOS/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
// AppDelegate.swift
// RXPiOS
//
// Created by Damian Sullivan on 12/16/2015.
// Copyright (c) 2015 Realex Payments. All rights reserved.
//

import UIKit

Expand Down Expand Up @@ -43,4 +40,3 @@ class AppDelegate: UIResponder, UIApplicationDelegate {


}

2 changes: 1 addition & 1 deletion Example/RXPiOS/Base.lproj/LaunchScreen.xib
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<rect key="frame" x="0.0" y="0.0" width="480" height="480"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright (c) 2015 CocoaPods. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Demonstration App Only. See License file. " textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="8ie-xW-0ye">
<rect key="frame" x="20" y="439" width="441" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
Expand Down
32 changes: 14 additions & 18 deletions Example/RXPiOS/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,61 +2,57 @@
// ViewController.swift
// RXPiOS
//
// Created by Damian Sullivan on 12/16/2015.
// Copyright (c) 2015 Realex Payments All rights reserved.
//

import UIKit
import RXPiOS

class ViewController: UIViewController, HPPManagerDelegate {

override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}

override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}


@IBAction func payButtonAction(sender: AnyObject) {

let hppManager = HPPManager()

hppManager.HPPRequestProducerURL = NSURL(string: "https://myserver.com/hppRequestProducer")
hppManager.HPPURL = NSURL(string: "https://hpp.realexpayments.com/pay")
hppManager.HPPURL = NSURL(string: "https://pay.sandbox.realexpayments.com/pay")
hppManager.HPPResponseConsumerURL = NSURL(string: "https://myserver.com/hppResponseConsumer")

hppManager.merchantId = "realexsandbox"
hppManager.account = "internet"
hppManager.amount = "100"
hppManager.currency = "EUR"

hppManager.delegate = self
hppManager.presentViewInViewController(self)
}


//MARK: - HPPManagerDelegate

func HPPManagerCompletedWithResult(result: Dictionary <String, String>) {
// success
print(NSString(format: "%@", result) as String)
}

func HPPManagerFailedWithError(error: NSError?) {
// error
if let hppError = error {
print(hppError.localizedDescription)
}
}

func HPPManagerCancelled() {
// cancelled
print("Cancelled by user.")
}
}

4 changes: 2 additions & 2 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 Pay and Shop Ltd t/a Realex Payments
Copyright (c) 2017 Pay and Shop Ltd t/a Realex Payments

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
THE SOFTWARE.
12 changes: 5 additions & 7 deletions Pod/Classes/RealexComponent/Dictionary+URLDictionary.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,16 @@
// Dictionary+URLDictionary.swift
// rxp-ios
//
// Copyright (c) 2015 Realex Payments. All rights reserved.
//

import Foundation

extension Dictionary {

/**
Build string representation of HTTP parameter dictionary of keys and objects

This percent escapes in compliance with RFC 3986

- returns: The string representation in the form of key1=value1&key2=value2 where the keys and values are percent escaped
*/
func stringFromHttpParameters() -> String {
Expand All @@ -24,5 +22,5 @@ extension Dictionary {
}
return parameterArray.joinWithSeparator("&")
}
}

}
Loading

0 comments on commit b3b5237

Please sign in to comment.