支付方式(直接工作流)
取消注册支付方式
取消注册客户已保存的支付方式,并将其状态设为 UNENROLLED
POST
/
customers
/
{customer_id}
/
payment-methods
/
{payment_method_id}
/
unenroll
取消注册支付方式
curl --request POST \
--url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll \
--header 'X-Idempotency-Key: <api-key>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"X-Idempotency-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'X-Idempotency-Key': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Idempotency-Key: <api-key>",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
req.Header.Add("X-Idempotency-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("X-Idempotency-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["X-Idempotency-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cbdcc878-ceb4-4dd8-b0f0-49d444855de0",
"account_id": "493e9374-510a-4201-9e09-de669d75f256",
"name": "VISA ****1111",
"description": "VISA ****1111",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "UNENROLLED",
"created_at": "2024-06-06T13:32:49.715656Z",
"updated_at": "2024-06-06T13:37:38.891106Z",
"enrollment": {
"session": "",
"sdk_required_action": true
},
"provider": {
"id": "YUNO",
"type": "YUNO",
"provider_status": null
},
"verify": {
"vault_on_success": false,
"payment": null
},
"preferred": null,
"idempotency_key": "f8f624e9-0621-4775-8f58-5194024008b2",
"parent_type": null,
"sub_status": null,
"vaulted_token": "3727b020-b1d3-4fe6-884e-31a5354a8c20",
"callback_url": null,
"action": "FORM",
"redirect_url": null,
"card_data": {
"iin": "41111111",
"lfd": "1111",
"holder_name": "JOHN DOE",
"expiration_month": 12,
"expiration_year": 26,
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"issuer": "CONOTOXIA SP Z O O",
"issuer_code": null,
"country_code": "PL",
"category": "CLASSIC",
"type": "DEBIT",
"stored_credentials": {
"reason": null,
"usage": null,
"subscription_agreement_id": null,
"network_transaction_id": "108114113107103",
"transaction_link_id": null
},
"fingerprint": "ba4d6817-adf4-47b1-8ae4-41a934e9e512"
},
"last_successfully_used": null,
"last_successfully_used_at": null
}{
"code": "INVALID_REQUEST",
"messages": [
"Invalid request"
]
}{
"code": "INVALID_CREDENTIALS",
"messages": [
"Invalid credentials"
]
}{
"code": "AUTHORIZATION_REQUIRED",
"messages": [
"The merchant has no authorization to use this API."
]
}此页面对您有帮助吗?
⌘I
取消注册支付方式
curl --request POST \
--url https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll \
--header 'X-Idempotency-Key: <api-key>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>",
"X-Idempotency-Key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>',
'X-Idempotency-Key': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Idempotency-Key: <api-key>",
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
req.Header.Add("X-Idempotency-Key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.header("X-Idempotency-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/customers/{customer_id}/payment-methods/{payment_method_id}/unenroll")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
request["X-Idempotency-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "cbdcc878-ceb4-4dd8-b0f0-49d444855de0",
"account_id": "493e9374-510a-4201-9e09-de669d75f256",
"name": "VISA ****1111",
"description": "VISA ****1111",
"type": "CARD",
"category": "CARD",
"country": "US",
"status": "UNENROLLED",
"created_at": "2024-06-06T13:32:49.715656Z",
"updated_at": "2024-06-06T13:37:38.891106Z",
"enrollment": {
"session": "",
"sdk_required_action": true
},
"provider": {
"id": "YUNO",
"type": "YUNO",
"provider_status": null
},
"verify": {
"vault_on_success": false,
"payment": null
},
"preferred": null,
"idempotency_key": "f8f624e9-0621-4775-8f58-5194024008b2",
"parent_type": null,
"sub_status": null,
"vaulted_token": "3727b020-b1d3-4fe6-884e-31a5354a8c20",
"callback_url": null,
"action": "FORM",
"redirect_url": null,
"card_data": {
"iin": "41111111",
"lfd": "1111",
"holder_name": "JOHN DOE",
"expiration_month": 12,
"expiration_year": 26,
"number_length": 16,
"security_code_length": 3,
"brand": "VISA",
"issuer": "CONOTOXIA SP Z O O",
"issuer_code": null,
"country_code": "PL",
"category": "CLASSIC",
"type": "DEBIT",
"stored_credentials": {
"reason": null,
"usage": null,
"subscription_agreement_id": null,
"network_transaction_id": "108114113107103",
"transaction_link_id": null
},
"fingerprint": "ba4d6817-adf4-47b1-8ae4-41a934e9e512"
},
"last_successfully_used": null,
"last_successfully_used_at": null
}{
"code": "INVALID_REQUEST",
"messages": [
"Invalid request"
]
}{
"code": "INVALID_CREDENTIALS",
"messages": [
"Invalid credentials"
]
}{
"code": "AUTHORIZATION_REQUIRED",
"messages": [
"The merchant has no authorization to use this API."
]
}