Commit 661d3d02 by lee

add alipay

parent d537ab62
# OS X
.DS_Store
# Xcode
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
*.xccheckout
profile
*.moved-aside
DerivedData
*.hmap
*.ipa
# Bundler
.bundle
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts
Carthage/Build
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#
# Note: if you ignore the Pods directory, make sure to uncomment
# `pod install` in .travis.yml
#
# Pods/
# references:
# * http://www.objc.io/issue-6/travis-ci.html
# * https://github.com/supermarin/xcpretty#usage
osx_image: xcode7.3
language: objective-c
# cache: cocoapods
# podfile: Example/Podfile
# before_install:
# - gem install cocoapods # Since Travis is not always on latest version
# - pod install --project-directory=Example
script:
- set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/AliPay.xcworkspace -scheme AliPay-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty
- pod lib lint
#
# Be sure to run `pod lib lint AliPaySDK.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#
Pod::Spec.new do |s|
s.name = 'AliPay'
s.version = '0.1.0'
s.summary = 'A short description of AliPay.'
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.description = <<-DESC
TODO: Add long description of the pod here.
DESC
s.homepage = 'https://github.com/lee/AliPaySDK'
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { 'lee' => '627051222@qq.com' }
s.source = { :git => 'https://github.com/sanchew/AliPaySDK.git', :tag => s.version.to_s }
s.ios.deployment_target = '8.0'
s.requires_arc = true
s.vendored_frameworks = 'AlipaySDK.framework'
s.source_files = 'AlipaySDK.framework/**/*.h'
s.public_header_files = 'AlipaySDK.framework/**/*.h'
s.resource = 'AlipaySDK.bundle'
s.frameworks = 'SystemConfiguration', 'CoreTelephony', 'QuartzCore', 'CoreText', 'CoreGraphics', 'UIKit', 'Foundation', 'CFNetwork', 'CoreMotion'
s.libraries = 'c++', 'z'
end
//
// APAuthInfo.h
// AliSDKDemo
//
// Created by 方彬 on 14-7-18.
// Copyright (c) 2014年 Alipay.com. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface APayAuthInfo : NSObject
@property(nonatomic, copy)NSString *appID;
@property(nonatomic, copy)NSString *pid;
@property(nonatomic, copy)NSString *redirectUri;
/**
* 初始化AuthInfo
*
* @param appIDStr 应用ID
* @param productIDStr 产品码 该商户在aboss签约的产品,用户获取pid获取的参数
* @param pidStr 商户ID 可不填
* @param uriStr 授权的应用回调地址 比如:alidemo://auth
*
* @return authinfo实例
*/
- (id)initWithAppID:(NSString *)appIDStr
pid:(NSString *)pidStr
redirectUri:(NSString *)uriStr;
- (NSString *)description;
- (NSString *)wapDescription;
@end
//
// AlipaySDK.h
// AlipaySDK
//
// Created by 方彬 on 14-4-28.
// Copyright (c) 2014年 Alipay. All rights reserved.
//
////////////////////////////////////////////////////////
////////////////version:2.1 motify:2014.12.24//////////
///////////////////Merry Christmas=。=//////////////////
////////////////////////////////////////////////////////
#import "APayAuthInfo.h"
typedef enum {
ALIPAY_TIDFACTOR_IMEI,
ALIPAY_TIDFACTOR_IMSI,
ALIPAY_TIDFACTOR_TID,
ALIPAY_TIDFACTOR_CLIENTKEY,
ALIPAY_TIDFACTOR_VIMEI,
ALIPAY_TIDFACTOR_VIMSI,
ALIPAY_TIDFACTOR_CLIENTID,
ALIPAY_TIDFACTOR_APDID,
ALIPAY_TIDFACTOR_MAX
} AlipayTidFactor;
typedef void(^CompletionBlock)(NSDictionary *resultDic);
@interface AlipaySDK : NSObject
/**
* 创建支付单例服务
*
* @return 返回单例对象
*/
+ (AlipaySDK *)defaultService;
/**
* 用于设置SDK使用的window,如果没有自行创建window无需设置此接口
*/
@property (nonatomic, weak) UIWindow *targetWindow;
/**
* 支付接口
*
* @param orderStr 订单信息
* @param schemeStr 调用支付的app注册在info.plist中的scheme
* @param compltionBlock 支付结果回调Block,用于wap支付结果回调(非跳转钱包支付)
*/
- (void)payOrder:(NSString *)orderStr
fromScheme:(NSString *)schemeStr
callback:(CompletionBlock)completionBlock;
/**
* 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url
*
* @param resultUrl 支付结果url
* @param completionBlock 支付结果回调
*/
- (void)processOrderWithPaymentResult:(NSURL *)resultUrl
standbyCallback:(CompletionBlock)completionBlock;
/**
* 获取交易token。
*
* @return 交易token,若无则为空。
*/
- (NSString *)fetchTradeToken;
/**
* 是否已经使用过
*
* @return YES为已经使用过,NO反之
*/
- (BOOL)isLogined;
/**
* 当前版本号
*
* @return 当前版本字符串
*/
- (NSString *)currentVersion;
/**
* 当前版本号
*
* @return tid相关信息
*/
- (NSString*)queryTidFactor:(AlipayTidFactor)factor;
/**
* 測試所用,realse包无效
*
* @param url 测试环境
*/
- (void)setUrl:(NSString *)url;
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////h5 拦截支付入口///////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
/**
* url order 获取接口
*
* @param urlStr 拦截的 url string
*
* @return 获取到的url order info
*/
- (NSString*)fetchOrderInfoFromH5PayUrl:(NSString*)urlStr;
/**
* url支付接口
*
* @param orderStr 订单信息
* @param schemeStr 调用支付的app注册在info.plist中的scheme
* @param compltionBlock 支付结果回调Block
*/
- (void)payUrlOrder:(NSString *)orderStr
fromScheme:(NSString *)schemeStr
callback:(CompletionBlock)completionBlock;
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////授权1.0//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
/**
* 快登授权
* @param authInfo 需授权信息
* @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
需要调用方在appDelegate中调用processAuthResult:standbyCallback:方法获取授权结果
*/
- (void)authWithInfo:(APayAuthInfo *)authInfo
callback:(CompletionBlock)completionBlock;
/**
* 处理授权信息Url
*
* @param resultUrl 钱包返回的授权结果url
* @param completionBlock 授权结果回调
*/
- (void)processAuthResult:(NSURL *)resultUrl
standbyCallback:(CompletionBlock)completionBlock;
//////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////授权2.0//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////
/**
* 快登授权2.0
*
* @param infoStr 授权请求信息字符串
* @param schemeStr 调用授权的app注册在info.plist中的scheme
* @param completionBlock 授权结果回调,若在授权过程中,调用方应用被系统终止,则此block无效,
需要调用方在appDelegate中调用processAuth_V2Result:standbyCallback:方法获取授权结果
*/
- (void)auth_V2WithInfo:(NSString *)infoStr
fromScheme:(NSString *)schemeStr
callback:(CompletionBlock)completionBlock;
/**
* 处理授权信息Url
*
* @param resultUrl 钱包返回的授权结果url
* @param completionBlock 授权结果回调
*/
- (void)processAuth_V2Result:(NSURL *)resultUrl
standbyCallback:(CompletionBlock)completionBlock;
@end
Copyright (c) 2018 lee <627051222@qq.com>
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.
# AliPay
[![CI Status](http://img.shields.io/travis/lee/AliPay.svg?style=flat)](https://travis-ci.org/lee/AliPay)
[![Version](https://img.shields.io/cocoapods/v/AliPay.svg?style=flat)](http://cocoapods.org/pods/AliPay)
[![License](https://img.shields.io/cocoapods/l/AliPay.svg?style=flat)](http://cocoapods.org/pods/AliPay)
[![Platform](https://img.shields.io/cocoapods/p/AliPay.svg?style=flat)](http://cocoapods.org/pods/AliPay)
## Example
To run the example project, clone the repo, and run `pod install` from the Example directory first.
## Requirements
## Installation
AliPay is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:
```ruby
pod 'AliPay'
```
## Author
lee, 627051222@qq.com
## License
AliPay is available under the MIT license. See the LICENSE file for more info.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment