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

Commit

Permalink
Merge pull request #169 from heidelpay/develop
Browse files Browse the repository at this point in the history
Release Version 1.2.7.1
  • Loading branch information
Simon Gabriel authored Apr 21, 2020
2 parents 8cf1b76 + 4b07ffe commit 379d1df
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 43 deletions.
36 changes: 3 additions & 33 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,61 +3,31 @@ dist: trusty
matrix:
fast_finish: true
include:
- name: "php 7.0 (install) - unit"
php: 7.0
env:
- DEPS=NO
- LEVEL=UNIT
- name: "php 7.0 (update) - unit"
php: 7.0
env:
- DEPS=HIGH
- LEVEL=UNIT
- name: "php 7.0 (update) - integration"
php: 7.0
env:
- DEPS=HIGH
- LEVEL=INTEGRATION
- name: "php 7.1 (install) - unit"
php: 7.1
env:
- DEPS=NO
- LEVEL=UNIT
- name: "php 7.1 (update) - unit"
- name: "php 7.1 (install) - integration"
php: 7.1
env:
- DEPS=HIGH
- LEVEL=UNIT
- DEPS=NO
- LEVEL=INTEGRATION
- name: "php 7.2 (install) - unit"
php: 7.2
env:
- DEPS=NO
- LEVEL=UNIT
- name: "php 7.2 (update) - unit"
php: 7.2
env:
- DEPS=HIGH
- LEVEL=UNIT
- name: "php 7.3 (install) - unit"
php: 7.3
env:
- DEPS=NO
- LEVEL=UNIT
- name: "php 7.3 (update) - unit"
php: 7.3
env:
- DEPS=HIGH
- LEVEL=UNIT
- name: "php 7.4 (install) - unit"
php: 7.4
env:
- DEPS=NO
- LEVEL=UNIT
- name: "php 7.4 (update) - unit"
php: 7.4
env:
- DEPS=HIGH
- LEVEL=UNIT
cache:
directories:
- $HOME/.composer/cache
Expand Down
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [1.2.7.1][1.2.7.1]

### Added
* PHP version to HTTP header.

### Remove
* PHP7.0 support.
* Travis tests using composer update.

### Fix
* Changed date format string to support times with 24h-format.

## [1.2.7.0][1.2.7.0]

