Skip to content

Commit 8049c0e

Browse files
Release 3.0.6
1 parent 6370e33 commit 8049c0e

File tree

62 files changed

+635
-631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+635
-631
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This repository contains the PostFinance Checkout plugin that enables WooCommerc
1616

1717
## Documentation
1818

19-
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.5/docs/en/documentation.html)
19+
* [Documentation](https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.6/docs/en/documentation.html)
2020

2121
## Support
2222

@@ -33,4 +33,4 @@ ____________________________________________________________________________
3333

3434
## License
3535

36-
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.0.5/LICENSE) for more information.
36+
Please see the [license file](https://github.com/pfpayments/woocommerce/blob/3.0.6/LICENSE) for more information.

changelog.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -763,3 +763,10 @@ Tested against:
763763
- [Tested Against] Woocommerce 8.7.0
764764
- [Tested Against] PHP SDK 4.0.2
765765

766+
= 3.0.6 - May 30 2024 =
767+
- [Feature] Upgraded PHP-SDK to 4.2.0
768+
- [Tested Against] PHP 8.2
769+
- [Tested Against] Wordpress 6.5.3
770+
- [Tested Against] Woocommerce 8.9.1
771+
- [Tested Against] PHP SDK 4.2.0
772+

docs/en/documentation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ <h2>Documentation</h2> </div>
2323
</a>
2424
</li>
2525
<li>
26-
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.0.5/">
26+
<a href="https://github.com/pfpayments/woocommerce/releases/tag/3.0.6/">
2727
Source
2828
</a>
2929
</li>

includes/admin/class-wc-postfinancecheckout-admin-settings-page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ public function get_settings() {
187187
$settings = array(
188188
array(
189189
'links' => array(
190-
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.5/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ),
190+
'https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.6/docs/en/documentation.html' => __( 'Documentation', 'woo-postfinancecheckout' ),
191191
'https://checkout.postfinance.ch/en-ch/user/signup' => __( 'Sign Up', 'woo-postfinancecheckout' ),
192192
),
193193
'type' => 'postfinancecheckout_links',

includes/class-wc-postfinancecheckout-migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ public static function check_version() {
249249
public static function plugin_row_meta( $links, $file ) {
250250
if ( WC_POSTFINANCECHECKOUT_PLUGIN_BASENAME === $file ) {
251251
$row_meta = array(
252-
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.5/docs/en/documentation.html" aria-label="' . esc_attr__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
252+
'docs' => '<a href="https://plugin-documentation.postfinance-checkout.ch/pfpayments/woocommerce/3.0.6/docs/en/documentation.html" aria-label="' . esc_attr__( 'View Documentation', 'woo-postfinancecheckout' ) . '">' . esc_html__( 'Documentation', 'woo-postfinancecheckout' ) . '</a>',
253253
);
254254

255255
return array_merge( $links, $row_meta );

postfinancecheckout-sdk/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2023 wallee AG
189+
Copyright 2024 wallee AG
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

postfinancecheckout-sdk/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,44 @@ putenv('PFC_HTTP_CLIENT=curl');
127127
?>
128128
```
129129

130+
### Integrating Webhook Payload Signing Mechanism into webhook callback handler
131+
132+
The HTTP request which is sent for a state change of an entity now includes an additional field `state`, which provides information about the update of the monitored entity's state. This enhancement is a result of the implementation of our webhook encryption mechanism.
133+
134+
Payload field `state` provides direct information about the state update of the entity, making additional API calls to retrieve the entity state redundant.
135+
136+
#### ⚠️ Warning: Generic Pseudocode
137+
138+
> **The provided pseudocode is intentionally generic and serves to illustrate the process of enhancing your API to leverage webhook payload signing. It is not a complete implementation.**
139+
>
140+
> Please ensure that you adapt and extend this code to meet the specific needs of your application, including appropriate security measures and error handling.
141+
For a detailed webhook payload signing mechanism understanding we highly recommend referring to our comprehensive
142+
[Webhook Payload Signing Documentation](https://checkout.postfinance.ch/doc/webhooks#_webhook_payload_signing_mechanism).
143+
144+
```php
145+
public function handleWebhook() {
146+
$requestPayload = file_get_contents('php://input');
147+
$signature = $_SERVER['HTTP_X_SIGNATURE'] ?? '';
148+
149+
if (empty($signature)) {
150+
// Make additional API call to retrieve the entity state
151+
// ...
152+
} else {
153+
if ($client->getWebhookEncryptionService()->isContentValid($signature, $requestPayload)) {
154+
// Parse requestPayload to extract 'state' value
155+
// $state = ...
156+
// Process entity's state change
157+
// $this->processEntityStateChange($state);
158+
// ...
159+
}
160+
}
161+
162+
// Process the received webhook data
163+
// ...
164+
165+
}
166+
```
167+
130168
## License
131169

132170
Please see the [license file](https://github.com/pfpayments/php-sdk/blob/master/LICENSE) for more information.

postfinancecheckout-sdk/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "postfinancecheckout/sdk",
3-
"version": "4.0.2",
3+
"version": "4.2.0",
44
"description": "PostFinance Checkout SDK for PHP",
55
"keywords": [
66
"postfinancecheckout",

postfinancecheckout-sdk/lib/ApiClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class ApiClient {
4848
* @var array
4949
*/
5050
private $defaultHeaders = [
51-
'x-meta-sdk-version' => "4.0.2",
51+
'x-meta-sdk-version' => "4.2.0",
5252
'x-meta-sdk-language' => 'php',
5353
'x-meta-sdk-provider' => "PostFinance Checkout",
5454
];
@@ -58,7 +58,7 @@ final class ApiClient {
5858
*
5959
* @var string
6060
*/
61-
private $userAgent = 'PHP-Client/4.0.2/php';
61+
private $userAgent = 'PHP-Client/4.2.0/php';
6262

6363
/**
6464
* The path to the certificate authority file.

postfinancecheckout-sdk/lib/Configuration.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Configuration
8080
*
8181
* @var string
8282
*/
83-
protected $userAgent = 'PostFinanceCheckout\Sdk/4.0.2/php';
83+
protected $userAgent = 'PostFinanceCheckout\Sdk/4.2.0/php';
8484

8585
/**
8686
* Debug switch (default set to false)
@@ -388,8 +388,8 @@ public static function toDebugReport()
388388
$report = 'PHP SDK (PostFinanceCheckout\Sdk) Debug Report:' . PHP_EOL;
389389
$report .= ' OS: ' . php_uname() . PHP_EOL;
390390
$report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL;
391-
$report .= ' OpenAPI Spec Version: 4.0.2' . PHP_EOL;
392-
$report .= ' SDK Package Version: 4.0.2' . PHP_EOL;
391+
$report .= ' OpenAPI Spec Version: 4.2.0' . PHP_EOL;
392+
$report .= ' SDK Package Version: 4.2.0' . PHP_EOL;
393393
$report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL;
394394

395395
return $report;

0 commit comments

Comments
 (0)