Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
eccbcb1
Add gre-api package
giansalex Jan 7, 2023
ba4ba88
Add GRE sender
giansalex Jan 10, 2023
f6713ad
Add token store
giansalex Jan 10, 2023
2391a0e
Add InMemory token store
giansalex Jan 10, 2023
86150e1
Add api factory
giansalex Jan 10, 2023
d711691
Add See API
giansalex Jan 10, 2023
fbf09bb
Update gre-api package
giansalex Jan 10, 2023
df5ef3b
Parse error
giansalex Jan 10, 2023
68b9ac7
Use auth ApiInterface
giansalex Jan 10, 2023
0c2db3e
Use cpe ApiInterface
giansalex Jan 10, 2023
8b2ddab
Add cpe endpoint option
giansalex Jan 10, 2023
1b3ea10
Add allow custom endpoints
giansalex Jan 10, 2023
b21c69f
Merge remote-tracking branch 'origin/master' into gre-api
giansalex Jan 10, 2023
50d2451
Fix "Explicitly mention the visibility"
giansalex Jan 11, 2023
f6ef77a
Fix sonarqube issues
giansalex Jan 11, 2023
0f9a182
Remove zip ext
giansalex Jan 11, 2023
1da49e3
Add curl ext
giansalex Jan 11, 2023
936d1e4
Update changelog
giansalex Jan 11, 2023
9f07243
Update curl required
giansalex Jan 11, 2023
b728311
Update requirements
giansalex Jan 11, 2023
161b14a
Fix phpstan issues
giansalex Jan 11, 2023
052c1d3
Update phpunit v9
giansalex Jan 11, 2023
0fb33b3
Upgrade psalm v5
giansalex Jan 11, 2023
6af18a9
Sync packages
giansalex Jan 11, 2023
b6103c2
Set strict types
giansalex Jan 11, 2023
c3476f3
Fix code smells
giansalex Jan 11, 2023
3d0086d
Update codacy warns
giansalex Jan 11, 2023
353fe95
Update return type
giansalex Jan 11, 2023
dbb5224
Update phpunit xsd
giansalex Jan 11, 2023
19c0ec6
Add factory tests
giansalex Jan 11, 2023
f29963b
Fix validate cdr exists
giansalex Jan 11, 2023
d8b6b29
Add GRE sender tests
giansalex Jan 11, 2023
dc299b2
Fix endpoints init
giansalex Jan 11, 2023
7dbb831
Set strict types
giansalex Jan 11, 2023
4ae75a8
Fix codacy warn
giansalex Jan 11, 2023
04b45b5
Set default values
giansalex Jan 11, 2023
256401b
Test status error
giansalex Jan 11, 2023
65cc538
Test expire token
giansalex Jan 11, 2023
a526192
Update url keys
giansalex Jan 11, 2023
dbe4ad1
Deprecated GUIA soap endpoint
giansalex Jan 11, 2023
8eee529
Remove soap despatch tests
giansalex Jan 11, 2023
2bb0562
Add api tests
giansalex Jan 11, 2023
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
3 changes: 1 addition & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
# zip only for linter
extensions: mbstring, soap, :fileinfo, zip
extensions: mbstring, curl, soap, :fileinfo

- name: Validate composer.json
run: composer validate
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Los cambios notables de cada lanzamiento serán documentados en este archivo.
## Unreleased
- #206 Agregar xml para nueva Guia de Remisión.
- #209 Cambiar versión mínima de PHP a `7.4`
- #213 Agregar GRE cliente REST.