### Added
Expand Down Expand Up @@ -381,3 +393,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
[1.2.5.1]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.5.0..1.2.5.1
[1.2.6.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.5.1..1.2.6.0
[1.2.7.0]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.6.0..1.2.7.0
[1.2.7.1]: https://github.com/heidelpay/heidelpayPHP/compare/1.2.7.0..1.2.7.1
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[![Latest Version on Packagist](https://img.shields.io/packagist/v/heidelpay/heidelpay-php.svg?style=flat-square)](https://packagist.org/packages/heidelpay/heidelpay-php)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a5fceb1b4f674fb49db39929559f3959)](https://www.codacy.com/app/heidelpay/heidelpayPHP?utm_source=github.com&utm_medium=referral&utm_content=heidelpay/heidelpayPHP&utm_campaign=Badge_Grade)
[![Codacy Badge](https://api.codacy.com/project/badge/Coverage/a5fceb1b4f674fb49db39929559f3959)](https://www.codacy.com/app/heidelpay/heidelpayPHP?utm_source=github.com&utm_medium=referral&utm_content=heidelpay/heidelpayPHP&utm_campaign=Badge_Coverage)
[![PHP 7.0](https://img.shields.io/badge/php-7.0-blue.svg)](http://www.php.net)
[![PHP 7.1](https://img.shields.io/badge/php-7.1-blue.svg)](http://www.php.net)
[![PHP 7.2](https://img.shields.io/badge/php-7.2-blue.svg)](http://www.php.net)
[![PHP 7.3](https://img.shields.io/badge/php-7.3-blue.svg)](http://www.php.net)
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "~7.0.0|~7.1.0|~7.2.0|~7.3.0|~7.4.0",
"php": "~7.1.0|~7.2.0|~7.3.0|~7.4.0",
"ext-json": "*"
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/Heidelpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class Heidelpay implements HeidelpayParentInterface, PaymentServiceInterface, Re
const BASE_URL = 'api.heidelpay.com';
const API_VERSION = 'v1';
const SDK_TYPE = 'HeidelpayPHP';
const SDK_VERSION = '1.2.7.0';
const SDK_VERSION = '1.2.7.1';

/** @var string $key */
private $key;
Expand Down
4 changes: 3 additions & 1 deletion src/Services/HttpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
use heidelpayPHP\Resources\AbstractHeidelpayResource;
use RuntimeException;
use function in_array;
use const PHP_VERSION;

class HttpService
{
Expand Down Expand Up @@ -261,7 +262,8 @@ public function composerHttpHeaders(Heidelpay $heidelpay): array
'Authorization' => 'Basic ' . base64_encode($key . ':'),
'Content-Type' => 'application/json',
'SDK-VERSION' => Heidelpay::SDK_VERSION,
'SDK-TYPE' => Heidelpay::SDK_TYPE
'SDK-TYPE' => Heidelpay::SDK_TYPE,
'PHP-VERSION' => PHP_VERSION
];
if (!empty($locale)) {
$httpHeaders['Accept-Language'] = $locale;
Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HasDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ trait HasDate
public function getDate()
{
$date = $this->date;
return $date ? $date->format('Y-m-d h:i:s') : null;
return $date ? $date->format('Y-m-d H:i:s') : null;
}

/**
Expand Down
4 changes: 1 addition & 3 deletions test/integration/PaymentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@

use heidelpayPHP\Constants\ApiResponseCodes;
use heidelpayPHP\Exceptions\HeidelpayApiException;
use heidelpayPHP\Resources\Payment;
use heidelpayPHP\Resources\PaymentTypes\Card;
use heidelpayPHP\Resources\PaymentTypes\Paypal;
use heidelpayPHP\Resources\TransactionTypes\Authorization;
Expand All @@ -45,11 +44,10 @@ class PaymentTest extends BasePaymentTest
* @throws HeidelpayApiException A HeidelpayApiException is thrown if there is an error returned on API-request.
* @throws RuntimeException A RuntimeException is thrown when there is an error while using the SDK.
*/
public function paymentShouldBeFetchableById()
public function paymentShouldBeFetchableById(): void
{
$authorize = $this->createPaypalAuthorization();
$payment = $this->heidelpay->fetchPayment($authorize->getPayment()->getId());
$this->assertNotNull(Payment::class, $payment);
$this->assertNotEmpty($payment->getId());
$this->assertInstanceOf(Authorization::class, $payment->getAuthorization());
$this->assertNotEmpty($payment->getAuthorization()->getId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function theGettersAndSettersShouldWorkProperly()
$this->assertNull($transactionType->getRedirectUrl());

$payment->setId('MyPaymentId');
$date = (new DateTime('now'))->format('Y-m-d h:i:s');
$date = (new DateTime('now'))->format('Y-m-d H:i:s');
$transactionType->setPayment($payment);
$transactionType->setDate($date);
$transactionType->handleResponse((object)['isError' => true, 'isPending' => true, 'isSuccess' => true]);
Expand Down
4 changes: 3 additions & 1 deletion test/unit/Services/HttpServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use PHPUnit\Framework\Exception;
use ReflectionException;
use RuntimeException;
use const PHP_VERSION;

class HttpServiceTest extends BasePaymentTest
{
Expand Down Expand Up @@ -128,7 +129,8 @@ static function ($url) {
'Authorization' => 'Basic cy1wcml2LU15VGVzdEtleTo=',
'Content-Type' => 'application/json',
'SDK-VERSION' => Heidelpay::SDK_VERSION,
'SDK-TYPE' => Heidelpay::SDK_TYPE
'SDK-TYPE' => Heidelpay::SDK_TYPE,
'PHP-VERSION' => PHP_VERSION
];
$adapterMock->expects($this->once())->method('setHeaders')->with($headers);
$adapterMock->expects($this->once())->method('execute')->willReturn('myResponseString');
Expand Down

0 comments on commit 379d1df

Please sign in to comment.