pip install python-alipay-sdk
openssl
openssl
OpenSSL> genrsa -out app_private_key.pem 2048 # 私钥
OpenSSL> rsa -in app_private_key.pem -pubout -out app_public_key.pem # 导出公钥
OpenSSL> exit # 退出
-----BEGIN PUBLIC KEY-----
和 -----END PUBLIC KEY-----
导入SDK
from alipay import AliPay
from . import api
from ih import db, constants
from ih.utils.commons import login
from ih.models import Order
from flask import current_app, jsonify, g, request
from ihome.utils.response_code import RET
from alipay import AliPay
import os
# 请求方式:POST
# 请求参数:order_id
# 参数格式:json
# url:/orders//pay
@api.route("/orders//pay" , methods