### API Documentation Examples Source: https://help.comgate.cz/docs/pro-programatory Detailed API documentation for custom e-shop integration. Includes examples for CURL, PHP, JAVA, and Python requests. ```curl curl -X POST \ 'https://gate.comgate.cz/api/v1.0/payments' \ -H 'Content-Type: application/json' \ -H 'Cache-Control: no-cache' \ -d '{ "amount": 100, "currency": "CZK", "order_id": "12345", "customer": { "email": "test@example.com" }, "redirect_url": "https://example.com/return", "notification_url": "https://example.com/notify" }' ``` ```php 100, 'currency' => 'CZK', 'order_id' => '12345', 'customer' => [ 'email' => 'test@example.com' ], 'redirect_url' => 'https://example.com/return', 'notification_url' => 'https://example.com/notify' ]; $options = [ 'http' => [ 'header' => "Content-type: application/json\r\n" . "Cache-Control: no-cache\r\n", 'method' => 'POST', 'content' => json_encode($data), ], ]; $context = stream_context_create($options); $result = file_get_contents('https://gate.comgate.cz/api/v1.0/payments', false, $context); if ($result === FALSE) { /* Handle error */ } else { var_dump(json_decode($result)); } ``` ```java import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; public class PaymentGateway { public static void main(String[] args) throws Exception { URL url = new URL("https://gate.comgate.cz/api/v1.0/payments"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/json"); connection.setRequestProperty("Cache-Control", "no-cache"); connection.setDoOutput(true); String jsonBody = "{\"amount\": 100, \"currency\": \"CZK\", \"order_id\": \"12345\", \"customer\": { \"email\": \"test@example.com\" }, \"redirect_url\": \"https://example.com/return\", \"notification_url\": \"https://example.com/notify\"}"; try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonBody.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } int responseCode = connection.getResponseCode(); System.out.println("Response Code: " + responseCode); // Read response // ... } } ``` ```python import requests import json url = "https://gate.comgate.cz/api/v1.0/payments" headers = { 'Content-Type': 'application/json', 'Cache-Control': 'no-cache' } data = { "amount": 100, "currency": "CZK", "order_id": "12345", "customer": { "email": "test@example.com" }, "redirect_url": "https://example.com/return", "notification_url": "https://example.com/notify" } response = requests.post(url, headers=headers, data=json.dumps(data)) print(response.status_code) print(response.json()) ``` -------------------------------- ### Example PayPal Client ID and Secret Source: https://help.comgate.cz/docs/paypal These are example credentials for a PayPal application. Ensure you use your actual Client ID and Secret obtained from the PayPal Developer Dashboard. ```text Client ID: AbCDefGh1234567890abcdefghijklmnopQRSTUVWXyz Secret : EJd93kd82KDjS93kd92KDJd9s2KDJd92kd92kd9DJ ```