Skip to content

Commit 44c82f7

Browse files
committed
Añadir documentación, arreglar cosillas y añadir test
1 parent 3a10b1c commit 44c82f7

6 files changed

+851
-2
lines changed

doc/Códigos de Respuesta.md

+770
Large diffs are not rendered by default.

doc/Tabla Ds_ProcessedPayMethod.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Tabla Ds_ProcessedPayMethod
2+
3+
Informa sobre el método en el que se ha realizado la operación:
4+
5+
https://pagosonline.redsys.es/parametros-entrada-salida.html
6+
7+
| Método de pago | Valor |
8+
|---------------:|-------|
9+
| 1 | Visa Secure
10+
| 3 | Tradicional Mundial
11+
| 5 | Finanet
12+
| 11 | Capacidad FINANET
13+
| 13 | Capacidad Visa Secure
14+
| 14 | Tradicional UE
15+
| 22 | MasterCard Identity Check
16+
| 23 | Capacidad Identity Check
17+
| 24 | Pago AMEX
18+
| 25 | Pago MOTO
19+
| 28 | Pago JCB
20+
| 31 | Pago DINERS
21+
| 39 | JCB JSecure
22+
| 40 | Capacidad JSecure
23+
| 41 | Domiciliacion
24+
| 42 | Transferencia
25+
| 54 | PayPal
26+
| 57 | SafeKey
27+
| 58 | Capacidad SafeKey
28+
| 59 | MasterPass Wallet
29+
| 68 | Bizum
30+
| 70 | UPI ExpressPay
31+
| 71 | GooglePay
32+
| 72 | ApplePay
33+
| 73 | UPI SecurePlus
34+
| 74 | Capacidad Discover
35+
| 75 | Discover ProtectBuy
36+
| 76 | Discover
37+
| 77 | Amazon Pay
38+
| 78 | Challenge Visa
39+
| 79 | Challenge MasterCard
40+
| 80 | Frictionless Visa
41+
| 81 | Frictionless MasterCard
42+
| 82 | Attempt Visa
43+
| 83 | Attempt MasterCard
44+
| 85 | Challenge Amex
45+
| 86 | Challenge Discover
46+
| 87 | Frictionless Amex
47+
| 88 | Frictionless Discover
48+
| 89 | Attempt Amex
49+
| 90 | Attempt Discover
50+
| 92 | Pago DINERS ProtectBuy
51+
| 93 | Challenge Diners ProtectBuy
52+
| 94 | Frictionless Diners ProtectBuy
53+
| 95 | Pago Attempt Diners ProtectBuy
54+
| 96 | Challenge JCB
55+
| 97 | Frictionless JCB
56+
| 98 | Attempt JCB
57+
| 107 | Pago con cuenta

src/Redsys/Merchant/MerchantEnvironment.php

+6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
<?php
22
declare(strict_types=1);
33

4+
namespace Redsys\Merchant;
5+
6+
use ReflectionClass;
7+
48
class MerchantEnvironment {
59
public const LIVE = 'live';
610
public const TEST = 'test';
711
public const REST_LIVE = 'restLive';
812
public const REST_TEST = 'restTest';
913
public const START_REST_LIVE = 'startRequestRestLive';
1014
public const START_REST_TEST = 'startRequestRestTest';
15+
public const MANAGE_REQUEST_REST_LIVE = 'manageRequestRestLive';
16+
public const MANAGE_REQUEST_REST_TEST = 'manageRequestRestTest';
1117

1218
public static function isValid (string $value) : bool {
1319
return in_array($value, (new ReflectionClass(self::class))->getConstants());

src/Redsys/Merchant/MerchantTransactionTypes.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class MerchantTransactionTypes {
2323
public const ANULACION_DE_CONFIRMACION_SEPARADA = 47; // Anulación de confirmación separada
2424
public const MODIFICACION_DE_CADUCIDAD_DEL_ENLACE_PAYGOLD = 51; // Modificación de caducidad del enlace (Paygold)
2525

26-
public static function isValid (string $value) : bool {
26+
public static function isValid (int $value) : bool {
2727
return in_array($value, (new ReflectionClass(self::class))->getConstants());
2828
}
2929
}

tests/MerchantEnvironmentTest.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
declare(strict_types=1);
3+
4+
namespace Redsys\Merchant;
5+
6+
use PHPUnit\Framework\TestCase as PHPUnitTestCase;
7+
8+
class MerchantEnvironmentTest extends PHPUnitTestCase {
9+
public function testCodeIsValid () {
10+
$this->assertTrue(MerchantEnvironment::isValid(MerchantEnvironment::LIVE));
11+
}
12+
13+
public function testCodeNotValid () {
14+
$this->assertFalse(MerchantEnvironment::isValid('INVALID'));
15+
}
16+
}

tests/MerchantTransactionTypesTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ public function testCodeIsValid () {
1111
}
1212

1313
public function testCodeNotValid () {
14-
$this->assertFalse(MerchantTransactionTypes::isValid('INVALID'));
14+
$this->assertFalse(MerchantTransactionTypes::isValid(-1));
1515
}
1616
}

0 commit comments

Comments
 (0)