Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnnipay v3.0 #22

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Basic-CI

on: [push, pull_request]

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.3', '7.4', '8.0', '8.1', '8.2']
name: PHP ${{ matrix.php-versions }} Test on ${{ matrix.operating-system }}
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
coverage: none

- name: Install dependencies
run: |
composer install --no-interaction --no-progress --optimize-autoloader

- name: run Tests
run: |
php $GITHUB_WORKSPACE/vendor/bin/phpunit --configuration $GITHUB_WORKSPACE/phpunit.xml.dist --colors=never
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ composer.lock
vendor
composer.phar
.idea
/.phpunit.result.cache
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Developer Docs: http://www.polipaymentdeveloper.com/
[![Total Downloads](https://poser.pugx.org/burnbright/omnipay-poli/d/total.png)](https://packagist.org/packages/burnbright/omnipay-poli)

[Omnipay](https://github.com/omnipay/omnipay) is a framework agnostic, multi-gateway payment
processing library for PHP 5.3+. This package implements Poli support for Omnipay.
processing library for PHP 7.2+. This package implements Poli support for Omnipay.

## Installation

Expand All @@ -20,7 +20,7 @@ to your `composer.json` file:
```json
{
"require": {
"burnbright/omnipay-poli": "~2.0"
"burnbright/omnipay-poli": "~3.0"
}
}
```
Expand Down
24 changes: 18 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
"name": "Sid Bachtiar",
"email": "sid.bachtiar@gmail.com",
"homepage": "http://onlinesid.com"
},
{
"name": "Toby Evans",
"email": "tobz.nz@gmail.com",
"homepage": "https://tobz.nz"
}
],
"autoload": {
Expand All @@ -30,15 +35,22 @@
}
},
"require": {
"php": ">=7.1",
"omnipay/common": "^3.0"
"php": ">=7.3",
"omnipay/common": "^3.2",
"symfony/http-client": "^5.4"
},
"require-dev": {
"mockery/mockery": "^1.3",
"squizlabs/php_codesniffer": "^3.5",
"phpunit/phpunit": "~6",
"omnipay/tests": "^3.1"
"phpunit/phpunit": "^9.6",
"mockery/mockery": "^1.5",
"squizlabs/php_codesniffer": "^3.7",
"omnipay/tests": "^4.1",
"http-interop/http-factory-guzzle": "^1.2"
},
"extra": {
},
"config": {
"allow-plugins": {
"php-http/discovery": true
}
}
}
26 changes: 11 additions & 15 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
backupStaticAttributes="false"
bootstrap="tests/bootstrap.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Omnipay Test Suite">
<directory>./tests/</directory>
</testsuite>
</testsuites>
<listeners>
<listener class="Mockery\Adapter\Phpunit\TestListener" file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" />
<listener
class="Mockery\Adapter\Phpunit\TestListener"
file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" />
</listeners>
<filter>
<whitelist>
<directory>./src</directory>
</whitelist>
</filter>
</phpunit>
11 changes: 5 additions & 6 deletions tests/GatewayTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

class GatewayTest extends GatewayTestCase
{

public function setUp()
public function setUp(): void
{
parent::setUp();
$this->gateway = new Gateway($this->getHttpClient(), $this->getHttpRequest());
Expand All @@ -17,7 +16,7 @@ public function setUp()
$this->gateway->setAuthenticationCode('a;sldkfjasdf;aladjs');
}

public function testproductionMode()
public function testproductionMode(): void
{
$this->assertEquals(
"https://poliapi.apac.paywithpoli.com/api/v2/Transaction/Initiate",
Expand All @@ -40,17 +39,17 @@ public function testTestMode()
$this->gateway->setTestMode(true);

$this->assertEquals(
"https://poliapi.uat1.paywithpoli.com/api/v2/Transaction/Initiate",
"https://poliapi.uat3.paywithpoli.com/api/v2/Transaction/Initiate",
$this->gateway->purchase()->getEndpoint()
);

$this->assertEquals(
"https://poliapi.uat1.paywithpoli.com/api/v2/Transaction/GetTransaction",
"https://poliapi.uat3.paywithpoli.com/api/v2/Transaction/GetTransaction",
$this->gateway->fetchCheckout()->getEndpoint()
);

$this->assertEquals(
"https://poliapi.uat1.paywithpoli.com/api/v2/Transaction/GetTransaction",
"https://poliapi.uat3.paywithpoli.com/api/v2/Transaction/GetTransaction",
$this->gateway->completePurchase()->getEndpoint()
);
}
Expand Down
3 changes: 2 additions & 1 deletion tests/Message/PurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@

class PurchaseRequestTest extends TestCase
{
protected $request;

public function setUp()
public function setUp(): void
{
$this->request = new PurchaseRequest($this->getHttpClient(), $this->getHttpRequest());
}
Expand Down