Skip to content

Commit

Permalink
Initial progress
Browse files Browse the repository at this point in the history
  • Loading branch information
StanBarrows committed Nov 29, 2023
1 parent 800aba5 commit 8b19b2c
Show file tree
Hide file tree
Showing 14 changed files with 40 additions and 1,220 deletions.
11 changes: 9 additions & 2 deletions config/postfinance-b2b.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
return [
'wsdl' => env('POSTFINANCE_B2B_WSDL', 'https://ebill-ki.postfinance.ch/B2BService/B2BService.svc?singleWsdl'),
'cache_wsdl' => env('POSTFINANCE_B2B_CACHE_WSDL', WSDL_CACHE_NONE),
'username' => env('POSTFINANCE_B2B_USERNAME', ''),
'password' => env('POSTFINANCE_B2B_PASSWORD', ''),
'username' => env('POSTFINANCE_B2B_USERNAME'),
'password' => env('POSTFINANCE_B2B_PASSWORD'),
'debug' => env('POSTFINANCE_B2B_DEBUG', false),

'tests' => [
'payer_id' => env('POSTFINANCE_B2B_TESTS_PAYER_ID'),
'biller_id' => env('POSTFINANCE_B2B_TESTS_BILLER_ID'),
'transaction_id' => env('POSTFINANCE_B2B_TESTS_TRANSACTION_ID'),
'file_type' => env('POSTFINANCE_B2B_TESTS_FILE_TYPE'),
],
];
42 changes: 0 additions & 42 deletions config/soap-client.php

This file was deleted.

Binary file removed docs/3.1.0.png
Binary file not shown.
Binary file removed docs/460_109_en.pdf
Binary file not shown.
Binary file removed docs/5.1.0.png
Binary file not shown.
Binary file removed docs/5.2.0.png
Binary file not shown.
1,144 changes: 0 additions & 1,144 deletions docs/B2BService.svc.wsdl

This file was deleted.

14 changes: 0 additions & 14 deletions examples/ping.php

This file was deleted.

11 changes: 10 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
<junit outputFile="build/report.junit.xml"/>
</logging>
<php>
<env name="FLATFOX_TOKEN" value="token"/>
<env name="POSTFINANCE_B2B_WSDL" value="wds"/>
<env name="POSTFINANCE_B2B_CACHE_WSDL" value="wsdl"/>
<env name="POSTFINANCE_B2B_USERNAME" value="username"/>
<env name="POSTFINANCE_B2B_PASSWORD" value="password"/>
<env name="POSTFINANCE_B2B_DEBUG" value="debug"/>

<env name="POSTFINANCE_B2B_TESTS_PAYER_ID" value=""/>
<env name="POSTFINANCE_B2B_TESTS_BILLER_ID" value=""/>
<env name="POSTFINANCE_B2B_TESTS_TRANSACTION_ID" value=""/>
<env name="POSTFINANCE_B2B_TESTS_FILE_TYPE" value="RGXMLSIG"/>
</php>
</phpunit>
2 changes: 1 addition & 1 deletion src/Client/PostfinanceClassmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static function getCollection(): ClassMapCollection
{
return new ClassMapCollection(
new ClassMap('ArrayOfInvoiceReport', Type\ArrayOfInvoiceReport::class),
//new ClassMap('InvoiceReport', Type\InvoiceReport::class),
new ClassMap('InvoiceReport', Type\InvoiceReport::class),
new ClassMap('DownloadFile', Type\DownloadFile::class),
new ClassMap('GetInvoicePayer', Type\GetInvoicePayer::class),
new ClassMap('GetInvoicePayerResponse', Type\GetInvoicePayerResponse::class),
Expand Down
9 changes: 6 additions & 3 deletions tests/Feature/GetInvoiceListPayerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
use CodebarAg\PostfinanceB2B\Client\Type\GetInvoiceListPayer;

it('b2b service getInvoiceListPayer test', function () {
$config = require dirname(__DIR__, 2).'/config/postfinance-b2b.php';
$config = config('postfinance-b2b');

$payerId = config('postfinance-b2b.tests.payer_id');

$client = PostfinanceClientFactory::factory($config);
$response = $client->getInvoiceListPayer(new GetInvoiceListPayer('41100000198521795', false));
expect($response->getGetInvoiceListPayerResult()->getInvoiceReport())->toBeIterable();
$response = $client->getInvoiceListPayer(new GetInvoiceListPayer($payerId, false));

expect($response->getGetInvoiceListPayerResult()->getInvoiceReport())->toBeIterable();
})
->group('get', 'test');
14 changes: 9 additions & 5 deletions tests/Feature/GetInvoicePayerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@

it('b2b service getInvoicePayer test', function () {

$config = require dirname(__DIR__, 2).'/config/postfinance-b2b.php';
$config = config('postfinance-b2b');

$payerId = config('postfinance-b2b.tests.payer_id');
$billerId = config('postfinance-b2b.tests.biller_id');
$transactionId = config('postfinance-b2b.tests.transaction_id');
$fileType = config('postfinance-b2b.tests.file_type');

$client = PostfinanceClientFactory::factory($config);
$response = $client->getInvoicePayer(new GetInvoicePayer('41100000198521795', '41101000000798788', 'INV61595', 'PDF'));
$response = $client->getInvoicePayer(new GetInvoicePayer($payerId, $billerId, $transactionId, $fileType));

expect($response->getGetInvoicePayerResult()->getData())
->toBeString()
->not()->toBeEmpty();
expect($response->getGetInvoicePayerResult()->getData())->toBeString()->not()->toBeEmpty();
})
->group('get', 'test');
7 changes: 5 additions & 2 deletions tests/Feature/PingTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@

it('b2b service executePing test', function () {

$config = require dirname(__DIR__, 2).'/config/postfinance-b2b.php';
$config = config('postfinance-b2b');

$payerId = config('postfinance-b2b.tests.payer_id');

$client = PostfinanceClientFactory::factory($config);
$response = $client->executePing(new ExecutePing(null, '41100000198521795', null, null));
$response = $client->executePing(new ExecutePing(null, $payerId, null, null));
expect($response->getExecutePingResult())->toBeNumeric();

})
Expand Down
6 changes: 0 additions & 6 deletions todo.md
Original file line number Diff line number Diff line change
@@ -1,6 +0,0 @@
https://flatfox.ch/en/docs/api/#/


- Update To Pest 2.0
- PHP 8.2 Only
- Laravel 10 Only

0 comments on commit 8b19b2c

Please sign in to comment.