Skip to content

Commit

Permalink
Update CoreSDK
Browse files Browse the repository at this point in the history
  • Loading branch information
tien.vu committed Jul 4, 2017
1 parent 939deb0 commit b09f6cd
Show file tree
Hide file tree
Showing 14 changed files with 88 additions and 16 deletions.
Binary file modified Core SDK/libPWCoreSDK.a
Binary file not shown.
7 changes: 4 additions & 3 deletions PWAlipayPlugin.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

Pod::Spec.new do |s|
s.name = "PWAlipayPlugin"
s.version = "1.2.1"
s.version = "2.0.0"
s.summary = "PWAlipayPlugin"
s.description = "Plugin for Alipay payment option for PWCoreSDK"
s.homepage = "http://paymentwall.com"
s.author = { "tien.vu" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = '8.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.requires_arc = true

s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'PWAlipayPlugin-v'+String(s.version) }
s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'v'+String(s.version) }
s.source_files = "Plugins/PWAlipayPlugin", "Plugins/PWAlipayPlugin/Headers/*.{h,m}"
s.resources = "Plugins/PWAlipayPlugin/PWAlipayPlugin.bundle"

Expand All @@ -19,7 +20,7 @@ Pod::Spec.new do |s|
s.libraries = 'PWCoreSDK'
s.frameworks = 'AlipaySDK'

s.dependency 'PWCoreSDK', '~> 1.2.0'
s.dependency 'PWCoreSDK', '~> 2.0.0'

s.subspec 'Alipay' do |sp|
sp.vendored_frameworks = "Plugins/PWAlipayPlugin/AlipaySDK.framework"
Expand Down
9 changes: 5 additions & 4 deletions PWCardScannerPlugin.podspec
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@

Pod::Spec.new do |s|
s.name = "PWCardScannerPlugin"
s.version = "1.0.1"
s.version = "2.0.0"
s.summary = "PWCardScannerPlugin"
s.description = "Plugin for Alipay payment option for PWCoreSDK"
s.description = "Plugin to support credit card scanner for PWCoreSDK"
s.homepage = "http://paymentwall.com"
s.author = { "tien.vu" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = '8.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.requires_arc = true

s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'PWCardScannerPlugin-v'+String(s.version) }
s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'v'+String(s.version) }
s.source_files = "Plugins/PWCardScannerPlugin", "Plugins/PWCardScannerPlugin/**/*.{h,m}"

s.vendored_libraries = "Plugins/PWCardScannerPlugin/libPWCardScannerPlugin.a"

s.dependency 'PWCoreSDK'
s.dependency 'PWCoreSDK', '~> 2.0.0'
s.dependency 'CardIO'

s.libraries = 'PWCoreSDK', 'CardIO', 'opencv_core', 'opencv_imgproc'
Expand Down
5 changes: 3 additions & 2 deletions PWCoreSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

Pod::Spec.new do |s|
s.name = "PWCoreSDK"
s.version = "1.2.1"
s.version = "2.0.0"
s.summary = "PWCoreSDK"
s.description = "Unified SDK for all paymentwall products on iOS"
s.homepage = "http://paymentwall.com"
s.author = { "tien.vu" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = '8.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.requires_arc = true

s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'PWCoreSDK-v'+String(s.version) }
s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'v'+String(s.version) }
s.source_files = "Core SDK/**/PWCoreSDK.h"
s.resources = "Core SDK/*.bundle", "Core SDK/PWCoreSDKResource.bundle", "Core SDK/PWCoreSDKResourceFlat.bundle"
s.vendored_libraries = "Core SDK/libPWCoreSDK.a"
Expand Down
9 changes: 5 additions & 4 deletions PWCustomizationPlugin.podspec
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@

Pod::Spec.new do |s|
s.name = "PWCustomizationPlugin"
s.version = "1.0.0"
s.version = "2.0.0"
s.summary = "PWCustomizationPlugin"
s.description = "Plugin for customize PWCoreSDK's flat UI"
s.description = "Plugin to customize PWCoreSDK's flat UI"
s.homepage = "http://paymentwall.com"
s.author = { "tien.vu" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = '8.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.requires_arc = true

s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'PWCustomizationPlugin-v'+String(s.version) }
s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'v'+String(s.version) }
s.source_files = "Plugins/PWCustomizationPlugin", "Plugins/PWCustomizationPlugin/**/*.{h,m}"

s.vendored_libraries = "Plugins/PWCustomizationPlugin/libPWCustomizationPlugin.a"

s.dependency 'PWCoreSDK', '~> 1.2.0'
s.dependency 'PWCoreSDK', '~> 2.0.0'
end
7 changes: 4 additions & 3 deletions PWWechatpayPlugin.podspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

Pod::Spec.new do |s|
s.name = "PWWechatpayPlugin"
s.version = "1.0.0"
s.version = "2.0.0"
s.summary = "PWWechatpayPlugin"
s.description = "Plugin for Wechatpay payment option for PWCoreSDK"
s.homepage = "http://paymentwall.com"
s.author = { "tien.vu" => "[email protected]" }
s.platform = :ios
s.ios.deployment_target = '8.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE' }
s.requires_arc = true

