Skip to content

Commit

Permalink
Change some options in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikmoe committed Dec 3, 2018
1 parent 87dd7c3 commit 95fd0b9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 1 addition & 6 deletions tests/newURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down
10 changes: 10 additions & 0 deletions tests/seq.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 95fd0b9

Please sign in to comment.