Skip to content

Commit

Permalink
Merge pull request #6 from Setono/improvements
Browse files Browse the repository at this point in the history
Improvements
  • Loading branch information
igormukhingmailcom authored Jan 6, 2020
2 parents 1c54df6 + 3a2d412 commit dab12ff
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ cache:
matrix:
fast_finish: true
include:
- php: '7.1'
- php: '7.1'
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
- php: '7.2'
- php: '7.2'
env: 'COMPOSER_FLAGS="--prefer-stable --prefer-lowest"'
Expand Down
1 change: 1 addition & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.0/phpunit.xsd"
bootstrap="tests/bootstrap.php"
beStrictAboutTestsThatDoNotTestAnything="false"
colors="true"
verbose="true">
<testsuites>
Expand Down
12 changes: 10 additions & 2 deletions src/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Api
/** @var MessageFactory */
protected $messageFactory;

/** @var array */
/** @var ArrayObject|array */
protected $options = [];

public function __construct(array $options, HttpClientInterface $client, MessageFactory $messageFactory)
Expand Down Expand Up @@ -59,7 +59,15 @@ public function getPayment(ArrayObject $params, bool $create = true): QuickPayPa
/** @var Payment $paymentModel */
$paymentModel = $params['payment'];
if ($create) {
$response = $this->doRequest('POST', 'payments', [
// // You should specify this parameters in order to use Klarna
// ArrayObject::validatedKeysSet([
// 'shipping_address',
// 'invoice_address',
// 'shipping',
// 'basket',
// ]);

$response = $this->doRequest('POST', 'payments', $params->getArrayCopy() + [
'order_id' => $this->getOption('order_prefix').$paymentModel->getNumber(),
'currency' => $paymentModel->getCurrencyCode(),
]);
Expand Down

0 comments on commit dab12ff

Please sign in to comment.