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 561f796 commit 939deb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
Binary file modified Core SDK/libPWCoreSDK.a
Binary file not shown.
4 changes: 1 addition & 3 deletions Plugins/PWCustomizationPlugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,4 @@ Usage

- `UIButton* buttonConfig`: Set custom UI property for this property to change some button to your liking, eg. backgroundColor, tintColor, titleColor, image

![](https://user-images.githubusercontent.com/23113471/27734022-42b14d5a-5dc3-11e7-92b5-7213e260810a.jpg)

![](https://user-images.githubusercontent.com/23113471/27734047-58549374-5dc3-11e7-84eb-6a92f03f6f9d.jpeg)
![customization_guide](https://user-images.githubusercontent.com/23113471/27816093-84af641a-60b3-11e7-9a8b-d2dd01a3eafc.png)
22 changes: 9 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,16 @@ Extra settings
-------------------
- Default UI of the SDK is flat style, to use game UI, add this to your code: `PWCoreSDK.sharedInstance().setUseGameUI(true)`
- If you wish to customize the flat UI to suit your app, you can get the [PWCustomizationPlugin](https://github.com/paymentwall/paymentwall-ios-sdk/tree/master/Plugins/PWCustomizationPlugin) and set it while setup the SDK.
- By default (except Brick), all payments method will return delegate for you to work with, if you want to use the SDK's success/failed dialog, add this to your code: `PWCoreSDK.sharedInstance().setUseNativeFinishDialogForAllMethods(true)`
- By default (except Brick), all payments method will show success once the payment is finish, if you don't want to use the SDK's success dialog but return delegate for you to work with, add this to your code: `PWCoreSDK.sharedInstance().setUseNativeFinishDialogForAllMethods(false)`

Brick payment flow
-------------------
1. After the token is successfully fetched, the `response: PWCoreSDKResponse` will contain the `token: BrickToken` along with it
2. Send request to your server to handle the token, if `useNativeFinishDialog` is set to `false`, you can show your own success or failed dialog after it finish, otherwise post a `Notification` to use the SDK success or failed dialog and close itself, THIS IS ONLY FOR HANDLE AFTER YOU PROCESS THE TOKEN, other error during fetching token will be handle automatically without posting notification:
2. Send request to your server to handle the token:

- If `useNativeFinishDialog` is set to `false`, the SDK will dismiss after token is successfully fetched, the `response.responseCode` will also be `.MERCHANT_PROCESSING`, you will have to handle success/failed/3D secure yourself and store card feature wont be available

- If `useNativeFinishDialog` is set to `true`, the loading popup will keep showing, after you process the token in your sever, post a `Notification` to use the SDK success or failed dialog, also the SDK will call delegate again to return `.SUCCESS` or `.FAILED`:

```swift
if response.paymentType == .BRICK {
Expand Down Expand Up @@ -197,23 +201,15 @@ Paymentwall SDK supports external payment system injection (which are in our def

1. Add the plugin with Cocoapods with `pod 'PW[Local payment method]Plugin'` or manually dragging the `PW[Local payment method]Plugin.a` and it's headers file to your project
2. Import the library header into your project or via `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 alipay = PWAlipayPlugin()
alipay.appId = "external"
alipay.appScheme = "YOUR APP SCHEME"

//For international alipay payment
alipay.itbPay = "30m"
alipay.forexBiz = "FP"
alipay.appenv = "system=ios^version=\(UIDevice.current.systemVersion)"
```
3. Setup the plugin, each plugin have different requirements, details can be found in their headers or detailed docs below.

>Note: All plugins support your own signature string if you don't specify Secret key in both CoreSDK and PluginSDK, use `plugin.getStringToSign()` to get the string to sign, then add your signed string to `plugin.signString`
List of available local payment option
------------------------------
- [Alipay](https://github.com/paymentwall/paymentwall-ios-sdk/tree/master/Plugins/PWAlipayPlugin)
- [Wechatpay](https://github.com/paymentwall/paymentwall-ios-sdk/tree/master/Plugins/PWWechatpayPlugin)
- [MyCard](https://github.com/paymentwall/paymentwall-ios-sdk/tree/master/Plugins/PWMycardPlugin)

Available extra plugin
------------------------------
Expand Down

0 comments on commit 939deb0

Please sign in to comment.