s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'PWWechatpayPlugin-v'+String(s.version) }
s.source = { :git => "https://github.com/paymentwall/paymentwall-ios-sdk-master.git", :tag => 'v'+String(s.version) }

s.source_files = "Plugins/PWWechatpayPlugin", "Plugins/PWWechatpayPlugin/Headers/*.{h,m}"
s.resources = "Plugins/PWWechatpayPlugin/PWWechatpayPluginResource.bundle"
Expand All @@ -19,7 +20,7 @@ Pod::Spec.new do |s|

s.libraries = 'PWCoreSDK' , 'WeChatSDK'

s.dependency 'PWCoreSDK', '~> 1.2.1'
s.dependency 'PWCoreSDK', '~> 2.0.0'

s.subspec 'Wechatpay' do |sp|
sp.vendored_libraries = "Plugins/PWWechatpayPlugin/Wechatpay/libWeChatSDK.a"
Expand Down
23 changes: 23 additions & 0 deletions Plugins/PWMycardPlugin/Headers/PWMyCardPlugin.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// PWMyCardPlugin.h
// PWMyCardPlugin
//
// Created by Tien Nhat Vu on 6/6/17.
// Copyright © 2017 Paymentwall. All rights reserved.
//

#import <Foundation/Foundation.h>

extern NSString * _Nonnull const MYCARD_SIGNATURE_GENERATED;

@interface PWMyCardPlugin : NSObject

///Optional
@property (nonatomic, strong) NSString* _Nullable pwProjectKey; //If nil, use default key from PWCoreSDK
@property (nonatomic, strong) NSString* _Nullable pwSecretKey; //If nil, use default key from PWCoreSDK, if both nil, assign `signString` property below before showing payment dialog

-(NSString * _Nullable)getStringToSign; //Call after you assign all required value AND setup PaymentObject in order to get string to sign. If you use this feature, you have to keep this class instance pointer to assign new signString everytime after new payment object is set
@property (nonatomic, strong) NSString* _Nonnull signString; //Use this property only if you want to calculate sign by your app or server

@end

Binary file not shown.
Binary file not shown.
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.
44 changes: 44 additions & 0 deletions Plugins/PWMycardPlugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Paymentwall Mycard plugin
------------------------------
Paymentwall SDK supports external payment system injection (which are in our defined payment system (PS) list). Each time you want to add a new payment system, you have to include it's native SDK into your project along with our plugin framework, our framework will handle creating all the necessary parameters then you can use them to show the native local payment SDK:

1. Add the plugin with Cocoapods with `pod 'PWMycardPlugin'` or manually dragging the `libPWMycardPlugin.a` and it's headers file to your project
2. Import the library header into your project in `bridging-headers.h` if you use Swift
3. Setup the plugin, each plugin have different requirements so please check their header files and local payment option docs on their websites for more information:
```swift
let mycard = PWMycardPlugin()

//Optional
mycard.pwProjectKey = "YOUR PROJECT KEY"
mycard.pwSecretKey = "YOUR SECRET KEY"
```
4. If secret key is not set in both PWCoreSDK and this plugin, you have to generate and provide `signString` for the Plugin:
```swift
//Get string to sign - call this after set all required values in step 3. and set PaymentObject in PWCoreSDK
let strToSign = mycard.getStringToSign()

//Append your secret key to the end and calculate, then set to `signString`, have to do it again with new PaymentObject
mycard.signString = calculateSign(with: strToSign)
```
5. Add to CoreSDK:
```swift
PWCoreSDK.sharedInstance().addCustomPaymentOptions([mycard])
```
6. This plugin required signing again after user enter MyCard information, this step will be required if you did step 4., the string to sign will be return to you by the delegate with responseCode `MERCHANT_PROCESSING`:
```swift
switch response.responseCode {
case .MERCHANT_PROCESSING:
if response.paymentType == .OTHERS {
for (key,val) in response.others! {
if key == "MyCard" {
let signString = sha256(text: "\(val)YOUR_SECRET_KEY")!
//If success
NotificationCenter.default.post(name: Notification.Name(MYCARD_SIGNATURE_GENERATED), object: nil, userInfo: ["signString": signString])
//If failed
//NotificationCenter.default.post(name: Notification.Name(MYCARD_SIGNATURE_GENERATED), object: nil, userInfo: ["error": "some error"])
}
}
}
}
```
>Note: `key` will be the display name of the payment option, `val` will be the string to sign, after sign it with your app or server, post the notification named `MYCARD_SIGNATURE_GENERATED` with the signed string in Dictionary with key = "signString", or error message in Dictionary with key = "error"
Binary file added Plugins/PWMycardPlugin/libPWMyCardPlugin.a
Binary file not shown.

0 comments on commit b09f6cd

Please sign in to comment.