123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>SDK使用教程 - 极速支付</title>
- <meta name="description" content="极速支付SDK使用教程,包含安装配置、接口调用和示例代码。">
- <meta name="keywords" content="SDK教程,支付SDK,SDK使用,SDK集成">
- <link rel="stylesheet" href="../style.css">
- <style>
- .article-container {
- max-width: 800px;
- margin: 0 auto;
- padding: 40px 20px;
- }
-
- .article-header {
- margin-bottom: 40px;
- }
-
- .article-title {
- font-size: 2.5em;
- color: #3498db;
- margin-bottom: 20px;
- }
-
- .article-meta {
- color: #666;
- font-size: 0.9em;
- margin-bottom: 30px;
- }
-
- .article-content {
- line-height: 1.8;
- color: #333;
- }
-
- .article-content h2 {
- color: #2c3e50;
- margin: 40px 0 20px;
- font-size: 1.8em;
- }
-
- .article-content p {
- margin-bottom: 20px;
- }
-
- .article-content ul {
- margin-bottom: 20px;
- padding-left: 20px;
- }
-
- .article-content li {
- margin-bottom: 10px;
- }
-
- .code-block {
- background: #f5f5f5;
- padding: 15px;
- border-radius: 5px;
- margin: 20px 0;
- font-family: monospace;
- overflow-x: auto;
- }
-
- .back-to-list {
- display: inline-block;
- margin-top: 40px;
- color: #3498db;
- text-decoration: none;
- }
-
- .back-to-list:hover {
- text-decoration: underline;
- }
- </style>
- </head>
- <body>
- <div class="article-container">
- <div class="article-header">
- <h1 class="article-title">SDK使用教程</h1>
- <div class="article-meta">
- <span>发布时间:2024-04-22</span>
- <span style="margin: 0 10px;">|</span>
- <span>作者:极速支付团队</span>
- </div>
- </div>
-
- <div class="article-content">
- <h2>一、SDK概述</h2>
- <p>极速支付SDK提供了简单易用的接口,帮助开发者快速集成支付功能。</p>
-
- <h2>二、安装配置</h2>
- <div class="code-block">
- // 使用npm安装
- npm install jsupay-sdk
-
- // 或使用yarn安装
- yarn add jsupay-sdk
- </div>
-
- <h2>三、初始化配置</h2>
- <div class="code-block">
- const Jsupay = require('jsupay-sdk');
-
- const client = new Jsupay({
- merchant_id: 'your_merchant_id',
- api_key: 'your_api_key',
- environment: 'production' // 或 'sandbox'
- });
- </div>
-
- <h2>四、接口调用示例</h2>
- <div class="code-block">
- // 创建支付订单
- const order = await client.createOrder({
- order_no: '202404220001',
- amount: 100.00,
- currency: 'CNY',
- notify_url: 'https://your-domain.com/notify'
- });
-
- // 查询订单状态
- const status = await client.queryOrder('202404220001');
- </div>
-
- <h2>五、注意事项</h2>
- <ul>
- <li>请妥善保管API密钥</li>
- <li>建议在测试环境完成测试后再上线</li>
- <li>注意处理异常情况</li>
- <li>定期更新SDK版本</li>
- </ul>
- </div>
-
- <a href="../index2.html" class="back-to-list">← 返回文章列表</a>
- </div>
- </body>
- </html>
|