All Projects → ArthasModern → AlipayOpenapiCpp

ArthasModern / AlipayOpenapiCpp

Licence: other
支付宝开放平台的C\C++版接入示例代码,包含加签验签\网络请求\参数组装\报文解析等等;仅供商户或开发者参考使用;

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to AlipayOpenapiCpp

Payment
Payment是php版本的支付聚合第三方sdk,集成了微信支付、支付宝支付、招商一网通支付。提供统一的调用接口,方便快速接入各种支付、查询、退款、转账能力。服务端接入支付功能,方便、快捷。
Stars: ✭ 2,293 (+5111.36%)
Mutual labels:  alipay, alipaysdk
AppPay
💸 AppPay专注于App支付的库,几句代码轻松搞定微信支付、支付宝支付。集成更简单。
Stars: ✭ 33 (-25%)
Mutual labels:  alipay
moko-network
Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
Stars: ✭ 107 (+143.18%)
Mutual labels:  openapi
main
Mocks Server monorepo
Stars: ✭ 109 (+147.73%)
Mutual labels:  openapi
swagger-converter
OpenAPI/Swagger 2.0 to OpenAPI 3.0 Converter WebService
Stars: ✭ 58 (+31.82%)
Mutual labels:  openapi
connexion-example-redis-kubernetes
Connexion Example REST Service with Redis Store
Stars: ✭ 24 (-45.45%)
Mutual labels:  openapi
openapi-client
Generate ES6 or Typescript service integration code from an OpenAPI 2 spec
Stars: ✭ 92 (+109.09%)
Mutual labels:  openapi
galois
A performant NumPy extension for Galois fields and their applications
Stars: ✭ 106 (+140.91%)
Mutual labels:  rsa
minter-go-sdk
Minter Blockchain Golang SDK, 💳 wallet, 🧾 transactions, gRPC and HTTP clients 🌐 https://t.me/MinterGoSDK
Stars: ✭ 12 (-72.73%)
Mutual labels:  openapi
whook
Build strong and efficient REST web services.
Stars: ✭ 18 (-59.09%)
Mutual labels:  openapi
fastapi-tortoise
The template for building scalable web APIs based on FastAPI, Tortoise ORM and other.
Stars: ✭ 95 (+115.91%)
Mutual labels:  openapi
openapi
OpenAPI 3 Specification for golang
Stars: ✭ 18 (-59.09%)
Mutual labels:  openapi
ssc-restapi-client
Communicate with Fortify Software Security Center through REST API in java, a swagger generated client
Stars: ✭ 13 (-70.45%)
Mutual labels:  openapi
donate
捐赠我们
Stars: ✭ 12 (-72.73%)
Mutual labels:  alipay
alipay
laravel lumen alipay 最简单,最安全,无验签,支付宝转账支付
Stars: ✭ 18 (-59.09%)
Mutual labels:  alipay
mattermost-api-reference
Mattermost API reference documentation.
Stars: ✭ 74 (+68.18%)
Mutual labels:  openapi
go-fastapi
Create an API and get Swagger definition for free
Stars: ✭ 76 (+72.73%)
Mutual labels:  openapi
openapi-generator-go
An opinionated OpenAPI v3 code generator for Go. Use this to generate API models and router scaffolding.
Stars: ✭ 42 (-4.55%)
Mutual labels:  openapi
EP-WechatApp
EATER PLANET吃货星球:社区团购电商微信小程序前端(长期维护更新)
Stars: ✭ 154 (+250%)
Mutual labels:  alipay
oas
OpenAPI Spec builder in go
Stars: ✭ 15 (-65.91%)
Mutual labels:  openapi
该项目为C++项目,包含访问支付宝开放平台(Openapi)网关的源码;

/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ **/

工程中有两个项目文件:
Openapi.pro为QtCreater项目文件,可用QtCreater打开;
Openapi.sln为VS(2008版)项目文件,可用VS打开;
使用哪种项目文件,由开发者使用的IDE环境决定,并不一定局限于以上两种;

注:该项目源码依赖C\C++标准库(STL)以及几个开源的第三方库(libcurl,openssl);
示例Demo中第三方库(libcurl,openssl)是已经编译成windows平台下的静态库;
开发者可以在其它支持C\C++的平台(linux等)使用源码自行编译第三方库(libcurl,openssl);
开发者亦可自行决定使用静态\动态链接库;

/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ **/

项目的目录结构:
(主要源码包含在目录“/openapi”中)

1)主工具类 -- ./openapi/openapi_client 
---- 访问支付宝开放平台(openapi)网关的工具类;
---- 外部主要依赖该类访问支付宝网关;
---- 具体使用示例可参见main.cpp中的源码及注释;

2)其它依赖的工具类:
HttpClient -- ./openapi/http/http_client
---- 该工具类提供Http(Https)网络通信的功能;
---- 该工具类依赖第三方库libcurl

JsonUtil -- ./openapi/json/json_util
---- 该工具类提供Json串与C++对象之间的转换功能;
---- 该工具类依赖第三方库cJSON;

openssl & libcurl -- ./libs/
---- 这两个第三方库已经编译成静态库(windows平台);
---- 其它平台的静态库,开发者可自行下载源码进行编译;

/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ **/

集成/调试之前的准备工作:

1)入住支付宝开放平台,申请应用并获得应用ID(appId);

2)本地生成rsa密钥对,并上传公钥到支付宝开放平台相应的应用下,
   并保存好自己的私钥(privateKey -- 严格保密);
   rsa密钥生成方式参看支付宝开放平台官方文档;
   注:C++使用的是标准格式的rsa私钥,不是pkcs8格式的;
	
3)各个具体业务接口参数组装模式具体参看Openapi官方文档;

4)支付宝开放平台文档中心:https://doc.open.alipay.com/

/** ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ **/

免责声明:

1)DEMO仅供参考,实际开发中需要结合具体业务场景修改使用。

2)如果使用了支付接口中的异步通知,则需要严格按照如下描述校验通知数据的正确性(如果没有使用异步通知,可忽略):
	2.1)商户需要验证该通知数据中的out_trade_no是否为商户系统中创建的订单号;
	2.2)判断total_amount是否确实为该订单的实际金额(即商户订单创建时的金额);
	2.3)校验通知中的seller_id(或者seller_email) 是否为out_trade_no这笔单据的对应的操作方(有的时候,一个商户可能有多个seller_id/seller_email);
	2.4)验证app_id是否为该商户本身;
	
3)该DEMO所运行的环境:
	3.1)所提供的示例为windows平台下可运行;
	3.2)开发者亦可以在其它支持C\C++的平台(如linux)适配运行;(只需要将依赖的第三方开源库(libcurl,openssl)编译适配好即可)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].