Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
fzlee committed Aug 23, 2018
1 parent a810239 commit 71ca464
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Or you may just follow this manual if not.
pip install python-alipay-sdk --upgrade
```

#### cert generation
#### Cert generation
```bash
# openssl
OpenSSL> genrsa -out app_private_key.pem 2048 # the private key file
Expand Down Expand Up @@ -93,7 +93,7 @@ There is also an [example](https://github.com/fzlee/alipay/blob/master/tests/cer
Given an alipay function, say `alipay.trade.page.pay`, we will defind a corresponding function `alipay.api_alipay_trade_page_pay()`
Generally we will do such a translation:

function_name = "alipay_" + alipay_function_name.replace(".", "_")
function_name = "api_" + alipay_function_name.replace(".", "_")

according to alipay document, some paremeters in `biz_content` are optional and some are not.
we defind functions in this way so that you can put those optional parameters in `kwargs`:
Expand Down
5 changes: 3 additions & 2 deletions README.zh-hans.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ OpenSSL> exit
```

在支付宝上下载的公钥是一个字符串,你需要在文本的首尾添加标记位
```(-----BEGIN PUBLIC KEY-----和-----END PUBLIC KEY-----)
```
(-----BEGIN PUBLIC KEY-----和-----END PUBLIC KEY-----)
```
才能正常使用, 证书的格式你可以参考[这里](https://github.com/fzlee/alipay/blob/master/tests/certs/ali/ali_public_key.pem)

Expand Down Expand Up @@ -92,7 +93,7 @@ OpenSSL> exit
对于一个支付宝的接口,比如`alipay.trade.page.pay`,则一般可以这么调用接口:`alipay.api_alipay_trade_page_pay()`.
也就是说,我们做了这么一个转换:

内部函数名 = alipay_ + 支付宝接口名.replace(".", "_")
内部函数名 = api_ + 支付宝接口名.replace(".", "_")

支付宝对于请求的biz_content,里面有一些参数必选,有一些可选。对于必选的参数,他们一般被明确定义在函数的参数里面。对于可选参数,他们一般被放在kwargs里面,然后被添加到biz_content里面去。比如`alipay.trade.page.pay`可以这么调用:
```python
Expand Down

0 comments on commit 71ca464

Please sign in to comment.