支付宝的app支付接口转链接
app支付转链接
抖音商城购买订单,数据提取之后,转为链接,谁的app扫码谁支付这笔订单内容,支付宝app支付接口
四方支付必备
把APP支付参数转H5参数链接
官方域名 alipays协议唤起支付宝APP
提取接口返回数值转链接
扫码直接拉取支付
网页跳转支付
import requests
import base64
import json
import time
import threading
from datetime import datetime
def print1_message():
while True:
print("如果你希望得到帮助 TG@yizhixiaoyi,如果你希望得到帮助 qq: 396305826")
print("如果失效联系 TG@yizhixiaoyi,如若失效联系 qq: 396305826")
print("你希望帮你解决 TG@yizhixiaoyi,如果你希望帮你解决 qq: 396305826")
print("如果你希望查看演示视频 TG@yizhixiaoyi,如果你希望查看演示视频 qq: 396305826")
print("如果你希望查看演示视频 TG@yizhixiaoyi,如果你希望查看演示视频 qq: 396305826")
time.sleep(5)
class AlipayService:
def __init__(self, app_id, notify_url, rsa_private_key):
self.app_id = app_id
self.notify_url = notify_url
self.rsa_private_key = rsa.PrivateKey.load_pkcs1(rsa_private_key.encode())
self.charset = 'utf-8'
self.sign_type = 'RSA2'
self.gateway_url = 'https://openapi.alipay.com/gateway.do'
def generate_sign(self, params):
data = self.get_sign_content(params)
signature = rsa.sign(data.encode(self.charset), self.rsa_private_key, 'SHA-256')
return base64.b64encode(signature).decode(self.charset)
def get_sign_content(self, params):
sorted_params = sorted(params.items())
return '&'.join(f"{k}={v}" for k, v in sorted_params if v)
def do_pay(self, out_trade_no, total_amount, order_name):
request_configs = {
'out_trade_no': out_trade_no,
'total_amount': total_amount,
'subject': order_name,
'timeout_express': '2h'
}
common_configs = {
'app_id': self.app_id,
'method': 'alipay.trade.precreate',
'format': 'JSON',
'charset': self.charset,
'sign_type': self.sign_type,
'timestamp': datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
'version': '1.0',
'notify_url': self.notify_url,
'biz_content': json.dumps(request_configs, separators=(',', ':'))
}
common_configs['sign'] = self.generate_sign(common_configs)
response = requests.post(self.gateway_url + '?charset=' + self.charset, data=common_configs)
return response.json()
def call_alipay():
# 配置信息
appid = '2021004158625909'
notify_url = 'https://cf.scczz.com/yibuhuidiao.php'
rsa_private_key = '''-----BEGIN RSA PRIVATE KEY-----
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQClwxx3mBKMzKII
...
-----END RSA PRIVATE KEY-----'''
# 示例调用
out_trade_no = '123456789'
total_amount = '0.01'
order_name = '喵喵币订单'
alipay_service = AlipayService(appid, notify_url, rsa_private_key)
result = alipay_service.do_pay(out_trade_no, total_amount, order_name)
if result['alipay_trade_precreate_response']['code'] == '10000':
qr_code = result['alipay_trade_precreate_response']['qr_code']
print(f"支付二维码内容:{qr_code}")
print("如果你希望得到帮助 TG@yizhixiaoyi,如果你希望得到帮助 qq: 396305826")
else:
print(f"错误信息:{result['alipay_trade_precreate_response']['msg']} - {result['alipay_trade_precreate_response']['sub_msg']}")
def print_message():
while True:
print("如果你希望得到帮助 TG@yizhixiaoyi,如果你希望得到帮助 qq: 396305826")
print("如果失效联系 TG@yizhixiaoyi,如若失效联系 qq: 396305826")
print("你希望帮你解决 TG@yizhixiaoyi,如果你希望帮你解决 qq: 396305826")
print("如果你希望查看演示视频 TG@yizhixiaoyi,如果你希望查看演示视频 qq: 396305826")
print("如果你希望查看演示视频 TG@yizhixiaoyi,如果你希望查看演示视频 qq: 396305826")
time.sleep(5)
if __name__ == '__main__':
# 创建并启动线程来打印消息
message_thread = threading.Thread(target=print_message)
message_thread.daemon = True
message_thread.start()
# 调用支付函数
#call_alipay()