Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
556e0ce
Added basic .gitignore with sensible defaults
Dec 9, 2024
2cc6ac1
Updated: README.md
Dec 9, 2024
864c5de
Updated: Composer packages / use composer default bin dir / https only
Dec 9, 2024
daeb22b
Added basic .gitignore with sensible defaults
Dec 9, 2024
c70a165
Updated: README.md
Dec 9, 2024
5f87dea
Updated: Composer packages / use composer default bin dir / https only
Dec 9, 2024
d81da1a
Merge branch 'feature-composer'
Dec 9, 2024
f8f139a
Merge branch 'feature-readme'
Dec 9, 2024
e9957cd
Merge branch 'feature-git-ignore'
Dec 9, 2024
95971d0
Removed: build dir
Dec 9, 2024
dbee7c8
autoloader update without build dir
Dec 9, 2024
6384728
autoloader update without build dir
Dec 9, 2024
71b4f34
Merge pull request #12 from rikgirbes/feature-php8-other
woutse Jan 23, 2025
7e51c58
Updates
woutse Jan 23, 2025
5a33049
Updates
woutse Jan 23, 2025
34cb61d
Updates
woutse Jan 23, 2025
3898a5d
Updates
woutse Jan 23, 2025
24f1641
Updates
woutse Jan 23, 2025
8827b78
Updates
woutse Jan 25, 2025
83e1e75
Updates
woutse Jan 25, 2025
b6822df
Update composer.json
woutse Jan 27, 2025
15eeab2
Updated composer.json
woutse Jan 27, 2025
e2194b1
Updates for unit tests
woutse Jan 27, 2025
84b4ddc
Updates for unit tests
woutse Jan 28, 2025
d988ae4
Updates for unit tests
woutse Jan 28, 2025
c4849ad
Merge remote-tracking branch 'origin/rikbranch' into unittets
woutse Jan 30, 2025
1d84b3b
Code polish
woutse Jan 30, 2025
9de8198
Updated min php version
woutse Jan 30, 2025
6f55d5f
Moved tests
woutse Jan 30, 2025
5ded033
Code polish
woutse Jan 30, 2025
4a2f198
Update Config.php
woutse Jan 31, 2025
891dc43
Updates for unit tests
woutse Jan 31, 2025
ab1e3aa
Update Exchange.php
woutse Jan 31, 2025
f9e4030
Updates for unit tests
woutse Feb 1, 2025
2aa691a
Updates for unit tests
woutse Feb 1, 2025
4a32368
Merge pull request #16 from paynl/unittestspriv
woutse Feb 1, 2025
ff4f32d
Updates for unit tests
woutse Feb 1, 2025
f8ff7aa
Merge pull request #17 from paynl/unittests_update
woutse Feb 1, 2025
5e34057
Code polish
woutse Feb 3, 2025
7c82a3c
Code polish
woutse Feb 3, 2025
09edaae
Code polish
woutse Feb 3, 2025
cf8e1ba
Code polish
woutse Feb 3, 2025
2e2d093
Merge pull request #15 from paynl/unittests
woutse Feb 3, 2025
229b1be
Code polish
woutse Feb 14, 2025
107c610
Added getAmountRefunded method for PayOrder class
woutse Feb 27, 2025
454d02c
Fixed getSettings returning array
woutse Feb 27, 2025
42b1bb4
Updated getCores method
woutse Feb 27, 2025
78598ea
Code polish
woutse Feb 27, 2025
68badb9
Code polish
woutse Feb 27, 2025
f9743c9
Code polish
woutse Feb 27, 2025
196ec46
Code polish
woutse Feb 27, 2025
70d983e
Merge pull request #18 from paynl/updatesfeb
woutse Feb 27, 2025
39eb0db
Code polish
woutse Feb 27, 2025
c9ddcf2
Code polish
woutse Feb 27, 2025
3879bfc
Code polish
woutse Feb 27, 2025
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
118 changes: 118 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# Custom added rules
/bin/

# Created by https://www.toptal.com/developers/gitignore/api/composer,phpunit,phpstorm+all
# Edit at https://www.toptal.com/developers/gitignore?templates=composer,phpunit,phpstorm+all

### Composer ###
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock

### PhpStorm+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf

# AWS User-specific
.idea/**/aws.xml

# Generated files
.idea/**/contentModel.xml

# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml

# Gradle
.idea/**/gradle.xml
.idea/**/libraries

# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr

# CMake
cmake-build-*/

# Mongo Explorer plugin
.idea/**/mongoSettings.xml

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# SonarLint plugin
.idea/sonarlint/

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Editor-based Rest Client
.idea/httpRequests

# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser

### PhpStorm+all Patch ###
# Ignore everything but code style settings and run configurations
# that are supposed to be shared within teams.

