Skip to content

Commit ef854cd

Browse files
committed
Updates for php sdk
1 parent 8d73114 commit ef854cd

12 files changed

Lines changed: 119 additions & 33 deletions

File tree

composer.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/composer/installed.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -336,17 +336,17 @@
336336
},
337337
{
338338
"name": "paynl/php-sdk",
339-
"version": "1.0.4",
340-
"version_normalized": "1.0.4.0",
339+
"version": "1.0.7",
340+
"version_normalized": "1.0.7.0",
341341
"source": {
342342
"type": "git",
343343
"url": "https://github.com/paynl/php-sdk.git",
344-
"reference": "cf703fcb9d705712c4196d3589ebc113d2b214b7"
344+
"reference": "ca571e5fc28276e4d6d577a7e5a904d26647b42c"
345345
},
346346
"dist": {
347347
"type": "zip",
348-
"url": "https://api.github.com/repos/paynl/php-sdk/zipball/cf703fcb9d705712c4196d3589ebc113d2b214b7",
349-
"reference": "cf703fcb9d705712c4196d3589ebc113d2b214b7",
348+
"url": "https://api.github.com/repos/paynl/php-sdk/zipball/ca571e5fc28276e4d6d577a7e5a904d26647b42c",
349+
"reference": "ca571e5fc28276e4d6d577a7e5a904d26647b42c",
350350
"shasum": ""
351351
},
352352
"require": {
@@ -366,7 +366,7 @@
366366
"squizlabs/php_codesniffer": "^3",
367367
"symfony/var-dumper": "^7"
368368
},
369-
"time": "2025-07-27T16:01:30+00:00",
369+
"time": "2025-09-29T14:56:34+00:00",
370370
"type": "library",
371371
"installation-source": "dist",
372372
"autoload": {
@@ -393,7 +393,7 @@
393393
"support": {
394394
"email": "webshop@pay.nl",
395395
"issues": "https://github.com/paynl/php-sdk/issues",
396-
"source": "https://github.com/paynl/php-sdk/tree/v1.0.4"
396+
"source": "https://github.com/paynl/php-sdk/tree/v1.0.7"
397397
},
398398
"install-path": "../paynl/php-sdk"
399399
},

vendor/composer/installed.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838
'dev_requirement' => false,
3939
),
4040
'paynl/php-sdk' => array(
41-
'pretty_version' => '1.0.4',
42-
'version' => '1.0.4.0',
43-
'reference' => 'cf703fcb9d705712c4196d3589ebc113d2b214b7',
41+
'pretty_version' => '1.0.7',
42+
'version' => '1.0.7.0',
43+
'reference' => 'ca571e5fc28276e4d6d577a7e5a904d26647b42c',
4444
'type' => 'library',
4545
'install_path' => __DIR__ . '/../paynl/php-sdk',
4646
'aliases' => array(),

vendor/paynl/php-sdk/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "paynl/php-sdk",
33
"description": "Software Development Kit for implementing Pay.'s API version 3",
4-
"version": "1.0.4",
4+
"version": "1.0.7",
55
"type": "library",
66
"require": {
77
"php": "^8.1",

vendor/paynl/php-sdk/samples/OrderStatus.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929

3030
echo '<pre>';
3131
echo 'Success, values:' . PHP_EOL . PHP_EOL;
32-
3332
echo 'type: ' . $payOrder->getType() . PHP_EOL;
33+
echo 'getCustomerId: ' . $payOrder->getCustomerId() . PHP_EOL;
34+
echo 'getCustomerName: ' . $payOrder->getCustomerName() . PHP_EOL;
3435
echo 'isPending: ' . ($payOrder->isPending() ? 'YES' : 'no') . PHP_EOL;
3536
echo 'isPaid: ' . ($payOrder->isPaid() ? 'YES' : 'no') . PHP_EOL;
3637
echo 'isAuthorized: ' . ($payOrder->isAuthorized() ? 'YES' : 'no') . PHP_EOL;

vendor/paynl/php-sdk/samples/TransactionRefund.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
$transactionRefundRequest = new TransactionRefundRequest($transactionId);
1515

16+
if (!empty($_REQUEST['refundamount'])) {
17+
$transactionRefundRequest->setAmount((float)$_REQUEST['refundamount']);
18+
}
19+
1620
# $transactionRefundRequest->addProduct('p1',1);
1721
# $transactionRefundRequest->addProduct('p2',2);
1822
# $transactionRefundRequest->setAmount(5.3);

vendor/paynl/php-sdk/src/Model/Pay/PayLoad.php

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,27 @@ public function __construct(array $payload)
4444
$this->checkoutData = is_array($payload['checkout_data'] ?? null) ? $payload['checkout_data'] : [];
4545
$this->fullPayLoad = is_array($payload['full_payload'] ?? null) ? $payload['full_payload'] : [];
4646

47-
$this->extra1 = (string)($this->fullPayLoad['extra1'] ?? '');
48-
$this->extra2 = (string)($this->fullPayLoad['extra2'] ?? '');
49-
$this->extra3 = (string)($this->fullPayLoad['extra3'] ?? '');
47+
$payload = $this->isTguLoad() ? $this->fullPayLoad['object'] : $this->fullPayLoad;
48+
49+
$this->extra1 = (string)($payload['extra1'] ?? $payload['stats']['extra1'] ?? '');
50+
$this->extra2 = (string)($payload['extra2'] ?? $payload['stats']['extra2'] ?? '');
51+
$this->extra3 = (string)($payload['extra3'] ?? $payload['stats']['extra3'] ?? '');
52+
}
53+
54+
/**
55+
* @return bool
56+
*/
57+
public function isTguLoad(): bool
58+
{
59+
return !isset($this->fullPayLoad['action']);
60+
}
61+
62+
/**
63+
* @return bool
64+
*/
65+
public function isLegacyPayLoad(): bool
66+
{
67+
return !$this->isTguLoad();
5068
}
5169

5270
/**

vendor/paynl/php-sdk/src/Model/Pay/PayOrder.php

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class PayOrder implements ModelInterface
2323
/**
2424
* @var string
2525
*/
26-
protected string $type;
26+
private ?string $type = null;
2727

2828
/**
2929
* @var string
@@ -98,7 +98,7 @@ class PayOrder implements ModelInterface
9898
/**
9999
* @var array
100100
*/
101-
protected $payments;
101+
private ?array $payments = null;
102102

103103
/**
104104
* @var string
@@ -473,7 +473,22 @@ public function getPaymentMethod()
473473
return $this->payments[0]['paymentMethod']['id'] ?? null;
474474
}
475475

476+
/**
477+
* @return string|null
478+
*/
479+
public function getCustomerId(): ?string
480+
{
481+
return $this->payments[0]['customerId'] ?? null;
482+
}
476483

484+
/**
485+
* @return string|null
486+
*/
487+
public function getCustomerName(): ?string
488+
{
489+
return $this->payments[0]['customerName'] ?? null;
490+
}
491+
477492
/**
478493
* @param Amount $amount
479494
* @return $this
@@ -543,7 +558,7 @@ public function setCheckoutData(array $checkoutData): self
543558
*/
544559
public function getPayments(): array
545560
{
546-
return $this->payments;
561+
return (array)$this->payments;
547562
}
548563

549564
/**
@@ -743,6 +758,15 @@ public function isAuthorized(): bool
743758
return (new PayStatus())->get($this->getStatusCode()) === PayStatus::AUTHORIZE;
744759
}
745760

761+
/**
762+
* @return boolean
763+
* @throws Exception
764+
*/
765+
public function isDenied(): bool
766+
{
767+
return (new PayStatus())->get($this->getStatusCode()) === PayStatus::DENIED;
768+
}
769+
746770
/**
747771
* @return boolean
748772
* @throws Exception

vendor/paynl/php-sdk/src/Model/Product.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class Product implements ModelInterface, JsonSerializable
5959
/**
6060
* @var string
6161
*/
62-
protected string $vatCode;
62+
protected ?string $vatCode = null;
6363

6464
/**
6565
* @var float|null

vendor/paynl/php-sdk/src/Model/Request/TransactionRefundRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public function getBodyParameters(): array
9494
}
9595

9696
/**
97-
* @param float $amount
97+
* @param float $amount Whole amount. Not in cents.
9898
* @return $this
9999
*/
100100
public function setAmount(float $amount): self

0 commit comments

Comments
 (0)