From 95fd0b9623130dfc569ef6378fed9296bc35b9e8 Mon Sep 17 00:00:00 2001 From: Ulrik Moe Date: Mon, 3 Dec 2018 18:18:32 +0100 Subject: [PATCH] Change some options in the tests --- README.md | 8 ++++---- tests/newURL.php | 7 +------ tests/seq.php | 10 ++++++++++ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 08ec1ba..8cb1486 100644 --- a/README.md +++ b/README.md @@ -72,11 +72,11 @@ print_r ($json.seq); All methods, except `handlePing`, accept an optional per-request `options` object. You can use this to: -* Set the API key for this request ([example](tests/newURL.php#L14)) -* Set HTTP headers, e.g. the highly recommended `X-Cardholder-IP` ([example](tests/newURL.php#L15)) +* Set the API key for this request ([example](tests/seq.php#L16)) +* Set HTTP headers, e.g. the highly recommended `X-Cardholder-IP` ([example](tests/newURL.php#L14)) * Change the hostname to use our test environment `api.test.scanpay.dk` ([example](tests/newURL.php#L12)) -* Enable debugging mode ([example](tests/seq.php#L13)) -* Override cURL options with [`CURLOPT_*`](http://php.net/manual/en/function.curl-setopt.php) parameters ([example](tests/newURL.php#L17-L21)). +* Enable debugging mode ([example](tests/newURL.php#L16)) +* Override cURL options with [`CURLOPT_*`](http://php.net/manual/en/function.curl-setopt.php) parameters ([example](tests/seq.php#L19-L23)). ## Compatibility table diff --git a/tests/newURL.php b/tests/newURL.php index 877d1b2..0fd8be5 100755 --- a/tests/newURL.php +++ b/tests/newURL.php @@ -11,14 +11,9 @@ $options = [ 'hostname' => 'api.test.scanpay.dk', 'headers' => [ - 'Authorization' => 'Basic ' . base64_encode($apikey), 'X-Cardholder-IP' => '192.168.1.1', ], - 'curl' => [ - CURLOPT_TIMEOUT => 10, - CURLOPT_SSL_FALSESTART => 1, - CURLOPT_TCP_FASTOPEN => 1, - ], + //'debug' => true, ]; $order = [ diff --git a/tests/seq.php b/tests/seq.php index 93a5b28..d2cc66a 100644 --- a/tests/seq.php +++ b/tests/seq.php @@ -11,6 +11,16 @@ $options = [ 'hostname' => 'api.test.scanpay.dk', 'debug' => true, + // Overwrite the API key (optional) + 'headers' => [ + 'Authorization' => 'Basic ' . base64_encode($apikey), + ], + // Overwrite the cURL options (optional) + 'curl' => [ + CURLOPT_TIMEOUT => 10, + CURLOPT_SSL_FALSESTART => 1, + CURLOPT_TCP_FASTOPEN => 1, + ], ]; $localSeq = 50;