.idea/*

!.idea/codeStyles
!.idea/runConfigurations

### PHPUnit ###
# Covers PHPUnit
# Reference: https://phpunit.de/

# Generated files
.phpunit.result.cache
.phpunit.cache

# PHPUnit
/app/phpunit.xml
/phpunit.xml

# Build data
/build/

# End of https://www.toptal.com/developers/gitignore/api/composer,phpunit,phpstorm+all
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<img src="https://www.pay.nl/uploads/1/brands/main_logo.png" width="100px" style="margin-bottom: -30px"/> <h1 style="position:relative;top:-6px;padding-left:10px;display: inline-block">PHP SDK</h1>
<img src="https://www.pay.nl/uploads/1/brands/main_logo.png" width="100px" style="margin-bottom: -30px"/> <h1 style="position:relative;top:-6px;padding-left:10px;display: inline-block">PHP SDK</h1>


Use this SDK to implement Pay. into your PHP integration.
<br>

#### Requirements

> PHP 7.4 or PHP 8+
JSON extension installed
CURL extension installed
> PHP 8.2+
> JSON extension installed
> CURL extension installed

<br>

If requirements are met, go ahead with the [installation and set-up](https://github.com/paynl/php-sdk/wiki/Install) of the SDK!
Expand Down
72 changes: 72 additions & 0 deletions Tests/Unit/OrderAbortRequestTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Tests\Unit;

use PayNL\Sdk\Model\Pay\PayOrder;
use PayNL\Sdk\Model\Request\OrderAbortRequest;
use PHPUnit\Framework\TestCase;

class OrderAbortRequestTest extends TestCase
{
/**
* @return void
*/
public function testConstructor(): void
{
$transactionId = '123456';
$orderAbortRequest = new OrderAbortRequest($transactionId);

$this->assertInstanceOf(OrderAbortRequest::class, $orderAbortRequest);
}

/**
* @return void
*/
public function testGetPathParameters(): void
{
$transactionId = '123456';
$orderAbortRequest = new OrderAbortRequest($transactionId);

$pathParameters = $orderAbortRequest->getPathParameters();

$this->assertIsArray($pathParameters);
$this->assertArrayHasKey('transactionId', $pathParameters);
$this->assertSame($transactionId, $pathParameters['transactionId']);
}

/**
* @return void
*/
public function testGetBodyParameters(): void
{
$transactionId = '123456';
$orderAbortRequest = new OrderAbortRequest($transactionId);

$bodyParameters = $orderAbortRequest->getBodyParameters();

$this->assertIsArray($bodyParameters);
$this->assertEmpty($bodyParameters);
}

/**
* @return void
* @throws \PHPUnit\Framework\MockObject\Exception
* @throws \PayNL\Sdk\Exception\PayException
*/
public function testStart(): void
{
$transactionId = '123456';
$orderAbortRequest = $this->getMockBuilder(OrderAbortRequest::class)
->setConstructorArgs([$transactionId])
->onlyMethods(['start'])
->getMock();

$mockPayOrder = $this->createMock(PayOrder::class);

$orderAbortRequest->method('start')->willReturn($mockPayOrder);

$result = $orderAbortRequest->start();

$this->assertInstanceOf(PayOrder::class, $result);
}
}
72 changes: 72 additions & 0 deletions Tests/Unit/OrderApproveRequestTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<?php

namespace Tests\Unit;

use PayNL\Sdk\Model\Pay\PayOrder;
use PayNL\Sdk\Model\Request\OrderApproveRequest;
use PHPUnit\Framework\TestCase;

class OrderApproveRequestTest extends TestCase
{
/**
* @return void
*/
public function testConstructor(): void
{
$transactionId = '123456';
$orderApproveRequest = new OrderApproveRequest($transactionId);

$this->assertInstanceOf(OrderApproveRequest::class, $orderApproveRequest);
}

/**
* @return void
*/
public function testGetPathParameters(): void
{
$transactionId = '123456';
$orderApproveRequest = new OrderApproveRequest($transactionId);

$pathParameters = $orderApproveRequest->getPathParameters();

$this->assertIsArray($pathParameters);
$this->assertArrayHasKey('transactionId', $pathParameters);
$this->assertSame($transactionId, $pathParameters['transactionId']);
}

/**
* @return void
*/
public function testGetBodyParameters(): void
{
$transactionId = '123456';
$orderApproveRequest = new OrderApproveRequest($transactionId);

$bodyParameters = $orderApproveRequest->getBodyParameters();

$this->assertIsArray($bodyParameters);
$this->assertEmpty($bodyParameters);
}

/**
* @return void
* @throws \PHPUnit\Framework\MockObject\Exception
* @throws \PayNL\Sdk\Exception\PayException
*/
public function testStart(): void
{
$transactionId = '123456';
$orderApproveRequest = $this->getMockBuilder(OrderApproveRequest::class)
->setConstructorArgs([$transactionId])
->onlyMethods(['start'])
->getMock();

$mockPayOrder = $this->createMock(PayOrder::class);

$orderApproveRequest->method('start')->willReturn($mockPayOrder);

$result = $orderApproveRequest->start();

$this->assertInstanceOf(PayOrder::class, $result);
}
}
Loading