## 4.3.4 - 2022-11-21

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Puede ver una demostración en [@greenter/demo](https://github.com/thegreenter/d

## Requerimientos
- PHP `7.4` o superior
- Extensiones PHP Activadas: `soap`, `zlib`, `openssl`.
- Extensiones PHP: `soap`, `zlib`, `openssl`, `curl`.

## Documentación
- Lee esta [guia](https://fe-primer.greenter.dev/) para conocer mas sobre facturación electrónica.
Expand Down
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"require": {
"php": ">=7.4",
"bacon/bacon-qr-code": "^2.0",
"greenter/gre-api": "^1.0",
"greenter/xmldsig": "^5.0",
"mikehaertl/phpwkhtmltopdf": "^2.4",
"nelexa/zip": "^4.0",
Expand All @@ -31,15 +32,16 @@
"require-dev": {
"greenter/ubl-validator": "^2.0",
"mockery/mockery": "^1.2",
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^8",
"vimeo/psalm": "^4.4"
"phpstan/phpstan": "^1.9",
"phpunit/phpunit": "^9",
"vimeo/psalm": "^5.4"
},
"suggest": {
"ext-dom": "For xml, xml-parser, cpe-validator, ws package",
"ext-soap": "For ws package",
"ext-zlib": "For ws package",
"ext-xsl": "For cpe-validator package"
"ext-xsl": "For cpe-validator package",
"ext-curl": "For ws package (GRE)"
},
"autoload": {
"psr-4": {
Expand Down
59 changes: 59 additions & 0 deletions packages/core/src/Core/Services/Api/BasicToken.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?php

declare(strict_types=1);

namespace Greenter\Services\Api;

use DateTimeInterface;

class BasicToken
{
private ?string $value;
private ?DateTimeInterface $expire;

/**
* @param string|null $value
* @param DateTimeInterface|null $expire
*/
public function __construct(?string $value, ?DateTimeInterface $expire)
{
$this->value = $value;
$this->expire = $expire;
}

/**
* @return string|null
*/
public function getValue(): ?string
{
return $this->value;
}

/**
* @param string|null $value
* @return BasicToken
*/
public function setValue(?string $value): BasicToken
{
$this->value = $value;
return $this;
}

/**
* @return DateTimeInterface|null
*/
public function getExpire(): ?DateTimeInterface
{
return $this->expire;
}

/**
* @param DateTimeInterface|null $expire
* @return BasicToken
*/
public function setExpire(?DateTimeInterface $expire): BasicToken
{
$this->expire = $expire;
return $this;
}
}
25 changes: 25 additions & 0 deletions packages/core/src/Core/Services/Api/TokenStoreInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?php

declare(strict_types=1);

namespace Greenter\Services\Api;

interface TokenStoreInterface
{
/**
* Get Token by id.
*
* @param string|null $id
* @return BasicToken|null
*/
public function get(?string $id): ?BasicToken;

/**
* Save token.
*
* @param string|null $id
* @param BasicToken $token
* @return void
*/
public function set(?string $id, BasicToken $token): void;
}
2 changes: 1 addition & 1 deletion packages/cpe-validator/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"ext-xsl": "*"
},
"require-dev": {
"phpunit/phpunit": "^8"
"phpunit/phpunit": "^9"
},
"autoload": {
"psr-4": {
Expand Down
48 changes: 23 additions & 25 deletions packages/cpe-validator/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="true">
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" />
</logging>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/logs/junit.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion packages/htmltopdf/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"mikehaertl/phpwkhtmltopdf": "^2.4"
},
"require-dev": {
"phpunit/phpunit": "^8"
"phpunit/phpunit": "^9"
},
"autoload": {
"psr-4": {
Expand Down
48 changes: 23 additions & 25 deletions packages/htmltopdf/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="true">
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml"/>
</logging>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/logs/junit.xml"/>
</logging>
</phpunit>
2 changes: 1 addition & 1 deletion packages/lite/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"greenter/xml": "^4.4"
},
"require-dev": {
"phpunit/phpunit": "^8"
"phpunit/phpunit": "^9"
},
"autoload": {
"psr-4": {
Expand Down
48 changes: 23 additions & 25 deletions packages/lite/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
<?xml version="1.0" encoding="utf-8" ?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/8.0/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
stopOnFailure="true">
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</whitelist>
</filter>
<logging>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="junit" target="build/logs/junit.xml" />
</logging>
</phpunit>
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" stopOnFailure="true">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
<report>
<clover outputFile="build/logs/clover.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="Unit Tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<junit outputFile="build/logs/junit.xml"/>
</logging>
</phpunit>
Loading