-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Duy Thien Van
committed
Nov 3, 2016
1 parent
f92bf4c
commit e7a573e
Showing
197 changed files
with
7,770 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
############################################################################### | ||
# Set default behavior to automatically normalize line endings. | ||
############################################################################### | ||
* text=auto | ||
|
||
############################################################################### | ||
# Set default behavior for command prompt diff. | ||
# | ||
# This is need for earlier builds of msysgit that does not have it on by | ||
# default for csharp files. | ||
# Note: This is only used by command line | ||
############################################################################### | ||
#*.cs diff=csharp | ||
|
||
############################################################################### | ||
# Set the merge driver for project and solution files | ||
# | ||
# Merging from the command prompt will add diff markers to the files if there | ||
# are conflicts (Merging from VS is not affected by the settings below, in VS | ||
# the diff markers are never inserted). Diff markers may cause the following | ||
# file extensions to fail to load in VS. An alternative would be to treat | ||
# these files as binary and thus will always conflict and require user | ||
# intervention with every merge. To do so, just uncomment the entries below | ||
############################################################################### | ||
#*.sln merge=binary | ||
#*.csproj merge=binary | ||
#*.vbproj merge=binary | ||
#*.vcxproj merge=binary | ||
#*.vcproj merge=binary | ||
#*.dbproj merge=binary | ||
#*.fsproj merge=binary | ||
#*.lsproj merge=binary | ||
#*.wixproj merge=binary | ||
#*.modelproj merge=binary | ||
#*.sqlproj merge=binary | ||
#*.wwaproj merge=binary | ||
|
||
############################################################################### | ||
# behavior for image files | ||
# | ||
# image files are treated as binary by default. | ||
############################################################################### | ||
#*.jpg binary | ||
#*.png binary | ||
#*.gif binary | ||
|
||
############################################################################### | ||
# diff behavior for common document formats | ||
# | ||
# Convert binary document formats to text before diffing them. This feature | ||
# is only available from the command line. Turn it on by uncommenting the | ||
# entries below. | ||
############################################################################### | ||
#*.doc diff=astextplain | ||
#*.DOC diff=astextplain | ||
#*.docx diff=astextplain | ||
#*.DOCX diff=astextplain | ||
#*.dot diff=astextplain | ||
#*.DOT diff=astextplain | ||
#*.pdf diff=astextplain | ||
#*.PDF diff=astextplain | ||
#*.rtf diff=astextplain | ||
#*.RTF diff=astextplain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# CocoaPods | ||
Pods/Pods.xcodeproj/xcuserdata/* | ||
|
||
# IDE Specific files | ||
.idea/ | ||
.DS_Store | ||
*.pbxuser | ||
!default.pbxuser | ||
xcuserdata | ||
#removed because of TPA issues | ||
#*.xcworkspace | ||
#!default.xcworkspace | ||
|
||
|
||
bin/ | ||
obj/ | ||
packages/ | ||
*.suo | ||
*.user | ||
*.sln.ide/ | ||
!*.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
MobilePay AppSwitch license terms | ||
|
||
Version 3, November 2016 | ||
|
||
1.Definitions | ||
�Code� means the software (SDK) provided to the Customer by MobilePay under these terms for MobilePay AppSwitch. | ||
SDK (Software Development Kit) is a collection of software used for developing applications for a specific device or operating system. | ||
|
||
2.Granting of license | ||
MobilePay grants the Customer a non-exclusive, time-limited, non-transferrable right to copy, modify, merge and use the code and documentation in those countries in which the Customer has been given permission to use AppSwitch. The code may be used only for the Customer�s own internal business purposes. The license is granted until the expiry or termination of the terms according to which the Customer has been given permission to use the code, or these terms, howsoever caused. The aforesaid is subject to the Customer meeting the standards and specifications set out in these terms or any other terms agreed between MobilePay and the Customer regarding the use of the code. | ||
|
||
3.Versioning | ||
The SDK is versioned according to the following setup: {MAJOR}.{MINOR}.{PATCH}. Major and minor version changes cover new functionality and determine whether or not support is provided. Patch changes in a version are small upgrades that do not affect the Customer�s right to support. | ||
|
||
Generally, support is provided up to three versions back from the most recently released version of the SDK, however, support will always be provided at least for one year for all released versions of the SDK. | ||
|
||
Example: Version 1.8.0 has just been released � available versions are 1.5.0, 1.6.4, 1.7.1, and 1.8.0. This means that version 1.5.0 is no longer supported, and all users of this version must therefore upgrade to at least version 1.6.0 in order to be entitled to support. If a 1.8.1 version is released, no upgrade is necessary since only a patch has been released which does not count towards the three latest versions. | ||
|
||
MobilePay retains the right, however, to announce the expiry of support for certain versions. In such case, the announcement of expiry will be made at least one year in advance. If the Customer wants to continue to be entitled to support, then an upgrade to a newer version may be necessary after such announcement has been made. | ||
|
||
If a security issue or breach is discovered, a patch is released. In this situation, an upgrade to the latest version is enforced, and customers must upgrade within an agreed timeframe. This means that all versions prior to the security fix will be nullified and unsupported. | ||
|
||
|
||
4.Disclaimer of warranty | ||
The code is provided �AS IS� WITHOUT WARRANTY OF ANY KIND, either express or implied, including without limitation any warranties or condition of title, merchantability, fitness for a particular purpose and non-infringement. The Customer is responsible solely for determining the appropriateness of using or redistributing the code and assumes any risks associated with the Customer�s exercise of permissions under the license. | ||
|
||
5.Limitation of liability | ||
In no event will MobilePay or its contributors be liable for any direct, indirect, incidental, special, exemplary or consequential damages (including, but not limited to, procurement of substitute goods or services, loss of use, data or profits; or business interruption) however caused, whether in contract, strict liability or tort arising in any way out of the use of this code. | ||
|
||
6.Open Source software | ||
The SDK may include source code which is licensed under an open source license agreement (�MIT License�). Use of the Open Source Software is subject those terms and conditions. The Licensee accepts to be bound by and comply with all such terms and conditions. MobilePay disclaims any liability for any third party claims, including, but not limited to, any infringement claims, relating to the Customer�s use of the Open Source Software. | ||
|
||
7.Assignment | ||
The Customer may not assign its rights and obligations under these terms in any way without MobilePay's prior written consent. | ||
|
||
8.Termination | ||
Upon expiry or termination of use of AppSwitch and according to these terms, howsoever caused, MobilePay disables the merchant ID provided by MobilePay to the Customer for the use of this code, and the Customer can no longer use the code provided under these terms. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,55 @@ | ||
# MobilePay-AppSwitch-SDK | ||
# MobilePay AppSwitch SDK | ||
The MobilePay SDK enables your app to receive payments through the MobilePay app. | ||
![][1] | ||
|
||
**How it works** | ||
1 - You initiate the payment from your own app through the SDK. | ||
|
||
2 - It automatically switches to the MobilePay App where the user is asked to sign in. | ||
|
||
3 - The user confirms the payment. | ||
|
||
4 - The receipt is shown and the user can either tap "videre" or wait one second. A counter is showing the time remaining. | ||
|
||
5 - MobilePay switches back to your own app together with a MobilePay transactionId. | ||
|
||
## Latest SDK Version | ||
|Platform|Version| | ||
|:--------|:---| | ||
|Android| 1.8.0| | ||
|iOS| 1.8.0| | ||
|WP| 1.8.0| | ||
|
||
## Support | ||
For technical questions about the MobilePay AppSwitch SDK or other related questions, please contact MobilePay at **+45 70 114 115** or [[email protected]](mailto://[email protected]) | ||
|
||
## Requirements | ||
Please look at the MobilePay Developer Site for further details [MobilePay Developer site](https://www.danskebank.dk/da-dk/mobilepay/Pages/Developer.aspx) | ||
|
||
[1]: https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/blob/master/doc/wiki/images/mobilepay_appswitch_purchase_flow.png "MobilePay AppSwitch purchase flow" | ||
|
||
## MerchantID for test purposes | ||
The MerchantID for testing depends on which country you are targeting. The following IDs can be used: | ||
|
||
**APPDK0000000000** - Denmark | ||
|
||
**APPNO0000000000** - Norway | ||
|
||
**APPFI0000000000** - Finland | ||
|
||
When the test MerchantID is used you are able to complete the payment flow without transferring any money. | ||
|
||
## Cross-platform | ||
Please look at the wiki page for further details [wiki site](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Cross-platform) | ||
|
||
## Documentation | ||
* [Getting Started on iPhone](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Getting-Started-on-iPhone) | ||
* [Getting started on Android](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Getting-started-on-Android) | ||
* [Getting Started on Windows Phone](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Getting-Started-on-Windows-Phone) | ||
* [Error Handling](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Error-handling) | ||
* [Parameter Specification](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Parameter-Specification) | ||
* [Security](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Security) | ||
* [Supported OS versions](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Supported-OS-versions) | ||
* [Known Errors](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Known-errors) | ||
* [Cross-platform](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Cross-platform) | ||
* [Payment Types](https://github.com/MobilePayDev/MobilePay-AppSwitch-SDK/wiki/Payment-Types) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
// | ||
// MobilePayManager.h | ||
// | ||
// Created by Troels Richter on 3/20/14. | ||
// Copyright (c) 2014 Trifork A/S All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface MobilePayManager : NSObject | ||
|
||
+ (MobilePayManager *) sharedInstance; | ||
|
||
/** | ||
* merchantId: merchant id delivered from DanskeBank MobilePay through your MobilePay business agreement | ||
* urlscheme: urlscheme for your app setup under UrlIdentifier in your info.plist (this needs to be done to enable app switching in general) | ||
*/ | ||
-(void) setupWithMerchantId:(NSString *)merchantId merchantUrlScheme:(NSString *)merchantUrlScheme; | ||
|
||
/** | ||
* merchantId: merchant id delivered from DanskeBank MobilePay through your MobilePay business agreement | ||
* urlscheme: urlscheme for your app setup under UrlIdentifier in your info.plist (this needs to be done to enable app switching in general) | ||
* timeoutseconds: seconds that you allow the user to spend in the MobilePay app before returning to the merchant app, if exceeded when you try to swipe in Mobile Pay errorcode 8 is returned | ||
* returnseconds: seconds spend on the MobilePay receipt screen before returning to the merchant app | ||
*/ | ||
-(void) setupWithMerchantId:(NSString *)merchantId merchantUrlScheme:(NSString *)merchantUrlScheme timeoutSeconds:(int)timeoutSeconds returnSeconds:(int)returnSeconds; | ||
|
||
/** | ||
* will start the MobilePay payment flow by swithing to the mobile pay app | ||
* orderId: is never saved in MobilePay but only sent through the purchase flow so that you are able to track the purchase and deliver the right product. | ||
* productPrice: price of the product | ||
* productImage: image of the product (only supported if you have a special deal with MobilePay) | ||
* receiptMessage: message shown at the bottom of the MobilePay receipt | ||
* An error will occur if mobile pay isn't installed | ||
*/ | ||
-(void) beginMobilePaymentWithOrderId:(NSString *)orderId productName:(NSString *)productName productPrice:(float)productPrice productImage:(UIImage *)productImage receiptMessage:(NSString *)receiptMessage error:(void (^)(NSError *error))errorBlock; | ||
|
||
/** | ||
* handleMobilePayCallbacksWithUrl should be called from AppDelegate method: | ||
* -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { | ||
* errorCodes: | ||
* 1 = Invalid parameters sent to mobile pay | ||
* 2 = Validate merchant request failed | ||
* 3 = MobilePay app is out of date and should be updated | ||
* 4 = Merchant is not valid | ||
* 5 = Hmac parameter is not valid | ||
* 6 = MobilePay timeout, the purchase took more than 5 minutes | ||
* 7 = MobilePay amount limits exceeded. Open MobilePay 'Beløbsgrænser' to see your status. | ||
* 8 = Timeout set in merchant app exceeded | ||
* 9 = Invalid signature | ||
*/ | ||
-(void) handleMobilePayCallbacksWithUrl:(NSURL *)url success:(void (^)(NSString *orderId, NSString *transactionId))successBlock error:(void (^)(NSString *orderId, int errorCode, NSString *errorMessage))errorBlock cancel:(void (^)(NSString *orderId))cancelBlock; | ||
|
||
/** | ||
* merchant id delivered from DanskeBank MobilePay through your MobilePay business agreement | ||
*/ | ||
@property (nonatomic) NSString *merchantId; | ||
|
||
/** | ||
* seconds that you allow the user to spend in the MobilePay app before returning to the merchant app, if exceeded errorcode 8 is returned | ||
*/ | ||
@property (nonatomic) int timeoutSeconds; | ||
|
||
/** | ||
* seconds spend on the MobilePay receipt screen before returning to the merchant app | ||
*/ | ||
@property (nonatomic) int returnSeconds; | ||
|
||
/** | ||
* checks if mobilepay:// url can be opened | ||
*/ | ||
@property (nonatomic, readonly) BOOL isMobilePayInstalled; | ||
|
||
@property (nonatomic, readonly) NSString *mobilePayAppStoreLinkDK; | ||
|
||
/** | ||
* isAppSwitchInProgress = YES after calling beginMobilePaymentWithOrderId and set to NO after calling handleMobilePayCallbacksWithUrl | ||
*/ | ||
@property (nonatomic, readonly) BOOL isAppSwitchInProgress; | ||
|
||
/** | ||
* if testMode is enabled then MobilePayManager will switch to url scheme 'mobilepay-test' instead of 'mobilepay' | ||
* this is only possible if you has access to test builds of MobilePay | ||
*/ | ||
@property (nonatomic) BOOL testModeEnabled; | ||
|
||
/** | ||
* if signature validation is enabled then MobilePayManager will validate the result signature from MobilePay. Default is true. | ||
*/ | ||
@property (nonatomic) BOOL signatureValidationEnabled; | ||
|
||
@end |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// | ||
// MobilePayManager.h | ||
// | ||
// Created by Troels Richter on 3/20/14. | ||
// Copyright (c) 2014 Trifork A/S All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@interface MobilePayManager : NSObject | ||
|
||
+ (MobilePayManager *) sharedInstance; | ||
|
||
/** | ||
* merchantId: merchant id delivered from DanskeBank MobilePay through your MobilePay business agreement | ||
* urlscheme: urlscheme for your app setup under UrlIdentifier in your info.plist (this needs to be done to enable app switching in general) | ||
*/ | ||
-(void) setupWithMerchantId:(NSString *)merchantId merchantUrlScheme:(NSString *)merchantUrlScheme; | ||
|
||
/** | ||
* merchantId: merchant id delivered from DanskeBank MobilePay through your MobilePay business agreement | ||
* urlscheme: urlscheme for your app setup under UrlIdentifier in your info.plist (this needs to be done to enable app switching in general) | ||
* timeoutseconds: seconds that you allow the user to spend in the MobilePay app before returning to the merchant app, if exceeded when you try to swipe in Mobile Pay errorcode 8 is returned | ||
* returnseconds: seconds spend on the MobilePay receipt screen before returning to the merchant app | ||
*/ | ||
-(void) setupWithMerchantId:(NSString *)merchantId merchantUrlScheme:(NSString *)merchantUrlScheme timeoutSeconds:(int)timeoutSeconds returnSeconds:(int)returnSeconds; | ||
|
||
/** | ||
* will start the MobilePay payment flow by swithing to the MobilePay app | ||
* orderId: Text with a max length of 50 characters. Sent through the purchase flow and returned to your app when the payment is completed so that you are able to deliver the right product. | ||
* productPrice: price of the product | ||
* receiptMessage: Text with a max length of 66 characters. the message is shown at the bottom of the MobilePay receipt | ||
* An error will occur if mobile pay isn't installed | ||
*/ | ||
-(void) beginMobilePaymentWithOrderId:(NSString *)orderId productPrice:(float)productPrice receiptMessage:(NSString *)receiptMessage error:(void (^)(NSError *error))errorBlock; | ||
|
||
/** | ||
* will start the MobilePay payment flow by swithing to the MobilePay app | ||
* orderId: Text with a max length of 50 characters. Sent through the purchase flow and returned to your app when the payment is completed so that you are able to deliver the right product. | ||
* productName: obsolete | ||
* productPrice: price of the product | ||
* productImage: image of the product (only supported for a few merchants with a special agreement with MobilePay) | ||
* receiptMessage: Text with a max length of 66 characters. the message is shown at the bottom of the MobilePay receipt | ||
* An error will occur if mobile pay isn't installed | ||
*/ | ||
-(void) beginMobilePaymentWithOrderId:(NSString *)orderId productName:(NSString *)productName productPrice:(float)productPrice productImage:(UIImage *)productImage receiptMessage:(NSString *)receiptMessage error:(void (^)(NSError *error))errorBlock; | ||
|
||
/** | ||
* handleMobilePayCallbacksWithUrl should be called from AppDelegate method: | ||
* -(BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation { | ||
* success: | ||
* orderId: the SDK has validated that the orderId is the same as the one sent to MobilePay | ||
* transactionId: MobilePay transactionId that can be found in the MobilePay activity list | ||
* signature: this is the payment signature that the SDK validates against to ensure the payment authenticity | ||
* error: | ||
* errorCodes: | ||
* 1 = Invalid parameters sent to mobile pay | ||
* 2 = Validate merchant request failed | ||
* 3 = MobilePay app is out of date and should be updated | ||
* 4 = Merchant is not valid | ||
* 5 = Hmac parameter is not valid | ||
* 6 = MobilePay timeout, the purchase took more than 5 minutes | ||
* 7 = MobilePay amount limits exceeded. Open MobilePay 'Beløbsgrænser' to see your status. | ||
* 8 = Timeout set in merchant app exceeded | ||
* 9 = Invalid signature | ||
*/ | ||
-(void) handleMobilePayCallbacksWithUrl:(NSURL *)url success:(void (^)(NSString *orderId, NSString *transactionId, NSString *signature))successBlock error:(void (^)(NSString *orderId, int errorCode, NSString *errorMessage))errorBlock cancel:(void (^)(NSString *orderId))cancelBlock; | ||
|
||
/** | ||
* merchant id delivered from DanskeBank MobilePay through your MobilePay business agreement | ||
*/ | ||
@property (nonatomic) NSString *merchantId; | ||
|
||
/** | ||
* seconds that you allow the user to spend in the MobilePay app before returning to the merchant app, if exceeded errorcode 8 is returned | ||
*/ | ||
@property (nonatomic) int timeoutSeconds; | ||
|
||
/** | ||
* seconds spend on the MobilePay receipt screen before returning to the merchant app | ||
*/ | ||
@property (nonatomic) int returnSeconds; | ||
|
||
/** | ||
* checks if mobilepay:// url can be opened | ||
*/ | ||
@property (nonatomic, readonly) BOOL isMobilePayInstalled; | ||
|
||
@property (nonatomic, readonly) NSString *mobilePayAppStoreLinkDK; | ||
|
||
/** | ||
* isAppSwitchInProgress = YES after calling beginMobilePaymentWithOrderId and set to NO after calling handleMobilePayCallbacksWithUrl | ||
*/ | ||
@property (nonatomic, readonly) BOOL isAppSwitchInProgress; | ||
|
||
/** | ||
* for internal development purpose only | ||
*/ | ||
-(void)setCertificate:(NSString *)certificate; | ||
/** | ||
* for internal development purpose only | ||
*/ | ||
-(void)setMobilePayUrlScheme:(NSString *)mobilePayUrlScheme; | ||
|
||
@end |
Binary file not shown.
Oops, something went wrong.