Apple payment on web create session

241 Views Asked by At

I'm trying to create a apple payment session according this doc : https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/requesting_an_apple_pay_payment_session

This is my curl request.

curl -v --data '{"merchantIdentifier":"merchant.com.*****", "displayName":"******", "initiative": "web", "initiativeContext": "domain.com"}' -H "Content-Type: application/json" -X POST --cert /path-to-certs/merchant-identifier.key https://apple-pay-gateway.apple.com/paymentservices/paymentSession

and I'm getting this response.

* Connected to apple-pay-gateway.apple.com (********hide) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*  CAfile: /etc/ssl/cert.pem
*  CApath: none
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (OUT), TLS handshake, Client hello (1):
* (304) (IN), TLS handshake, Server hello (2):
* (304) (IN), TLS handshake, Unknown (8):
* (304) (IN), TLS handshake, Request CERT (13):
* (304) (IN), TLS handshake, Certificate (11):
* (304) (IN), TLS handshake, CERT verify (15):
* (304) (IN), TLS handshake, Finished (20):
* (304) (OUT), TLS handshake, Certificate (11):
* (304) (OUT), TLS handshake, CERT verify (15):
* (304) (OUT), TLS handshake, Finished (20):
* SSL connection using TLSv1.3 / AEAD-AES256-GCM-SHA384
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=apple-pay-gateway.apple.com; O=Apple Inc.; L=Cupertino; ST=California; C=US; serialNumber=******; jurisdictionStateOrProvinceName=California; jurisdictionCountryName=US; businessCategory=Private Organization
*  start date: Jul 18 10:53:06 2023 GMT
*  expire date: Oct 16 11:03:06 2023 GMT
*  subjectAltName: host "apple-pay-gateway.apple.com" matched cert's "apple-pay-gateway.apple.com"
*  issuer: C=US; O=Apple Inc.; CN=Apple Public EV Server RSA CA 1 - G1
*  SSL certificate verify ok.
> POST /paymentservices/paymentSession HTTP/1.1
> Host: apple-pay-gateway.apple.com
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Type: application/json
> Content-Length: 145
>
* LibreSSL SSL_read: error:1404C418:SSL routines:ST_OK:tlsv1 alert unknown ca, errno 0
* Closing connection 0
curl: (56) LibreSSL SSL_read: error:1404C418:SSL routines:ST_OK:tlsv1 alert unknown ca, errno 0

It looks like I'm able to handshake with apple payment server but after that something going not very well.

0

There are 0 best solutions below