Latest 0.1.1
Homepage https://github.com/isandboy/SYPayKit
License MIT
Platforms ios 8.0
Authors

详情介绍

CI Status
Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

SYPayKit is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "SYPayKit"

默认包含支付宝、微信、银联支付

目前支持以下几种支付方式

Alipay (支付宝)

WXPay(微信)

UnionPay(银联)

pod 'SYPayKit/Alipay'
pod 'SYPayKit/WXPay'
pod 'SYPayKit/UnionPay'

使用

目前支持的支付方式有,支付宝支付,微信支付,银联支付

SYUnionPay *alipay = [[SYUnionPay alloc] init];
NSDictionary *order = @{kMSPayOrderKey:@"201506221028315777129"};
[SYPay payment:payment withOrderInfo:nil withCompletion:^(SYPayResultStatus status, NSDictionary * _Nullable returnedInfo, NSError * _Nullable error) {
    NSLog(@"success:%dn,resultDic:%@n,error:%@", success, returnedInfo, [error localizedDescription]);
}];

参数说明:

  1. 其中payment是对应的支付方式的实例
  2. charge参数需要和后台约定成以下格式
# 支付宝支付order
{
        kSYPayOrderKey: "partner="--------------"&seller_id="-------------"&out_trade_no="-----------"&subject="areyouok"&body="nama"&total_fee="0.01"&notify_url=""&service=""&payment_type="1"&_input_charset="utf-8"&it_b_pay="30m"&sign="GsSZgPloF1vn52XAItRAldwQAbzIgkDyByCxMfTZG%2FMapRoyrNIJo4U1LUGjHp6gdBZ7U8jA1kljLPqkeGv8MZigd3kH25V0UK3Jc3C94Ngxm5S%2Fz5QsNr6wnqNY9sx%2Bw6DqNdEQnnks7PKvvU0zgsynip50lAhJmflmfHvp%2Bgk%3D"&sign_type="RSA"&appenv="system= ^version="&goods_type="0"&rn_check="F""
  }

# 微信支付order

{ kSYPayOrderKey: {
            "appid": "wx-----------",
            "partnerid": "-----------",
            "noncestr": "-----------",
            "prepayid": "wx-----------",
            "packagevalue": "Sign=WXPay",
            "timestamp": "-----------",
            "sign": "-----------"
        }
}

# 银联支付order
{kSYPayOrderKey:@"--------------------" }

更详细的情况可以参考demo里面的SYPayManager类

其他

iOS 9 以上版本如果需要使用支付宝和微信渠道,需要在 Info.plist 添加以下代码:

<key>LSApplicationQueriesSchemes</key>
<array>
    <string>weixin</string>
    <string>wechat</string>
    <string>alipay</string>
</array>

Author

isandboy, [email protected]

License

SYPayKit is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "SYPayKit",
    "version": "0.1.1",
    "summary": "u96c6u6210u5faeu4fe1u3001u94f6u8054u3001u652fu4ed8u5b9du652fu4ed8",
    "description": "1. u96c6u6210u5faeu4fe1u3001u94f6u8054u3001u652fu4ed8u5b9du4e09u79cdu652fu4ed8u65b9u5f0fn2. u5bf9u5916u62bdu8c61u7edfu4e00u63a5u53e3n3. u652fu6301OCuff0cSwiftu9879u76eeuff0cu53efu4ee5u6253u5305u6210u52a8u6001u5e93",
    "homepage": "https://github.com/isandboy/SYPayKit",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "isandboy": "[email protected]"
    },
    "source": {
        "git": "https://github.com/isandboy/SYPayKit.git",
        "tag": "0.1.1"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source_files": "SYPayKit/SYPayKit.h",
    "subspecs": [
        {
            "name": "Core",
            "source_files": "SYPayKit/Core/*.{h,m,c,swift}",
            "frameworks": [
                "CFNetwork",
                "SystemConfiguration"
            ]
        },
        {
            "name": "Alipay",
            "source_files": "SYPayKit/Channels/Alipay/*.{h,m}",
            "dependencies": {
                "SYPayKit/Core": [],
                "SYAlipaySDK": []
            }
        },
        {
            "name": "WXPay",
            "source_files": "SYPayKit/Channels/WxPay/**/*.{h,m}",
            "dependencies": {
                "SYPayKit/Core": [],
                "SYWechatOpenSDK": []
            }
        },
        {
            "name": "UnionPay",
            "source_files": "SYPayKit/Channels/UnionPay/**/*.{h,m}",
            "dependencies": {
                "SYPayKit/Core": [],
                "SYUPPaySDK": []
            }
        }
    ]
}

Pin It on Pinterest

Share This