跳到主要内容
将当前页面内容以 Markdown 格式复制到剪贴板

支付网关

The payment gateways API allows you to view, and update individual payment gateways. Results are not paginated - all gateways will be returned.

Payment gateway properties

AttributeTypeDescription
idstringPayment gateway ID. READ-ONLY
titlestringPayment gateway title on checkout.
descriptionstringPayment gateway description on checkout.
orderintegerPayment gateway sort order.
enabledbooleanPayment gateway enabled status.
method_titlestringPayment gateway method title. READ-ONLY
method_descriptionstringPayment gateway method description. READ-ONLY
method_supportsarraySupported features for this payment gateway. READ-ONLY
settingsobjectPayment gateway settings. See Payment gateway - Settings properties

Payment gateway - Settings properties

AttributeTypeDescription
idstringA unique identifier for the setting. READ-ONLY
labelstringA human readable label for the setting used in interfaces. READ-ONLY
descriptionstringA human readable description for the setting used in interfaces. READ-ONLY
typestringType of setting. Options: text, email, number, color, password, textarea, select, multiselect, radio, image_width and checkbox. READ-ONLY
valuestringSetting value.
defaultstringDefault value for the setting. READ-ONLY
tipstringAdditional help text shown to the user about the setting. READ-ONLY
placeholderstringPlaceholder text to be displayed in text inputs. READ-ONLY

获取支付网关

此 API 允许您检索和查看特定的支付网关。

GET /wp-json/wc/v3/payment_gateways/<id>
curl https://example.com/wp-json/wc/v3/payment_gateways/bacs \
-u consumer_key:consumer_secret

列出所有支付网关

此 API 帮助您查看所有支付网关。

GET /wp-json/wc/v3/payment_gateways
curl https://example.com/wp-json/wc/v3/payment_gateways \
-u consumer_key:consumer_secret

更新支付网关

此 API 允许您对支付网关进行更改。

PUT /wp-json/wc/v3/payment_gateways/<id>
curl -X PUT https://example.com/wp-json/wc/v3/payment_gateways/bacs \
-u consumer_key:consumer_secret \
-H "Content-Type: application/json" \
-d '{
"enabled": false
}'