Skip to content

Commit

Permalink
Add Payments demonstration and other improvements...
Browse files Browse the repository at this point in the history
- add PaymentVC - for gathering payment information and enacting
- add ReceiverVC - for choosing a recipient

- upgrade endpoints used to get accounts, cater for different data in returned results
- encode bank ids and other params
- move transaction loading
- show account balance in account items
- (slightly) safer methods for extracting values from JSON (but still bad - essentially untyped)
  • Loading branch information
t0rst committed Jul 26, 2018
1 parent f44739c commit 47c917a
Show file tree
Hide file tree
Showing 16 changed files with 1,643 additions and 171 deletions.
18 changes: 18 additions & 0 deletions HelloOBP-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,18 @@
744B412D199E91C300EBDA6D /* DetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 744B412C199E91C300EBDA6D /* DetailsViewController.m */; };
744B412F199F76A500EBDA6D /* Logo_Text_small.png in Resources */ = {isa = PBXBuildFile; fileRef = 744B412E199F76A500EBDA6D /* Logo_Text_small.png */; };
746A94A519A2871000C935BC /* AboutViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 746A94A419A2871000C935BC /* AboutViewController.m */; };
AE30DF251F83FC1C00ADBC22 /* ReceiverVC.m in Sources */ = {isa = PBXBuildFile; fileRef = AE30DF241F83FC1C00ADBC22 /* ReceiverVC.m */; };
AE87F3811C5673F700D09FBC /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AE87F3801C5673F700D09FBC /* Main.storyboard */; };
AE87F3831C567C1B00D09FBC /* Launch Screen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = AE87F3821C567C1B00D09FBC /* Launch Screen.storyboard */; };
AE8FBEA61F82D317000D4913 /* FooterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = AE8FBEA51F82D317000D4913 /* FooterVC.m */; };
AE8FBEA91F82E2F0000D4913 /* PaymentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = AE8FBEA81F82E2F0000D4913 /* PaymentVC.m */; };
AE901D9A1EEEE8BF00AEE0DD /* OBP_full_stack_web.png in Resources */ = {isa = PBXBuildFile; fileRef = AE901D991EEEE8BF00AEE0DD /* OBP_full_stack_web.png */; };
AEBAD2DC1C8EE66D00165DB0 /* OAuthCore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AEBAD1FC1C8EE34C00165DB0 /* OAuthCore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AEBAD2DE1C8EE66D00165DB0 /* OBPKit.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AEBAD1FE1C8EE34C00165DB0 /* OBPKit.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AEBAD2E01C8EE66D00165DB0 /* STHTTPRequest.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AEBAD2001C8EE34D00165DB0 /* STHTTPRequest.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AEBAD2E21C8EE66D00165DB0 /* UICKeyChainStore.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AEBAD2021C8EE34D00165DB0 /* UICKeyChainStore.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
AEC08DED1C57DBE5002E2AA7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AEC08DEC1C57DBE5002E2AA7 /* Security.framework */; };
AECBB0241F939E89004D0EEF /* JSONUnpackUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = AECBB0231F939E89004D0EEF /* JSONUnpackUtils.m */; };
AEFCD84E1CD8E352000113DB /* TransactionDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AEFCD84D1CD8E352000113DB /* TransactionDetailViewController.m */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -80,13 +83,17 @@
AE28203C1CC1396600BC0AAC /* LICENSE.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = LICENSE.txt; sourceTree = "<group>"; };
AE28203D1CC1396600BC0AAC /* Podfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Podfile; sourceTree = "<group>"; };
AE28203E1CC1396600BC0AAC /* README.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = "<group>"; };
AE30DF231F83FC1C00ADBC22 /* ReceiverVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReceiverVC.h; sourceTree = "<group>"; };
AE30DF241F83FC1C00ADBC22 /* ReceiverVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ReceiverVC.m; sourceTree = "<group>"; };
AE3B29501CB5913C0012E56E /* Debug(dynamic).xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug(dynamic).xcconfig"; sourceTree = "<group>"; };
AE3B29511CB5913C0012E56E /* Release(dynamic).xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release(dynamic).xcconfig"; sourceTree = "<group>"; };
AE3B29521CB5913C0012E56E /* Common.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Common.xcconfig; sourceTree = "<group>"; };
AE87F3801C5673F700D09FBC /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = Main.storyboard; sourceTree = "<group>"; };
AE87F3821C567C1B00D09FBC /* Launch Screen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = "Launch Screen.storyboard"; sourceTree = "<group>"; };
AE8FBEA41F82D317000D4913 /* FooterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FooterVC.h; sourceTree = "<group>"; };
AE8FBEA51F82D317000D4913 /* FooterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FooterVC.m; sourceTree = "<group>"; };
AE8FBEA71F82E2F0000D4913 /* PaymentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaymentVC.h; sourceTree = "<group>"; };
AE8FBEA81F82E2F0000D4913 /* PaymentVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PaymentVC.m; sourceTree = "<group>"; };
AE901D991EEEE8BF00AEE0DD /* OBP_full_stack_web.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = OBP_full_stack_web.png; sourceTree = "<group>"; };
AE982B231CB78EB40020D935 /* Debug(carthage).xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Debug(carthage).xcconfig"; sourceTree = "<group>"; };
AE982B241CB78EB50020D935 /* Release(carthage).xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Release(carthage).xcconfig"; sourceTree = "<group>"; };
Expand All @@ -98,6 +105,8 @@
AEBAD2021C8EE34D00165DB0 /* UICKeyChainStore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = UICKeyChainStore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
AEC08DEC1C57DBE5002E2AA7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
AEC15E581C57FC3200E5FA59 /* DefaultServerDetails.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DefaultServerDetails.h; sourceTree = "<group>"; };
AECBB0221F939E89004D0EEF /* JSONUnpackUtils.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONUnpackUtils.h; sourceTree = "<group>"; };
AECBB0231F939E89004D0EEF /* JSONUnpackUtils.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = JSONUnpackUtils.m; sourceTree = "<group>"; };
AEFCD84C1CD8E352000113DB /* TransactionDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TransactionDetailViewController.h; sourceTree = "<group>"; };
AEFCD84D1CD8E352000113DB /* TransactionDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TransactionDetailViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand Down Expand Up @@ -215,6 +224,8 @@
7414C8F71923B78200084BC3 /* AppDelegate.h */,
7414C8F81923B78200084BC3 /* AppDelegate.m */,
AEC15E581C57FC3200E5FA59 /* DefaultServerDetails.h */,
AECBB0221F939E89004D0EEF /* JSONUnpackUtils.h */,
AECBB0231F939E89004D0EEF /* JSONUnpackUtils.m */,
);
path = Main;
sourceTree = "<group>";
Expand All @@ -234,6 +245,10 @@
744B412C199E91C300EBDA6D /* DetailsViewController.m */,
AEFCD84C1CD8E352000113DB /* TransactionDetailViewController.h */,
AEFCD84D1CD8E352000113DB /* TransactionDetailViewController.m */,
AE8FBEA71F82E2F0000D4913 /* PaymentVC.h */,
AE8FBEA81F82E2F0000D4913 /* PaymentVC.m */,
AE30DF231F83FC1C00ADBC22 /* ReceiverVC.h */,
AE30DF241F83FC1C00ADBC22 /* ReceiverVC.m */,
AE8FBEA41F82D317000D4913 /* FooterVC.h */,
AE8FBEA51F82D317000D4913 /* FooterVC.m */,
);
Expand Down Expand Up @@ -358,15 +373,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AECBB0241F939E89004D0EEF /* JSONUnpackUtils.m in Sources */,
744B412D199E91C300EBDA6D /* DetailsViewController.m in Sources */,
7414C8F91923B78200084BC3 /* AppDelegate.m in Sources */,
7414C8F51923B78200084BC3 /* main.m in Sources */,
AEFCD84E1CD8E352000113DB /* TransactionDetailViewController.m in Sources */,
7414C9601923C13400084BC3 /* MainViewController.m in Sources */,
AE30DF251F83FC1C00ADBC22 /* ReceiverVC.m in Sources */,
AE8FBEA61F82D317000D4913 /* FooterVC.m in Sources */,
7414C95F1923C13400084BC3 /* LoginViewController.m in Sources */,
746A94A519A2871000C935BC /* AboutViewController.m in Sources */,
740692EB19A0EF7C0036CB61 /* AccountsViewController.m in Sources */,
AE8FBEA91F82E2F0000D4913 /* PaymentVC.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
14 changes: 14 additions & 0 deletions HelloOBP-iOS/Main/JSONUnpackUtils.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// JSONUnpackUtils.h
// HelloOBP-iOS
//
// Created by Torsten Louland on 15/10/2017.
// Copyright © 2017 TESOBE. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSDictionary (JSONUnpack)
- (NSString*)salientStringAtKeyPath:(NSString*)keyPath; // non-empty, and not null
- (NSString*)salientDescriptionAtKeyPath:(NSString*)keyPath; // non-empty description of non-null
@end
34 changes: 34 additions & 0 deletions HelloOBP-iOS/Main/JSONUnpackUtils.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// JSONUnpackUtils.m
// HelloOBP-iOS
//
// Created by Torsten Louland on 15/10/2017.
// Copyright © 2017 TESOBE. All rights reserved.
//

#import "JSONUnpackUtils.h"



@implementation NSDictionary (JSONUnpack)
- (NSString*)salientStringAtKeyPath:(NSString*)keyPath
{
NSString* s = [self valueForKeyPath: keyPath];
if ([s isKindOfClass: [NSString class]])
if ([s length])
if (![@[ @"null", @"NULL" ] containsObject: s])
return s;
return nil;
}
- (NSString*)salientDescriptionAtKeyPath:(NSString*)keyPath
{
id obj = [self valueForKeyPath: keyPath];
if ([obj isKindOfClass: [NSNull class]])
return nil;
NSString* s = [obj description];
if ([s length])
if (![@[ @"null", @"NULL" ] containsObject: s])
return s;
return nil;
}
@end
7 changes: 4 additions & 3 deletions HelloOBP-iOS/Res/Launch Screen.storyboard
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12120" systemVersion="16F73" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12088"/>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
Expand All @@ -22,7 +23,7 @@
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2016 TESOBE. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Copyright © 2014-2018 TESOBE. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="20" y="626.5" width="335" height="20.5"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
Expand Down
Loading

0 comments on commit 47c917a

Please sign in to comment.