我想使用 Shopify API 的“支付”
I want to use Shopify API of “payment”
感谢浏览。
我想使用这个API的“创建新付款”。
https://shopify.dev/docs/admin-api/rest/reference/sales-channels/payment?api[version]=2020-07
但是,我在“POSTMAN”上得到了HTML。
详情如下
Url
https://XXXXXXXXXXXX.myshopify.com/admin/api/2020-07/checkouts/0076fd26194e9a11e1ad2fef27e6d369/payments.json
正文
{
"payment": {
"request_details": {
"ip_address": "114.179.82.76",
"accept_language": "en-US,en;q=0.8,fr;q=0.6",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
},
"amount": "11000.00",
"session_id": "east-a2fe97e4239a2141004a2586da22babd",
"unique_token": "7d80c851451dcbe1d36af87c55c573a3"
}
}
结果
<html>
<body>
<noscript>
<a
href="https://accounts.shopify.com/oauth/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&destination_uuid=194909e9-a17a-40dd-bfb7-61a6a8739c9c&nonce=28f174d1a0c3dcad2ee819c1ab6772eb&prompt=merge&redirect_uri=https%3A%2F%2Fdrupal-integration.myshopify.com%2Fadmin%2Fauth%2Fidentity%2Fcallback&response_type=code&scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage&state=0ed03b89f02f335f13bdc36f4813a822&ui_locales=en&ux=shop">Continue</a>
</noscript>
<script type="text/javascript" defer>
window.location = "https:\/\/accounts.shopify.com\/oauth\/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c\u0026destination_uuid=194909e9-a17a-40dd-bfb7-61a6a8739c9c\u0026nonce=28f174d1a0c3dcad2ee819c1ab6772eb\u0026prompt=merge\u0026redirect_uri=https%3A%2F%2Fdrupal-integration.myshopify.com%2Fadmin%2Fauth%2Fidentity%2Fcallback\u0026response_type=code\u0026scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage\u0026state=0ed03b89f02f335f13bdc36f4813a822\u0026ui_locales=en\u0026ux=shop";
</script>
</body>
</html>
我不知道我做错了什么。但是,我认为以下是可疑的。
我在 URL“0076fd26194e9a11e1ad2fef27e6d369”上使用了令牌。这是“web_url”。我在“创建结帐”时得到了它。
我在主体上使用了“session_id”参数。我是在“将信用卡存储在卡库中”得到的。
我在 body 上使用了“unique_token”参数。我是这样得到的。
抱歉我的英语不好,但我需要帮助。
您的 API 调用 运行 在 API 身份验证步骤出现问题。当您使用 POST 请求发送 cookie 时,就会出现此问题。
Shopify prevents HTTP Basic Auth POST requests that have cookies,
which can cause POST calls to fail. If your POST call fails, then you
should try clearing your cookies.
要清除 cookie,请使用 Postman 应用程序中的 Cookie 管理器,可以使用位于“发送”和“保存”按钮下方的 Cookies 按钮进行访问。
为了发送身份验证信息,Shopify 使用基本身份验证。您可以在 Shopify Docs for Authetication.
阅读更多关于生成凭据和发送请求的信息
感谢浏览。
我想使用这个API的“创建新付款”。
https://shopify.dev/docs/admin-api/rest/reference/sales-channels/payment?api[version]=2020-07
但是,我在“POSTMAN”上得到了HTML。
详情如下
Url
https://XXXXXXXXXXXX.myshopify.com/admin/api/2020-07/checkouts/0076fd26194e9a11e1ad2fef27e6d369/payments.json
正文
{
"payment": {
"request_details": {
"ip_address": "114.179.82.76",
"accept_language": "en-US,en;q=0.8,fr;q=0.6",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36"
},
"amount": "11000.00",
"session_id": "east-a2fe97e4239a2141004a2586da22babd",
"unique_token": "7d80c851451dcbe1d36af87c55c573a3"
}
}
结果
<html>
<body>
<noscript>
<a
href="https://accounts.shopify.com/oauth/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c&destination_uuid=194909e9-a17a-40dd-bfb7-61a6a8739c9c&nonce=28f174d1a0c3dcad2ee819c1ab6772eb&prompt=merge&redirect_uri=https%3A%2F%2Fdrupal-integration.myshopify.com%2Fadmin%2Fauth%2Fidentity%2Fcallback&response_type=code&scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage&state=0ed03b89f02f335f13bdc36f4813a822&ui_locales=en&ux=shop">Continue</a>
</noscript>
<script type="text/javascript" defer>
window.location = "https:\/\/accounts.shopify.com\/oauth\/authorize?client_id=7ee65a63608843c577db8b23c4d7316ea0a01bd2f7594f8a9c06ea668c1b775c\u0026destination_uuid=194909e9-a17a-40dd-bfb7-61a6a8739c9c\u0026nonce=28f174d1a0c3dcad2ee819c1ab6772eb\u0026prompt=merge\u0026redirect_uri=https%3A%2F%2Fdrupal-integration.myshopify.com%2Fadmin%2Fauth%2Fidentity%2Fcallback\u0026response_type=code\u0026scope=email%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fdestinations.readonly%20openid%20profile%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fpartners.collaborator-relationships.readonly%20https%3A%2F%2Fapi.shopify.com%2Fauth%2Fbanking.manage\u0026state=0ed03b89f02f335f13bdc36f4813a822\u0026ui_locales=en\u0026ux=shop";
</script>
</body>
</html>
我不知道我做错了什么。但是,我认为以下是可疑的。
我在 URL“0076fd26194e9a11e1ad2fef27e6d369”上使用了令牌。这是“web_url”。我在“创建结帐”时得到了它。
我在主体上使用了“session_id”参数。我是在“将信用卡存储在卡库中”得到的。
我在 body 上使用了“unique_token”参数。我是这样得到的。
抱歉我的英语不好,但我需要帮助。
您的 API 调用 运行 在 API 身份验证步骤出现问题。当您使用 POST 请求发送 cookie 时,就会出现此问题。
Shopify prevents HTTP Basic Auth POST requests that have cookies, which can cause POST calls to fail. If your POST call fails, then you should try clearing your cookies.
要清除 cookie,请使用 Postman 应用程序中的 Cookie 管理器,可以使用位于“发送”和“保存”按钮下方的 Cookies 按钮进行访问。
为了发送身份验证信息,Shopify 使用基本身份验证。您可以在 Shopify Docs for Authetication.
阅读更多关于生成凭据和发送请求的信息