Latest 0.0.3
Homepage https://github.com/jeffnjut/FJPay
License MIT
Platforms ios 8.0, requires ARC
Dependencies JSONModel
Frameworks AlipaySDK, CoreMotion, CFNetwork, SystemConfiguration, CoreTelephony, QuartzCore, CoreText, CoreGraphics, UIKit, Foundation, Security
Authors

An easy way for calling pay API

Usage

Init Manager First of First

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [[FJPayMgr sharedInstance] setWechatAppScheme:@"wxaXXXXXXXX"];
    [[FJPayMgr sharedInstance] setAppScheme:@"schemeXXXXXXXX"];
}

- (BOOL)commonapplication:(UIApplication *)app openURL:(NSURL*)url options:(NSDictionary<UIApplicationOpenURLOptionsKey, id> *)options sourceApplication:(NSString *)sourceApplication annotation:(id)annotation {
    return [WXApi handleOpenURL:url delegate:[FJPayMgr sharedInstance]];
}

For Alipay

NSString *orderString = @"body=......&_input_charset="utf-8"&notify_url=......"RSA"";
[[FJPayMgr sharedInstance] setAppScheme:@"schemeXXXXXXXX"];
[[FJPayMgr sharedInstance] pay:FJPayType_Alipay weixinPayData:nil alipayOrderString:orderString completion:^(FJPayResult result) {
    NSLog(@"%ld", (long)result);
}];

For Wechat Pay

WechatpayData *paydata = [[WechatpayData alloc] init];
paydata.appid = @"wxaschemeXXXXXXXX";
paydata.partnerid = @"schemeXXXXXXXX";
paydata.package = @"Sign=WXPay";
paydata.noncestr = @"XXXXXXXX";
paydata.sign = @"XXXXXXXX";
paydata.prepayid = @"XXXXXXXX";
paydata.timestamp = 1488851934;
[[FJPayMgr sharedInstance] pay:FJPayType_Wechat weixinPayData:paydata alipayOrderString:nil completion:^(FJPayResult result) {
    NSLog(@"%ld", (long)result);
}];

Attention

if encountered ,
-canOpenURL: failed for URL: "alipay://" – error: "This app is not allowed to query for scheme alipay"
info.plist中增加SSO白名单

Contribute

Feel free to open an issue or pull request, if you need help or there is a bug.

Contact

Todo

  • Documentation

License

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

The MIT License (MIT)

Copyright (c) 2017 Jeff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Latest podspec

{
    "name": "FJPay",
    "version": "0.0.3",
    "summary": "An easy way for calling pay process",
    "homepage": "https://github.com/jeffnjut/FJPay",
    "license": "MIT",
    "authors": {
        "jeff_njut": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/jeffnjut/FJPay.git",
        "tag": "0.0.3"
    },
    "source_files": "FJPay/**/*.{h,m}",
    "resources": "FJPay/SDK/Alipay/AlipaySDK.bundle",
    "requires_arc": true,
    "pod_target_xcconfig": {
        "OTHER_LDFLAGS": [
            "-ObjC",
            "-all_load"
        ],
        "FRAMEWORK_SEARCH_PATHS": ""$(SRCROOT)/FJPay/FJPay/SDK/Alipay""
    },
    "preserve_paths": "FJPay/SDK/Alipay/**",
    "frameworks": [
        "AlipaySDK",
        "CoreMotion",
        "CFNetwork",
        "SystemConfiguration",
        "CoreTelephony",
        "QuartzCore",
        "CoreText",
        "CoreGraphics",
        "UIKit",
        "Foundation",
        "Security"
    ],
    "libraries": [
        "z",
        "c++",
        "sqlite3"
    ],
    "vendored_libraries": "FJPay/SDK/Wechat/*.a",
    "dependencies": {
        "JSONModel": []
    }
}

Pin It on Pinterest

Share This