Skip to content
This repository was archived by the owner on Jan 25, 2024. It is now read-only.

Commit 552f01e

Browse files
committed
Release 1.0.32
1 parent b711acb commit 552f01e

File tree

439 files changed

+139884
-80260
lines changed

Some content is hidden

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

439 files changed

+139884
-80260
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ This repository contains the OpenCart wallee payment module that enables the sh
1111

1212
## Documentation
1313

14-
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.31/docs/en/documentation.html)
14+
* [English](https://plugin-documentation.wallee.com/wallee-payment/opencart-2.0/1.0.32/docs/en/documentation.html)
1515

1616
## License
1717

18-
Please see the [license file](https://github.com/wallee-payment/opencart-2.0/blob/1.0.31/LICENSE) for more information.
18+
Please see the [license file](https://github.com/wallee-payment/opencart-2.0/blob/1.0.32/LICENSE) for more information.

docs/en/documentation.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h2>Documentation</h2> </div>
2121
</a>
2222
</li>
2323
<li>
24-
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.31/">
24+
<a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.32/">
2525
Source
2626
</a>
2727
</li>
@@ -48,7 +48,7 @@ <h1>
4848
<div class="olist arabic">
4949
<ol class="arabic">
5050
<li>
51-
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.31/">Download</a> the extension.</p>
51+
<p><a href="https://github.com/wallee-payment/opencart-2.0/releases/tag/1.0.32/">Download</a> the extension.</p>
5252
</li>
5353
<li>
5454
<p>Extract the files and upload the content of the <code>Upload</code> directory into the root directory of your store using FTP/SSH.</p>

upload/system/library/wallee/service/transaction.php

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
use Wallee\Sdk\Service\ChargeAttemptService;
66
use Wallee\Sdk\Service\TransactionService;
7-
use Wallee\Sdk\Model\TransactionPending;
7+
use Wallee\Sdk\Service\TransactionIframeService;
8+
use Wallee\Sdk\Service\TransactionPaymentPageService;
89

910
/**
1011
* This service provides functions to deal with Wallee transactions.
@@ -40,12 +41,12 @@ public function getJavascriptUrl(){
4041
\Wallee\Sdk\Model\TransactionState::PENDING
4142
));
4243
$this->persist($transaction, array());
43-
return $this->getTransactionService()->buildJavaScriptUrl($transaction->getLinkedSpaceId(), $transaction->getId());
44+
return $this->getIframeService()->javascriptUrl($transaction->getLinkedSpaceId(), $transaction->getId());
4445
}
4546

4647
public function getPaymentPageUrl(\Wallee\Sdk\Model\Transaction $transaction, $paymentCode){
4748
$paymentMethodId = \WalleeHelper::extractPaymentMethodId($paymentCode);
48-
return $this->getTransactionService()->buildPaymentPageUrl($transaction->getLinkedSpaceId(), $transaction->getId()) .
49+
return $this->getPaymentPageService()->paymentPageUrl($transaction->getLinkedSpaceId(), $transaction->getId()) .
4950
'&paymentMethodConfigurationId=' . $paymentMethodId;
5051
}
5152

@@ -259,6 +260,20 @@ private function assembleTransaction(\Wallee\Sdk\Model\AbstractTransactionPendin
259260
* @var \Wallee\Sdk\Service\ChargeAttemptService
260261
*/
261262
private $charge_attempt_service;
263+
264+
/**
265+
* The iframe API service, to retrieve JS url
266+
*
267+
* @var \Wallee\Sdk\Service\TransactionIframeService
268+
*/
269+
private $transaction_iframe_service;
270+
271+
/**
272+
* The payment page API service, tro retrieve pp URL
273+
*
274+
* @var \Wallee\Sdk\Service\TransactionPaymentPageService
275+
*/
276+
private $transaction_payment_page_service;
262277

263278
/**
264279
* Returns the transaction API service.
@@ -283,7 +298,31 @@ private function getChargeAttemptService(){
283298
}
284299
return $this->charge_attempt_service;
285300
}
286-
301+
302+
/**
303+
* Returns the transaction API service.
304+
*
305+
* @return \Wallee\Sdk\Service\TransactionIframeService
306+
*/
307+
private function getIframeService(){
308+
if ($this->transaction_iframe_service === null) {
309+
$this->transaction_iframe_service = new TransactionIframeService(\WalleeHelper::instance($this->registry)->getApiClient());
310+
}
311+
return $this->transaction_iframe_service;
312+
}
313+
314+
/**
315+
* Returns the transaction API service.
316+
*
317+
* @return \Wallee\Sdk\Service\TransactionPaymentPageService
318+
*/
319+
private function getPaymentPageService(){
320+
if ($this->transaction_payment_page_service === null) {
321+
$this->transaction_payment_page_service = new TransactionPaymentPageService(\WalleeHelper::instance($this->registry)->getApiClient());
322+
}
323+
return $this->transaction_payment_page_service;
324+
}
325+
287326
/**
288327
* Updates the line items to be in line with the current order.
289328
*
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
return PhpCsFixer\Config::create()
4+
->setUsingCache(true)
5+
->setRules([
6+
'@PSR2' => true,
7+
'ordered_imports' => true,
8+
'phpdoc_order' => true,
9+
'array_syntax' => [ 'syntax' => 'short' ],
10+
'strict_comparison' => true,
11+
'strict_param' => true,
12+
'no_trailing_whitespace' => false,
13+
'no_trailing_whitespace_in_comment' => false,
14+
'braces' => false,
15+
'single_blank_line_at_eof' => false,
16+
'blank_line_after_namespace' => false,
17+
])
18+
->setFinder(
19+
PhpCsFixer\Finder::create()
20+
->exclude('test')
21+
->exclude('tests')
22+
->in(__DIR__)
23+
);
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
language: php
22
sudo: false
33
php:
4-
- 5.4
54
- 5.6
6-
- 7.0
7-
- 7.1
85
before_install: "composer install"
9-
script: "phpunit --bootstrap autoload.php test/"
6+
script: "phpunit --bootstrap autoload.php test/"

upload/system/library/wallee/wallee-sdk/LICENSE

Lines changed: 2 additions & 2 deletions
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 {yyyy} {name of copyright owner}
189+
Copyright 2019 customweb GmbH
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.
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

upload/system/library/wallee/wallee-sdk/README.md

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
[![Build Status](https://travis-ci.org/wallee-payment/php-sdk.svg?branch=master)](https://travis-ci.org/wallee-payment/php-sdk)
22

3-
# wallee SDK for PHP
3+
# wallee PHP Library
44

5-
This repository contains the open source PHP SDK that allows you to access wallee from your PHP app.
5+
The wallee PHP library wraps around the wallee API. This library facilitates your interaction with various services such as transactions, accounts, and subscriptions.
66

7-
## Requirements
8-
9-
* [PHP 5.6.0 and later](http://www.php.net/)
107

118
## Documentation
129

13-
https://app-wallee.com/doc/api/web-service
10+
[wallee Web Service API](https://app-wallee.com/doc/api/web-service)
11+
12+
## Requirements
13+
14+
- PHP 5.6.0 and above
1415

1516
## Installation
1617

@@ -39,24 +40,44 @@ require_once '/path/to/php-sdk/autoload.php';
3940
```
4041

4142
## Usage
43+
The library needs to be configured with your account's space id, user id, and secret key which are available in your [wallee
44+
account dashboard](https://app-wallee.com/account/select). Set `space_id`, `user_id`, and `api_secret` to their values.
4245

43-
### Basic Example
46+
### Configuring a Service
4447

4548
```php
46-
<?php
49+
require_once(__DIR__ . '/autoload.php');
50+
51+
// Configuration
52+
$spaceId = 405;
53+
$userId = 512;
54+
$secret = 'FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=';
55+
56+
// Setup API client
57+
$client = new \Wallee\Sdk\ApiClient($userId, $secret);
58+
59+
// Create API service instance
60+
$transactionService = new \Wallee\Sdk\Service\TransactionService($client);
61+
$transactionPaymentPageService = new \Wallee\Sdk\Service\TransactionPaymentPageService($client);
62+
63+
```
64+
65+
To get started with sending transactions, please review the example below:
4766

67+
```php
4868
require_once(__DIR__ . '/autoload.php');
4969

5070
// Configuration
5171
$spaceId = 405;
5272
$userId = 512;
53-
$secret = "FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=";
73+
$secret = 'FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=';
5474

5575
// Setup API client
5676
$client = new \Wallee\Sdk\ApiClient($userId, $secret);
5777

5878
// Create API service instance
5979
$transactionService = new \Wallee\Sdk\Service\TransactionService($client);
80+
$transactionPaymentPageService = new \Wallee\Sdk\Service\TransactionPaymentPageService($client);
6081

6182
// Create transaction
6283
$lineItem = new \Wallee\Sdk\Model\LineItemCreate();
@@ -69,19 +90,44 @@ $lineItem->setType(\Wallee\Sdk\Model\LineItemType::PRODUCT);
6990

7091

7192
$transaction = new \Wallee\Sdk\Model\TransactionCreate();
72-
$transaction->setCurrency("EUR");
93+
$transaction->setCurrency('EUR');
7394
$transaction->setLineItems(array($lineItem));
7495
$transaction->setAutoConfirmationEnabled(true);
7596

7697
$createdTransaction = $transactionService->create($spaceId, $transaction);
7798

7899
// Create Payment Page URL:
79-
$redirectionUrl = $transactionService->buildPaymentPageUrl($spaceId, $createdTransaction->getId());
100+
$redirectionUrl = $transactionPaymentPageService->paymentPageUrl($spaceId, $createdTransaction->getId());
80101

81102
header('Location: ' . $redirectionUrl);
82103

104+
```
105+
### HTTP Client
106+
You can either use `php curl` or `php socket` extentions. It is recommend you install the necessary extentions and enable them on your system.
107+
108+
You have to ways two specify which HTTP client you prefer.
109+
110+
```php
111+
$userId = 512;
112+
$secret = 'FKrO76r5VwJtBrqZawBspljbBNOxp5veKQQkOnZxucQ=';
113+
114+
// Setup API client
115+
$client = new \Wallee\Sdk\Sdk\ApiClient($userId, $secret);
116+
117+
$httpClientType = \Wallee\Sdk\Sdk\Http\HttpClientFactory::TYPE_CURL; // or \Wallee\Sdk\Sdk\Http\HttpClientFactory::TYPE_SOCKET
118+
119+
$client->setHttpClientType($httpClientType);
120+
```
121+
122+
You can also specify the HTTP client via the `WLE_HTTP_CLIENT` environment variable. The possible string values are `curl` or `socket`.
123+
124+
125+
```php
126+
<?php
127+
putenv('WLE_HTTP_CLIENT=curl');
128+
?>
83129
```
84130

85131
## License
86132

87-
Please see the [license file](LICENSE) for more information.
133+
Please see the [license file](https://github.com/wallee-payment/php-sdk/blob/master/LICENSE) for more information.

upload/system/library/wallee/wallee-sdk/autoload.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
/**
3-
* wallee SDK
3+
* SDK
44
*
5-
* This library allows to interact with the wallee payment service.
6-
* wallee SDK: 1.0.0
5+
* This library allows to interact with the payment service.
6+
* SDK: 2.0.4
77
*
88
*
99
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -22,6 +22,8 @@
2222
/**
2323
* Autoload function.
2424
*
25+
* @author customweb GmbH
26+
2527
* After registering this autoload function with SPL, the following line
2628
* would cause the function to attempt to load the \Wallee\Sdk\Baz\Qux class
2729
* from /path/to/project/lib/Baz/Qux.php:

upload/system/library/wallee/wallee-sdk/composer.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
2-
"name": "wallee/sdk",
2+
"name": "wallee/sdk",
3+
"version": "2.0.4",
34
"description": "wallee SDK for PHP",
45
"keywords": [
56
"wallee",
@@ -8,7 +9,7 @@
89
"sdk",
910
"api"
1011
],
11-
"homepage": "https://www.wallee.com",
12+
"homepage": "http://github.com/wallee-payment/php-sdk",
1213
"license": "Apache-2.0",
1314
"authors": [
1415
{
@@ -17,7 +18,7 @@
1718
}
1819
],
1920
"require": {
20-
"php": ">=5.4",
21+
"php": ">=5.6",
2122
"ext-json": "*",
2223
"ext-mbstring": "*"
2324
},
@@ -30,4 +31,4 @@
3031
"autoload-dev": {
3132
"psr-4": { "Wallee\\Sdk\\" : "test/" }
3233
}
33-
}
34+
}

0 commit comments

Comments
 (0)