curl --request POST \
--url https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/startSession",
"domain": "checkout.minhaloja.com.br"
}
'import requests
url = "https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant"
payload = {
"validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/startSession",
"domain": "checkout.minhaloja.com.br"
}
headers = {
"client-secret": "<api-key>",
"client-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-secret': '<api-key>',
'client-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
validationUrl: 'https://apple-pay-gateway.apple.com/paymentservices/startSession',
domain: 'checkout.minhaloja.com.br'
})
};
fetch('https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant', 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.uvvipay.com.br/v1/payments/apple-pay/validate-merchant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'validationUrl' => 'https://apple-pay-gateway.apple.com/paymentservices/startSession',
'domain' => 'checkout.minhaloja.com.br'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant"
payload := strings.NewReader("{\n \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/startSession\",\n \"domain\": \"checkout.minhaloja.com.br\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-secret", "<api-key>")
req.Header.Add("client-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.uvvipay.com.br/v1/payments/apple-pay/validate-merchant")
.header("client-secret", "<api-key>")
.header("client-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/startSession\",\n \"domain\": \"checkout.minhaloja.com.br\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-secret"] = '<api-key>'
request["client-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/startSession\",\n \"domain\": \"checkout.minhaloja.com.br\"\n}"
response = http.request(request)
puts response.read_body{}Validar sessão Apple Pay (web)
Merchant validation do Apple Pay on the Web, server-to-server: repasse o validationURL do evento onvalidatemerchant e devolva o merchant session retornado ao ApplePaySession. Aceita apenas domínios com status verified em /v1/payment-method-domains.
curl --request POST \
--url https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant \
--header 'Content-Type: application/json' \
--header 'client-id: <api-key>' \
--header 'client-secret: <api-key>' \
--data '
{
"validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/startSession",
"domain": "checkout.minhaloja.com.br"
}
'import requests
url = "https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant"
payload = {
"validationUrl": "https://apple-pay-gateway.apple.com/paymentservices/startSession",
"domain": "checkout.minhaloja.com.br"
}
headers = {
"client-secret": "<api-key>",
"client-id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'client-secret': '<api-key>',
'client-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
validationUrl: 'https://apple-pay-gateway.apple.com/paymentservices/startSession',
domain: 'checkout.minhaloja.com.br'
})
};
fetch('https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant', 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.uvvipay.com.br/v1/payments/apple-pay/validate-merchant",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'validationUrl' => 'https://apple-pay-gateway.apple.com/paymentservices/startSession',
'domain' => 'checkout.minhaloja.com.br'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"client-id: <api-key>",
"client-secret: <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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant"
payload := strings.NewReader("{\n \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/startSession\",\n \"domain\": \"checkout.minhaloja.com.br\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("client-secret", "<api-key>")
req.Header.Add("client-id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
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.uvvipay.com.br/v1/payments/apple-pay/validate-merchant")
.header("client-secret", "<api-key>")
.header("client-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/startSession\",\n \"domain\": \"checkout.minhaloja.com.br\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.uvvipay.com.br/v1/payments/apple-pay/validate-merchant")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["client-secret"] = '<api-key>'
request["client-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"validationUrl\": \"https://apple-pay-gateway.apple.com/paymentservices/startSession\",\n \"domain\": \"checkout.minhaloja.com.br\"\n}"
response = http.request(request)
puts response.read_body{}Headers
Secret da credencial do merchant
ID público da credencial do merchant
Body
validationURL emitida pelo Safari no evento onvalidatemerchant (o host é validado contra o gateway Apple Pay no servidor)
"https://apple-pay-gateway.apple.com/paymentservices/startSession"
Domínio da página onde o botão está (window.location.hostname) — precisa estar registrado e verificado em /v1/payment-method-domains
255"checkout.minhaloja.com.br"
Response
Merchant session opaco da Apple — repasse ao ApplePaySession.completeMerchantValidation
The response is of type object.

