Giter VIP home page Giter VIP logo

alipaydemo's Introduction

说明:在原作者作品的基础上对支付宝支付做了一些修改,在支付方法上增加了支付回调结果,更加方便开发者对支付结果进行处理,对iOS9进行了适配 使用:

  1. 将本工程中的Alipay文件夹导入工程中,记得选copy;

  2. 点击项目名称,点击“Build Settings”选项卡,在搜索框中,以关键字“search” 搜索,对“Header Search Paths”增加头文件路径:“$(SRCROOT)/项目名称/IntegratedAlipay/AlipayFiles”(注意:不包括引号,如果不是放到项目根目录下,请在项目名称后面加上相应的目录名);

  3. 点击项目名称,点击“Build Phases”选项卡,在“Link Binary with Librarles” 选项中,新增“AlipaySDK.framework”和“SystemConfiguration.framework” 两个系统库文件。如果项目中已有这两个库文件,可不必再增加;

  4. BuildSettings EnableBitcode 设置为 No;

  5. 增加安全传输协议、 支付宝白名单 Info.plist SourceCode打开

    NSAppTransportSecurity NSAllowsArbitraryLoads LSApplicationQueriesSchemes alipay

  6. 在本头文件中设置kPartnerID、kSellerAccount、kNotifyURL、kAppScheme和kPrivateKey的值(所有的值在支付宝回复的邮件里面:注意,建议除appScheme以外的字段都从服务器请求);

  7. 点击项目名称,点击“Info”选项卡,在URL types里面添加一项,Identifier可以不填,URL schemes必须和appScheme的值相同,用于支付宝处理回到应用的事件(建议使用BundleID);

  8. 在需要用的地方导入“AlipayHeader.h”,并使用“[AlipayRequestConfig alipayWithTradeNO:<#(NSString *)#> productName:<#(NSString *)#> productDescription:<#(NSString *)#> amount:<#(NSString *)#> complete:<#^(NSDictionary *dictionary)complete#>]”方法进行支付;

AlipayDemo

alipaydemo's People

Contributors

hosealeee avatar

Watchers

James Cloos avatar meliuxudong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.