Skip to content
This repository has been archived by the owner on Mar 8, 2023. It is now read-only.

Commit

Permalink
Merge branch 'release/0.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenneth Söderlund committed Mar 24, 2016
2 parents b0512a4 + 95e152b commit 652ddb4
Show file tree
Hide file tree
Showing 30 changed files with 2,511 additions and 1,252 deletions.
15 changes: 5 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
language: php

# Use container-based infrastructure
sudo: false

php:
- 5.3
- 5.4
- 5.5
- 5.6
- 7.0
- hhvm

before_script:
- composer self-update
- composer install --prefer-source
- composer update satooshi/php-coveralls --dev

script: vendor/bin/codecept run unit --coverage --report --xml
script: vendor/bin/codecept run unit --coverage --report --coverage-xml

after_success:
- mkdir build
Expand All @@ -22,9 +22,4 @@ after_success:

matrix:
allow_failures:
- php: 5.3
- php: hhvm

branches:
only:
- master
40 changes: 17 additions & 23 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
Copyright (c) 2013, Christoffer Niska <christoffer.niska@nordsoftware.com>
All rights reserved.
The MIT License (MIT)

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Copyright (c) 2013 Nord Software

Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

Neither the name of the Nord Software nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
35 changes: 28 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
paytrail-php
============

[![Build Status](https://travis-ci.org/nordsoftware/paytrail-php.svg?branch=master)](https://travis-ci.org/nordsoftware/paytrail-php) [![Coverage Status](https://coveralls.io/repos/hugovk/paytrail-php/badge.png?branch=coveralls)](https://coveralls.io/r/hugovk/paytrail-php?branch=coveralls)
[![Build Status](https://travis-ci.org/nordsoftware/paytrail-php.svg?branch=master)](https://travis-ci.org/nordsoftware/paytrail-php) [![Coverage Status](https://coveralls.io/repos/nordsoftware/paytrail-php/badge.png?branch=master)](https://coveralls.io/r/nordsoftware/paytrail-php?branch=master)

Paytrail REST client for PHP.

Expand All @@ -12,12 +12,12 @@ Paytrail REST client for PHP.

require(__DIR__ . '/vendor/autoload.php');

use NordSoftware\Paytrail\Object\UrlSet;
use NordSoftware\Paytrail\Object\Address;
use NordSoftware\Paytrail\Object\Contact;
use NordSoftware\Paytrail\Object\Payment;
use NordSoftware\Paytrail\Object\Product;
use NordSoftware\Paytrail\Http\Client;
use Paytrail\Object\UrlSet;
use Paytrail\Object\Address;
use Paytrail\Object\Contact;
use Paytrail\Object\Payment;
use Paytrail\Object\Product;
use Paytrail\Http\Client;

$urlSet = new UrlSet;
$urlSet->configure(array(
Expand Down Expand Up @@ -76,3 +76,24 @@ try {

header('Location: ' . $result->getUrl());
```

# Confirming a payment

```php

<?php
$client = new Client('13466', '6pKF4jkv97zmqBJ3ZL8gUw5DfT2NMQ');
$client->connect();
if ($client->validateChecksum($_GET["RETURN_AUTHCODE"], $_GET["ORDER_NUMBER"], $_GET["TIMESTAMP"], $_GET["PAID"], $_GET["METHOD"])) {
// Payment receipt is valid
// If needed, the used payment method can be found from the variable $_GET["METHOD"]
// and order number for the payment from the variable $_GET["ORDER_NUMBER"]
}
else {
// Payment receipt was not valid, possible payment fraud attempt
}

```

# License
MIT. See [LICENSE](LICENSE).
51 changes: 30 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
{
"name": "nordsoftware/paytrail-php",
"description": "Paytrail REST client for PHP.",
"license": "BSD-3-Clause",
"authors": [
{
"name": "Christoffer Niska",
"email": "christoffer.niska@nordsoftware.com"
}
],
"require": {
"php": ">=5.3.3",
"guzzle/guzzle": "~3.7"
"name": "nordsoftware/paytrail-php",
"description": "Paytrail REST client for PHP.",
"license": "MIT",
"authors": [
{
"name": "Christoffer Niska",
"email": "christoffer.niska@nordsoftware.com"
},
"require-dev": {
"codeception/codeception": "@stable",
"satooshi/php-coveralls": "dev-master"
},
"autoload": {
"psr-0": {
"NordSoftware": "src/"
}
{
"name": "Kenneth Söderlund",
"email": "kenneth.soderlund@nordsoftware.com"
}
],
"require": {
"php": ">=5.6",
"guzzlehttp/guzzle": "^6.1"
},
"require-dev": {
"codeception/codeception": "@stable",
"satooshi/php-coveralls": "^1.0"
},
"autoload": {
"psr-4": {
"Paytrail\\": "src/"
}
}
},
"autoload-dev": {
"classmap": [
"tests/"
]
}
}

0 comments on commit 652ddb4

Please sign in to comment.