Plugin Directory

Changeset 2912552


Ignore:
Timestamp:
05/15/2023 02:54:17 PM (3 years ago)
Author:
fpaygateway
Message:

upload 2.5.7

Location:
fpay-gateway/trunk
Files:
6 added
42 edited

Legend:

Unmodified
Added
Removed
  • fpay-gateway/trunk/composer.json

    r2902085 r2912552  
    2525    },
    2626    "prepend-autoloader": false,
    27     "optimize-autoloader": true
     27    "optimize-autoloader": true,
     28    "options": {
     29      "ssl": {
     30        "verify_peer": false,
     31        "allow_self_signed": false
     32      }
     33    }
    2834  },
    2935  "require": {
  • fpay-gateway/trunk/composer.lock

    r2902085 r2912552  
    820820        {
    821821            "name": "json-mapper/json-mapper",
    822             "version": "2.16.0",
     822            "version": "2.18.0",
    823823            "source": {
    824824                "type": "git",
    825825                "url": "https://github.com/JsonMapper/JsonMapper.git",
    826                 "reference": "0b31f49640340ebde6ad0357316cdb22a5335e76"
    827             },
    828             "dist": {
    829                 "type": "zip",
    830                 "url": "https://api.github.com/repos/JsonMapper/JsonMapper/zipball/0b31f49640340ebde6ad0357316cdb22a5335e76",
    831                 "reference": "0b31f49640340ebde6ad0357316cdb22a5335e76",
     826                "reference": "24144cc22f9eccc3360eb91c85c1a44546fb4ca8"
     827            },
     828            "dist": {
     829                "type": "zip",
     830                "url": "https://api.github.com/repos/JsonMapper/JsonMapper/zipball/24144cc22f9eccc3360eb91c85c1a44546fb4ca8",
     831                "reference": "24144cc22f9eccc3360eb91c85c1a44546fb4ca8",
    832832                "shasum": ""
    833833            },
     
    850850                "squizlabs/php_codesniffer": "^3.5",
    851851                "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0",
    852                 "vimeo/psalm": "^4.10"
     852                "vimeo/psalm": "^4.10 || ^5.0"
    853853            },
    854854            "suggest": {
     
    885885                }
    886886            ],
    887             "time": "2023-02-13T19:28:05+00:00"
     887            "time": "2023-05-12T16:49:57+00:00"
    888888        },
    889889        {
     
    20212021        {
    20222022            "name": "react/promise",
    2023             "version": "v2.9.0",
     2023            "version": "v2.10.0",
    20242024            "source": {
    20252025                "type": "git",
    20262026                "url": "https://github.com/reactphp/promise.git",
    2027                 "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910"
    2028             },
    2029             "dist": {
    2030                 "type": "zip",
    2031                 "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910",
    2032                 "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910",
     2027                "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38"
     2028            },
     2029            "dist": {
     2030                "type": "zip",
     2031                "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
     2032                "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
    20332033                "shasum": ""
    20342034            },
     
    20372037            },
    20382038            "require-dev": {
    2039                 "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
     2039                "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36"
    20402040            },
    20412041            "type": "library",
     
    20812081            "support": {
    20822082                "issues": "https://github.com/reactphp/promise/issues",
    2083                 "source": "https://github.com/reactphp/promise/tree/v2.9.0"
    2084             },
    2085             "funding": [
    2086                 {
    2087                     "url": "https://github.com/WyriHaximus",
    2088                     "type": "github"
    2089                 },
    2090                 {
    2091                     "url": "https://github.com/clue",
    2092                     "type": "github"
    2093                 }
    2094             ],
    2095             "time": "2022-02-11T10:27:51+00:00"
     2083                "source": "https://github.com/reactphp/promise/tree/v2.10.0"
     2084            },
     2085            "funding": [
     2086                {
     2087                    "url": "https://opencollective.com/reactphp",
     2088                    "type": "open_collective"
     2089                }
     2090            ],
     2091            "time": "2023-05-02T15:15:43+00:00"
    20962092        },
    20972093        {
    20982094            "name": "seld/jsonlint",
    2099             "version": "1.9.0",
     2095            "version": "1.10.0",
    21002096            "source": {
    21012097                "type": "git",
    21022098                "url": "https://github.com/Seldaek/jsonlint.git",
    2103                 "reference": "4211420d25eba80712bff236a98960ef68b866b7"
    2104             },
    2105             "dist": {
    2106                 "type": "zip",
    2107                 "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7",
    2108                 "reference": "4211420d25eba80712bff236a98960ef68b866b7",
     2099                "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1"
     2100            },
     2101            "dist": {
     2102                "type": "zip",
     2103                "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1",
     2104                "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1",
    21092105                "shasum": ""
    21102106            },
     
    21452141            "support": {
    21462142                "issues": "https://github.com/Seldaek/jsonlint/issues",
    2147                 "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0"
     2143                "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0"
    21482144            },
    21492145            "funding": [
     
    21572153                }
    21582154            ],
    2159             "time": "2022-04-01T13:37:23+00:00"
     2155            "time": "2023-05-11T13:16:46+00:00"
    21602156        },
    21612157        {
     
    22702266        {
    22712267            "name": "symfony/cache",
    2272             "version": "v5.4.22",
     2268            "version": "v5.4.23",
    22732269            "source": {
    22742270                "type": "git",
    22752271                "url": "https://github.com/symfony/cache.git",
    2276                 "reference": "5ed986c4ef65f0dea5e9753630b5cb1f07f847d6"
    2277             },
    2278             "dist": {
    2279                 "type": "zip",
    2280                 "url": "https://api.github.com/repos/symfony/cache/zipball/5ed986c4ef65f0dea5e9753630b5cb1f07f847d6",
    2281                 "reference": "5ed986c4ef65f0dea5e9753630b5cb1f07f847d6",
     2272                "reference": "983c79ff28612cdfd66d8e44e1a06e5afc87e107"
     2273            },
     2274            "dist": {
     2275                "type": "zip",
     2276                "url": "https://api.github.com/repos/symfony/cache/zipball/983c79ff28612cdfd66d8e44e1a06e5afc87e107",
     2277                "reference": "983c79ff28612cdfd66d8e44e1a06e5afc87e107",
    22822278                "shasum": ""
    22832279            },
     
    23472343            ],
    23482344            "support": {
    2349                 "source": "https://github.com/symfony/cache/tree/v5.4.22"
     2345                "source": "https://github.com/symfony/cache/tree/v5.4.23"
    23502346            },
    23512347            "funding": [
     
    23632359                }
    23642360            ],
    2365             "time": "2023-03-29T20:01:08+00:00"
     2361            "time": "2023-04-21T15:38:51+00:00"
    23662362        },
    23672363        {
     
    24462442        {
    24472443            "name": "symfony/console",
    2448             "version": "v5.4.22",
     2444            "version": "v5.4.23",
    24492445            "source": {
    24502446                "type": "git",
    24512447                "url": "https://github.com/symfony/console.git",
    2452                 "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8"
    2453             },
    2454             "dist": {
    2455                 "type": "zip",
    2456                 "url": "https://api.github.com/repos/symfony/console/zipball/3cd51fd2e6c461ca678f84d419461281bd87a0a8",
    2457                 "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8",
     2448                "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c"
     2449            },
     2450            "dist": {
     2451                "type": "zip",
     2452                "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c",
     2453                "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c",
    24582454                "shasum": ""
    24592455            },
     
    25252521            ],
    25262522            "support": {
    2527                 "source": "https://github.com/symfony/console/tree/v5.4.22"
     2523                "source": "https://github.com/symfony/console/tree/v5.4.23"
    25282524            },
    25292525            "funding": [
     
    25412537                }
    25422538            ],
    2543             "time": "2023-03-25T09:27:28+00:00"
     2539            "time": "2023-04-24T18:47:29+00:00"
    25442540        },
    25452541        {
     
    26122608        {
    26132609            "name": "symfony/filesystem",
    2614             "version": "v5.4.21",
     2610            "version": "v5.4.23",
    26152611            "source": {
    26162612                "type": "git",
    26172613                "url": "https://github.com/symfony/filesystem.git",
    2618                 "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f"
    2619             },
    2620             "dist": {
    2621                 "type": "zip",
    2622                 "url": "https://api.github.com/repos/symfony/filesystem/zipball/e75960b1bbfd2b8c9e483e0d74811d555ca3de9f",
    2623                 "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f",
     2614                "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5"
     2615            },
     2616            "dist": {
     2617                "type": "zip",
     2618                "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5",
     2619                "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5",
    26242620                "shasum": ""
    26252621            },
     
    26562652            "homepage": "https://symfony.com",
    26572653            "support": {
    2658                 "source": "https://github.com/symfony/filesystem/tree/v5.4.21"
     2654                "source": "https://github.com/symfony/filesystem/tree/v5.4.23"
    26592655            },
    26602656            "funding": [
     
    26722668                }
    26732669            ],
    2674             "time": "2023-02-14T08:03:56+00:00"
     2670            "time": "2023-03-02T11:38:35+00:00"
    26752671        },
    26762672        {
     
    33103306        {
    33113307            "name": "symfony/process",
    3312             "version": "v5.4.22",
     3308            "version": "v5.4.23",
    33133309            "source": {
    33143310                "type": "git",
    33153311                "url": "https://github.com/symfony/process.git",
    3316                 "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b"
    3317             },
    3318             "dist": {
    3319                 "type": "zip",
    3320                 "url": "https://api.github.com/repos/symfony/process/zipball/4b850da0cc3a2a9181c1ed407adbca4733dc839b",
    3321                 "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b",
     3312                "reference": "4b842fc4b61609e0a155a114082bd94e31e98287"
     3313            },
     3314            "dist": {
     3315                "type": "zip",
     3316                "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287",
     3317                "reference": "4b842fc4b61609e0a155a114082bd94e31e98287",
    33223318                "shasum": ""
    33233319            },
     
    33523348            "homepage": "https://symfony.com",
    33533349            "support": {
    3354                 "source": "https://github.com/symfony/process/tree/v5.4.22"
     3350                "source": "https://github.com/symfony/process/tree/v5.4.23"
    33553351            },
    33563352            "funding": [
     
    33683364                }
    33693365            ],
    3370             "time": "2023-03-06T21:29:33+00:00"
     3366            "time": "2023-04-18T13:50:24+00:00"
    33713367        },
    33723368        {
     
    54135409        {
    54145410            "name": "phpunit/phpunit",
    5415             "version": "9.6.7",
     5411            "version": "9.6.8",
    54165412            "source": {
    54175413                "type": "git",
    54185414                "url": "https://github.com/sebastianbergmann/phpunit.git",
    5419                 "reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2"
    5420             },
    5421             "dist": {
    5422                 "type": "zip",
    5423                 "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/c993f0d3b0489ffc42ee2fe0bd645af1538a63b2",
    5424                 "reference": "c993f0d3b0489ffc42ee2fe0bd645af1538a63b2",
     5415                "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e"
     5416            },
     5417            "dist": {
     5418                "type": "zip",
     5419                "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/17d621b3aff84d0c8b62539e269e87d8d5baa76e",
     5420                "reference": "17d621b3aff84d0c8b62539e269e87d8d5baa76e",
    54255421                "shasum": ""
    54265422            },
     
    54965492                "issues": "https://github.com/sebastianbergmann/phpunit/issues",
    54975493                "security": "https://github.com/sebastianbergmann/phpunit/security/policy",
    5498                 "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.7"
     5494                "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.8"
    54995495            },
    55005496            "funding": [
     
    55125508                }
    55135509            ],
    5514             "time": "2023-04-14T08:58:40+00:00"
     5510            "time": "2023-05-11T05:14:45+00:00"
    55155511        },
    55165512        {
     
    58145810        {
    58155811            "name": "sebastian/diff",
    5816             "version": "4.0.4",
     5812            "version": "4.0.5",
    58175813            "source": {
    58185814                "type": "git",
    58195815                "url": "https://github.com/sebastianbergmann/diff.git",
    5820                 "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d"
    5821             },
    5822             "dist": {
    5823                 "type": "zip",
    5824                 "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3461e3fccc7cfdfc2720be910d3bd73c69be590d",
    5825                 "reference": "3461e3fccc7cfdfc2720be910d3bd73c69be590d",
     5816                "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131"
     5817            },
     5818            "dist": {
     5819                "type": "zip",
     5820                "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
     5821                "reference": "74be17022044ebaaecfdf0c5cd504fc9cd5a7131",
    58265822                "shasum": ""
    58275823            },
     
    58685864            "support": {
    58695865                "issues": "https://github.com/sebastianbergmann/diff/issues",
    5870                 "source": "https://github.com/sebastianbergmann/diff/tree/4.0.4"
     5866                "source": "https://github.com/sebastianbergmann/diff/tree/4.0.5"
    58715867            },
    58725868            "funding": [
     
    58765872                }
    58775873            ],
    5878             "time": "2020-10-26T13:10:38+00:00"
     5874            "time": "2023-05-07T05:35:17+00:00"
    58795875        },
    58805876        {
  • fpay-gateway/trunk/config/config.php

    r2901917 r2912552  
    3636            'supported_countries' => explode(',', $_ENV['FPAY_SUPPORTED_COUNTRIES']),
    3737            'supported_currencies' => explode(',', $_ENV['FPAY_SUPPORTED_CURRENCIES']),
     38            'decimals_quantity' => intval($_ENV['FPAY_DECIMALS']),
    3839
    3940            /**
  • fpay-gateway/trunk/fpay-gateway.php

    r2904111 r2912552  
    66 * Author: Fpay
    77 * Author URI: https://fpay.cl/
    8  * Version: 2.5.6
     8 * Version: 2.5.7
    99 */
    1010
  • fpay-gateway/trunk/readme.txt

    r2904111 r2912552  
    44Requires at least: 4.7
    55Tested up to: 6.1.1
    6 Stable tag: 2.5.6
     6Stable tag: 2.5.7
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    2424
    2525== Changelog ==
     26= 2.5.7 =
     27* Se solventa un problema al usar el plugin en Perú donde no estaba validando si debia o no redondear los valores al momento de crear la intención de pago.
     28
    2629= 2.5.6 =
    2730* Se solventa un problema con el empaquetado para publicar el plugin en la tienda de Wordpress.
  • fpay-gateway/trunk/src/Factories/FpayWoocommerceFactoryImpl.php

    r2834802 r2912552  
    9393        return $this->container->make(AbstractAmount::class, [
    9494            'currency' => $this->country_manager->getCurrentCurrency(),
    95             'total' => round($data->get_total()),
     95            'total' => $this->country_manager->round($data->get_total()),
    9696            'details' => $details
    9797        ]);
     
    130130            "description" => $data->get_name(),
    131131            "quantity" => $data->get_quantity(),
    132             "price" => round($data->get_total()),
    133             "tax" => round($data->get_subtotal_tax()),
     132            "price" => $this->country_manager->round($data->get_total()),
     133            "tax" => $this->country_manager->round($data->get_subtotal_tax()),
    134134            "category" => $data->get_type()
    135135        ]);
     
    185185    {
    186186        return $this->container->make(AbstractDetails::class, [
    187             'subtotal' => round($data->get_subtotal()),
     187            'subtotal' => $this->country_manager->round($data->get_subtotal()),
    188188            'tax' => AbstractDetails::TAX_CERO,
    189             'shipping' => round($data->get_shipping_total()),
     189            'shipping' => $this->country_manager->round($data->get_shipping_total()),
    190190            'shipping_discount' => AbstractDetails::DISCOUNT_CERO,
    191191        ]);
  • fpay-gateway/trunk/src/Services/Contracts/CountryManager.php

    r2834802 r2912552  
    77interface CountryManager
    88{
     9    const CL_COUNTRY_CODE = 'CL';
     10    const PE_COUNTRY_CODE = 'PE';
     11    const CO_COUNTRY_CODE = 'CO';
     12
     13    const COUNTRIES_THAT_NEEDS_ROUND = [
     14        self::CL_COUNTRY_CODE => self::CL_COUNTRY_CODE,
     15        self::CO_COUNTRY_CODE => self::CO_COUNTRY_CODE,
     16    ];
    917    const IN_PLUGIN_ACTIVATION_PROCESS = true;
    1018    const NOT_PLUGIN_ACTIVATION_PROCESS = false;
     
    3139
    3240    public function createCountry(array $data): AbstractCountry;
     41
     42    public function doesTheCountryNeedRound():bool;
     43
     44    public function round($value): float;
    3345}
  • fpay-gateway/trunk/src/Services/CountryManagerImpl.php

    r2834802 r2912552  
    156156            $country = null;
    157157            switch ($country_key) {
    158                 case 'CL':
     158                case self::CL_COUNTRY_CODE:
    159159                    $country = $this->createCountry(array(
    160160                            'name' => 'Chile',
    161161                            'currency_code' => 'CLP',
    162162                            'currency_name' => 'Peso chileno',
    163                             'country_code' => 'CL'
     163                            'country_code' => self::CL_COUNTRY_CODE
    164164                        )
    165165                    );
    166166                    break;
    167                 case 'PE':
     167                case self::PE_COUNTRY_CODE:
    168168                    $country = $this->createCountry(array(
    169169                            'name' => 'Perú',
    170170                            'currency_code' => 'PEN',
    171171                            'currency_name' => 'Soles',
    172                             'country_code' => 'PE'
     172                            'country_code' => self::PE_COUNTRY_CODE
    173173                        )
    174174                    );
     
    191191        ]);
    192192    }
     193
     194    public function doesTheCountryNeedRound(): bool
     195    {
     196        return array_key_exists($this->getCurrentCountry(), self::COUNTRIES_THAT_NEEDS_ROUND);
     197    }
     198
     199    public function round($value): float
     200    {
     201        return $this->doestheCountryNeedRound() ? round($value) : round($value, config('decimals_quantity'));
     202    }
    193203}
  • fpay-gateway/trunk/tests/src/Services/CountryManagerTest.php

    r2834802 r2912552  
    159159    expect(true)->toBeTrue();
    160160});
     161
     162it('checks if the current country as chile requires to round the values', function () {
     163
     164    /**
     165     *Arrange
     166     */
     167    /** @var CountryManager | Mockery\Mock $country_manager_spy */
     168    $country_manager_spy = Mockery::spy(new CountryManagerImpl(
     169        $this->container,
     170        $this->logger,
     171        'logo',
     172        config('plugin_number')
     173    ));
     174
     175    /**
     176     * Woocommerce functions called
     177     */
     178    expect_woocommerce('wc_get_base_location')->andReturn(['country' => 'CL']);
     179    expect_woocommerce('get_woocommerce_currency')->andReturn('CLP');
     180    expect_woocommerce('is_admin')->andReturn(true);
     181
     182    /**
     183     * Act
     184     */
     185    $needs_round = $country_manager_spy->doesTheCountryNeedRound();
     186    $rounded_value = $country_manager_spy->round(19.5);
     187
     188    /**
     189     * Assert
     190     */
     191    expect($needs_round)->toBeTrue();
     192    expect($rounded_value)->toBeFloat();
     193    expect($rounded_value)->toEqual(20);
     194});
     195
     196it('checks if the current country as colombia requires to round the values', function () {
     197
     198    /**
     199     *Arrange
     200     */
     201    /** @var CountryManager | Mockery\Mock $country_manager_spy */
     202    $country_manager_spy = Mockery::spy(new CountryManagerImpl(
     203        $this->container,
     204        $this->logger,
     205        'logo',
     206        config('plugin_number')
     207    ));
     208
     209    /**
     210     * Woocommerce functions called
     211     */
     212    expect_woocommerce('wc_get_base_location')->andReturn(['country' => 'CO']);
     213    expect_woocommerce('get_woocommerce_currency')->andReturn('COP');
     214    expect_woocommerce('is_admin')->andReturn(true);
     215
     216    /**
     217     * Act
     218     */
     219    $needs_round = $country_manager_spy->doesTheCountryNeedRound();
     220    $rounded_value = $country_manager_spy->round(19.5);
     221
     222    /**
     223     * Assert
     224     */
     225    expect($needs_round)->toBeTrue();
     226    expect($rounded_value)->toBeFloat();
     227    expect($rounded_value)->toEqual(20);
     228
     229    /**
     230     * Assert
     231     */
     232    expect($needs_round)->toBeTrue();
     233});
     234
     235it('checks if the round method works correctly to the rules, upper or equal to .5 round to up and under .5 round to down', function () {
     236
     237    /**
     238     *Arrange
     239     */
     240    /** @var CountryManager | Mockery\Mock $country_manager_spy */
     241    $country_manager_spy = Mockery::spy(new CountryManagerImpl(
     242        $this->container,
     243        $this->logger,
     244        'logo',
     245        config('plugin_number')
     246    ));
     247
     248    /**
     249     * Woocommerce functions called
     250     */
     251    expect_woocommerce('wc_get_base_location')->andReturn(['country' => 'CL']);
     252    expect_woocommerce('get_woocommerce_currency')->andReturn('CLP');
     253    expect_woocommerce('is_admin')->andReturn(true);
     254
     255    /**
     256     * Act
     257     */
     258    $needs_round = $country_manager_spy->doesTheCountryNeedRound();
     259    $rounded_value_up = $country_manager_spy->round(19.5);
     260    $rounded_value_down = $country_manager_spy->round(19.4);
     261
     262    /**
     263     * Assert
     264     */
     265    expect($needs_round)->toBeTrue();
     266    expect($rounded_value_up)->toBeFloat();
     267    expect($rounded_value_up)->toEqual(20);
     268    expect($rounded_value_down)->toEqual(19);
     269});
     270
     271it('checks if the current country as peru DOES NOT requires to round the values', function () {
     272
     273    /**
     274     *Arrange
     275     */
     276    /** @var CountryManager | Mockery\Mock $country_manager_spy */
     277    $country_manager_spy = Mockery::spy(new CountryManagerImpl(
     278        $this->container,
     279        $this->logger,
     280        'logo',
     281        config('plugin_number')
     282    ));
     283
     284    /**
     285     * Woocommerce functions called
     286     */
     287    expect_woocommerce('wc_get_base_location')->andReturn(['country' => 'PE']);
     288    expect_woocommerce('get_woocommerce_currency')->andReturn('SOL');
     289    expect_woocommerce('is_admin')->andReturn(true);
     290
     291    /**
     292     * Act
     293     */
     294    $needs_round = $country_manager_spy->doesTheCountryNeedRound();
     295    $not_rounded_value = $country_manager_spy->round(19.5);
     296
     297    /**
     298     * Assert
     299     */
     300    expect($needs_round)->toBeFalse();
     301    expect($not_rounded_value)->toBeFloat();
     302    expect($not_rounded_value)->toEqual(19.5);
     303
     304});
     305
     306it('checks if the current function makes the round correctly based in the .env configuration by 4 decimales', function () {
     307
     308    /**
     309     *Arrange
     310     */
     311    /** @var CountryManager | Mockery\Mock $country_manager_spy */
     312    $country_manager_spy = Mockery::spy(new CountryManagerImpl(
     313        $this->container,
     314        $this->logger,
     315        'logo',
     316        config('plugin_number')
     317    ));
     318
     319    $_ENV["FPAY_DECIMALS"]="4";
     320
     321    /**
     322     * Woocommerce functions called
     323     */
     324    expect_woocommerce('wc_get_base_location')->andReturn(['country' => 'PE']);
     325    expect_woocommerce('get_woocommerce_currency')->andReturn('SOL');
     326    expect_woocommerce('is_admin')->andReturn(true);
     327
     328    /**
     329     * Act
     330     */
     331    $needs_round = $country_manager_spy->doesTheCountryNeedRound();
     332    $rounded_value_by_four_decimales = $country_manager_spy->round(19.51509);
     333
     334    /**
     335     * Assert
     336     */
     337    expect($needs_round)->toBeFalse();
     338    expect($rounded_value_by_four_decimales)->toBeFloat();
     339    expect($rounded_value_by_four_decimales)->toEqual(19.5151);
     340    expect(config('decimals_quantity'))->toEqual(4);
     341
     342});
  • fpay-gateway/trunk/vendor/composer/installed.json

    r2902085 r2912552  
    847847        {
    848848            "name": "json-mapper/json-mapper",
    849             "version": "2.16.0",
    850             "version_normalized": "2.16.0.0",
     849            "version": "2.18.0",
     850            "version_normalized": "2.18.0.0",
    851851            "source": {
    852852                "type": "git",
    853853                "url": "https://github.com/JsonMapper/JsonMapper.git",
    854                 "reference": "0b31f49640340ebde6ad0357316cdb22a5335e76"
    855             },
    856             "dist": {
    857                 "type": "zip",
    858                 "url": "https://api.github.com/repos/JsonMapper/JsonMapper/zipball/0b31f49640340ebde6ad0357316cdb22a5335e76",
    859                 "reference": "0b31f49640340ebde6ad0357316cdb22a5335e76",
     854                "reference": "24144cc22f9eccc3360eb91c85c1a44546fb4ca8"
     855            },
     856            "dist": {
     857                "type": "zip",
     858                "url": "https://api.github.com/repos/JsonMapper/JsonMapper/zipball/24144cc22f9eccc3360eb91c85c1a44546fb4ca8",
     859                "reference": "24144cc22f9eccc3360eb91c85c1a44546fb4ca8",
    860860                "shasum": ""
    861861            },
     
    878878                "squizlabs/php_codesniffer": "^3.5",
    879879                "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0",
    880                 "vimeo/psalm": "^4.10"
     880                "vimeo/psalm": "^4.10 || ^5.0"
    881881            },
    882882            "suggest": {
     
    884884                "json-mapper/symfony-bundle": "Use JsonMapper directly with Symfony"
    885885            },
    886             "time": "2023-02-13T19:28:05+00:00",
     886            "time": "2023-05-12T16:49:57+00:00",
    887887            "type": "library",
    888888            "installation-source": "dist",
     
    21022102        {
    21032103            "name": "react/promise",
    2104             "version": "v2.9.0",
    2105             "version_normalized": "2.9.0.0",
     2104            "version": "v2.10.0",
     2105            "version_normalized": "2.10.0.0",
    21062106            "source": {
    21072107                "type": "git",
    21082108                "url": "https://github.com/reactphp/promise.git",
    2109                 "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910"
    2110             },
    2111             "dist": {
    2112                 "type": "zip",
    2113                 "url": "https://api.github.com/repos/reactphp/promise/zipball/234f8fd1023c9158e2314fa9d7d0e6a83db42910",
    2114                 "reference": "234f8fd1023c9158e2314fa9d7d0e6a83db42910",
     2109                "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38"
     2110            },
     2111            "dist": {
     2112                "type": "zip",
     2113                "url": "https://api.github.com/repos/reactphp/promise/zipball/f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
     2114                "reference": "f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38",
    21152115                "shasum": ""
    21162116            },
     
    21192119            },
    21202120            "require-dev": {
    2121                 "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
    2122             },
    2123             "time": "2022-02-11T10:27:51+00:00",
     2121                "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36"
     2122            },
     2123            "time": "2023-05-02T15:15:43+00:00",
    21242124            "type": "library",
    21252125            "installation-source": "dist",
     
    21652165            "support": {
    21662166                "issues": "https://github.com/reactphp/promise/issues",
    2167                 "source": "https://github.com/reactphp/promise/tree/v2.9.0"
    2168             },
    2169             "funding": [
    2170                 {
    2171                     "url": "https://github.com/WyriHaximus",
    2172                     "type": "github"
    2173                 },
    2174                 {
    2175                     "url": "https://github.com/clue",
    2176                     "type": "github"
     2167                "source": "https://github.com/reactphp/promise/tree/v2.10.0"
     2168            },
     2169            "funding": [
     2170                {
     2171                    "url": "https://opencollective.com/reactphp",
     2172                    "type": "open_collective"
    21772173                }
    21782174            ],
     
    21812177        {
    21822178            "name": "seld/jsonlint",
    2183             "version": "1.9.0",
    2184             "version_normalized": "1.9.0.0",
     2179            "version": "1.10.0",
     2180            "version_normalized": "1.10.0.0",
    21852181            "source": {
    21862182                "type": "git",
    21872183                "url": "https://github.com/Seldaek/jsonlint.git",
    2188                 "reference": "4211420d25eba80712bff236a98960ef68b866b7"
    2189             },
    2190             "dist": {
    2191                 "type": "zip",
    2192                 "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/4211420d25eba80712bff236a98960ef68b866b7",
    2193                 "reference": "4211420d25eba80712bff236a98960ef68b866b7",
     2184                "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1"
     2185            },
     2186            "dist": {
     2187                "type": "zip",
     2188                "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/594fd6462aad8ecee0b45ca5045acea4776667f1",
     2189                "reference": "594fd6462aad8ecee0b45ca5045acea4776667f1",
    21942190                "shasum": ""
    21952191            },
     
    22012197                "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13"
    22022198            },
    2203             "time": "2022-04-01T13:37:23+00:00",
     2199            "time": "2023-05-11T13:16:46+00:00",
    22042200            "bin": [
    22052201                "bin/jsonlint"
     
    22322228            "support": {
    22332229                "issues": "https://github.com/Seldaek/jsonlint/issues",
    2234                 "source": "https://github.com/Seldaek/jsonlint/tree/1.9.0"
     2230                "source": "https://github.com/Seldaek/jsonlint/tree/1.10.0"
    22352231            },
    22362232            "funding": [
     
    23632359        {
    23642360            "name": "symfony/cache",
    2365             "version": "v5.4.22",
    2366             "version_normalized": "5.4.22.0",
     2361            "version": "v5.4.23",
     2362            "version_normalized": "5.4.23.0",
    23672363            "source": {
    23682364                "type": "git",
    23692365                "url": "https://github.com/symfony/cache.git",
    2370                 "reference": "5ed986c4ef65f0dea5e9753630b5cb1f07f847d6"
    2371             },
    2372             "dist": {
    2373                 "type": "zip",
    2374                 "url": "https://api.github.com/repos/symfony/cache/zipball/5ed986c4ef65f0dea5e9753630b5cb1f07f847d6",
    2375                 "reference": "5ed986c4ef65f0dea5e9753630b5cb1f07f847d6",
     2366                "reference": "983c79ff28612cdfd66d8e44e1a06e5afc87e107"
     2367            },
     2368            "dist": {
     2369                "type": "zip",
     2370                "url": "https://api.github.com/repos/symfony/cache/zipball/983c79ff28612cdfd66d8e44e1a06e5afc87e107",
     2371                "reference": "983c79ff28612cdfd66d8e44e1a06e5afc87e107",
    23762372                "shasum": ""
    23772373            },
     
    24112407                "symfony/var-dumper": "^4.4|^5.0|^6.0"
    24122408            },
    2413             "time": "2023-03-29T20:01:08+00:00",
     2409            "time": "2023-04-21T15:38:51+00:00",
    24142410            "type": "library",
    24152411            "installation-source": "dist",
     
    24432439            ],
    24442440            "support": {
    2445                 "source": "https://github.com/symfony/cache/tree/v5.4.22"
     2441                "source": "https://github.com/symfony/cache/tree/v5.4.23"
    24462442            },
    24472443            "funding": [
     
    25452541        {
    25462542            "name": "symfony/console",
    2547             "version": "v5.4.22",
    2548             "version_normalized": "5.4.22.0",
     2543            "version": "v5.4.23",
     2544            "version_normalized": "5.4.23.0",
    25492545            "source": {
    25502546                "type": "git",
    25512547                "url": "https://github.com/symfony/console.git",
    2552                 "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8"
    2553             },
    2554             "dist": {
    2555                 "type": "zip",
    2556                 "url": "https://api.github.com/repos/symfony/console/zipball/3cd51fd2e6c461ca678f84d419461281bd87a0a8",
    2557                 "reference": "3cd51fd2e6c461ca678f84d419461281bd87a0a8",
     2548                "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c"
     2549            },
     2550            "dist": {
     2551                "type": "zip",
     2552                "url": "https://api.github.com/repos/symfony/console/zipball/90f21e27d0d88ce38720556dd164d4a1e4c3934c",
     2553                "reference": "90f21e27d0d88ce38720556dd164d4a1e4c3934c",
    25582554                "shasum": ""
    25592555            },
     
    25932589                "symfony/process": ""
    25942590            },
    2595             "time": "2023-03-25T09:27:28+00:00",
     2591            "time": "2023-04-24T18:47:29+00:00",
    25962592            "type": "library",
    25972593            "installation-source": "dist",
     
    26272623            ],
    26282624            "support": {
    2629                 "source": "https://github.com/symfony/console/tree/v5.4.22"
     2625                "source": "https://github.com/symfony/console/tree/v5.4.23"
    26302626            },
    26312627            "funding": [
     
    27172713        {
    27182714            "name": "symfony/filesystem",
    2719             "version": "v5.4.21",
    2720             "version_normalized": "5.4.21.0",
     2715            "version": "v5.4.23",
     2716            "version_normalized": "5.4.23.0",
    27212717            "source": {
    27222718                "type": "git",
    27232719                "url": "https://github.com/symfony/filesystem.git",
    2724                 "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f"
    2725             },
    2726             "dist": {
    2727                 "type": "zip",
    2728                 "url": "https://api.github.com/repos/symfony/filesystem/zipball/e75960b1bbfd2b8c9e483e0d74811d555ca3de9f",
    2729                 "reference": "e75960b1bbfd2b8c9e483e0d74811d555ca3de9f",
     2720                "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5"
     2721            },
     2722            "dist": {
     2723                "type": "zip",
     2724                "url": "https://api.github.com/repos/symfony/filesystem/zipball/b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5",
     2725                "reference": "b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5",
    27302726                "shasum": ""
    27312727            },
     
    27362732                "symfony/polyfill-php80": "^1.16"
    27372733            },
    2738             "time": "2023-02-14T08:03:56+00:00",
     2734            "time": "2023-03-02T11:38:35+00:00",
    27392735            "type": "library",
    27402736            "installation-source": "dist",
     
    27642760            "homepage": "https://symfony.com",
    27652761            "support": {
    2766                 "source": "https://github.com/symfony/filesystem/tree/v5.4.21"
     2762                "source": "https://github.com/symfony/filesystem/tree/v5.4.23"
    27672763            },
    27682764            "funding": [
     
    34423438        {
    34433439            "name": "symfony/process",
    3444             "version": "v5.4.22",
    3445             "version_normalized": "5.4.22.0",
     3440            "version": "v5.4.23",
     3441            "version_normalized": "5.4.23.0",
    34463442            "source": {
    34473443                "type": "git",
    34483444                "url": "https://github.com/symfony/process.git",
    3449                 "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b"
    3450             },
    3451             "dist": {
    3452                 "type": "zip",
    3453                 "url": "https://api.github.com/repos/symfony/process/zipball/4b850da0cc3a2a9181c1ed407adbca4733dc839b",
    3454                 "reference": "4b850da0cc3a2a9181c1ed407adbca4733dc839b",
     3445                "reference": "4b842fc4b61609e0a155a114082bd94e31e98287"
     3446            },
     3447            "dist": {
     3448                "type": "zip",
     3449                "url": "https://api.github.com/repos/symfony/process/zipball/4b842fc4b61609e0a155a114082bd94e31e98287",
     3450                "reference": "4b842fc4b61609e0a155a114082bd94e31e98287",
    34553451                "shasum": ""
    34563452            },
     
    34593455                "symfony/polyfill-php80": "^1.16"
    34603456            },
    3461             "time": "2023-03-06T21:29:33+00:00",
     3457            "time": "2023-04-18T13:50:24+00:00",
    34623458            "type": "library",
    34633459            "installation-source": "dist",
     
    34873483            "homepage": "https://symfony.com",
    34883484            "support": {
    3489                 "source": "https://github.com/symfony/process/tree/v5.4.22"
     3485                "source": "https://github.com/symfony/process/tree/v5.4.23"
    34903486            },
    34913487            "funding": [
  • fpay-gateway/trunk/vendor/composer/installed.php

    r2902085 r2912552  
    120120        ),
    121121        'json-mapper/json-mapper' => array(
    122             'pretty_version' => '2.16.0',
    123             'version' => '2.16.0.0',
    124             'reference' => '0b31f49640340ebde6ad0357316cdb22a5335e76',
     122            'pretty_version' => '2.18.0',
     123            'version' => '2.18.0.0',
     124            'reference' => '24144cc22f9eccc3360eb91c85c1a44546fb4ca8',
    125125            'type' => 'library',
    126126            'install_path' => __DIR__ . '/../json-mapper/json-mapper',
     
    307307        ),
    308308        'react/promise' => array(
    309             'pretty_version' => 'v2.9.0',
    310             'version' => '2.9.0.0',
    311             'reference' => '234f8fd1023c9158e2314fa9d7d0e6a83db42910',
     309            'pretty_version' => 'v2.10.0',
     310            'version' => '2.10.0.0',
     311            'reference' => 'f913fb8cceba1e6644b7b90c4bfb678ed8a3ef38',
    312312            'type' => 'library',
    313313            'install_path' => __DIR__ . '/../react/promise',
     
    322322        ),
    323323        'seld/jsonlint' => array(
    324             'pretty_version' => '1.9.0',
    325             'version' => '1.9.0.0',
    326             'reference' => '4211420d25eba80712bff236a98960ef68b866b7',
     324            'pretty_version' => '1.10.0',
     325            'version' => '1.10.0.0',
     326            'reference' => '594fd6462aad8ecee0b45ca5045acea4776667f1',
    327327            'type' => 'library',
    328328            'install_path' => __DIR__ . '/../seld/jsonlint',
     
    349349        ),
    350350        'symfony/cache' => array(
    351             'pretty_version' => 'v5.4.22',
    352             'version' => '5.4.22.0',
    353             'reference' => '5ed986c4ef65f0dea5e9753630b5cb1f07f847d6',
     351            'pretty_version' => 'v5.4.23',
     352            'version' => '5.4.23.0',
     353            'reference' => '983c79ff28612cdfd66d8e44e1a06e5afc87e107',
    354354            'type' => 'library',
    355355            'install_path' => __DIR__ . '/../symfony/cache',
     
    373373        ),
    374374        'symfony/console' => array(
    375             'pretty_version' => 'v5.4.22',
    376             'version' => '5.4.22.0',
    377             'reference' => '3cd51fd2e6c461ca678f84d419461281bd87a0a8',
     375            'pretty_version' => 'v5.4.23',
     376            'version' => '5.4.23.0',
     377            'reference' => '90f21e27d0d88ce38720556dd164d4a1e4c3934c',
    378378            'type' => 'library',
    379379            'install_path' => __DIR__ . '/../symfony/console',
     
    391391        ),
    392392        'symfony/filesystem' => array(
    393             'pretty_version' => 'v5.4.21',
    394             'version' => '5.4.21.0',
    395             'reference' => 'e75960b1bbfd2b8c9e483e0d74811d555ca3de9f',
     393            'pretty_version' => 'v5.4.23',
     394            'version' => '5.4.23.0',
     395            'reference' => 'b2f79d86cd9e7de0fff6d03baa80eaed7a5f38b5',
    396396            'type' => 'library',
    397397            'install_path' => __DIR__ . '/../symfony/filesystem',
     
    472472        ),
    473473        'symfony/process' => array(
    474             'pretty_version' => 'v5.4.22',
    475             'version' => '5.4.22.0',
    476             'reference' => '4b850da0cc3a2a9181c1ed407adbca4733dc839b',
     474            'pretty_version' => 'v5.4.23',
     475            'version' => '5.4.23.0',
     476            'reference' => '4b842fc4b61609e0a155a114082bd94e31e98287',
    477477            'type' => 'library',
    478478            'install_path' => __DIR__ . '/../symfony/process',
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/CHANGELOG.md

    r2880636 r2912552  
    66
    77## [Unreleased]
     8
     9## [2.18.0] - 2023-05-12
     10### Fixed
     11- Support private properties from parent class in DocBlockAnnotations and TypedProperties [PR#161](https://github.com/JsonMapper/JsonMapper/pull/161)
     12
     13## [2.17.0] - 2023-05-02
     14### Changed
     15- Allow vimeo/psalm 5.0 as dev dependency
     16- Allow recursive traversal in CaseConversion middleware [PR#160](https://github.com/JsonMapper/JsonMapper/pull/160)
     17### Fixed
     18- Fix null value reaching native php class factories [PR#159](https://github.com/JsonMapper/JsonMapper/pull/159). Thanks to [template-provider](https://github.com/template-provider) for reporting the issue.
    819
    920## [2.16.0] - 2023-02-13
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/Version

    r2880636 r2912552  
    1 2.16.0
     12.18.0
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/composer.json

    r2880636 r2912552  
    3030        "squizlabs/php_codesniffer": "^3.5",
    3131        "symfony/console": "^2.1 || ^3.0 || ^4.0 || ^5.0",
    32         "vimeo/psalm": "^4.10"
     32        "vimeo/psalm": "^4.10 || ^5.0"
    3333    },
    3434    "autoload": {
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/src/Handler/ValueFactory.php

    r2904129 r2912552  
    9595        }
    9696
     97        if (\is_null($value) && $property->isNullable()) {
     98            return null;
     99        }
    97100        // No match was found (or there was only one option) lets assume the first is the right one.
    98101        $types = $property->getPropertyTypes();
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/src/Middleware/CaseConversion.php

    r2834802 r2912552  
    1616    /** @var TextNotation */
    1717    private $replacementSeparator;
     18    /** @var bool */
     19    private $applyRecursive;
    1820
    19     public function __construct(TextNotation $searchSeparator, TextNotation $replacementSeparator)
    20     {
     21    public function __construct(
     22        TextNotation $searchSeparator,
     23        TextNotation $replacementSeparator,
     24        bool $applyRecursive = false
     25    ) {
    2126        $this->searchSeparator = $searchSeparator;
    2227        $this->replacementSeparator = $replacementSeparator;
     28        $this->applyRecursive = $applyRecursive;
    2329    }
    2430
     
    3339        }
    3440
     41        $this->replace($json);
     42    }
     43
     44    /** @param \stdClass|array $json */
     45    private function replace($json): void
     46    {
     47        if (is_array($json)) {
     48            array_walk(
     49                $json,
     50                function ($value) {
     51                    $this->replace($value);
     52                }
     53            );
     54            return;
     55        }
     56
    3557        $keys = \array_keys((array) $json);
    3658        foreach ($keys as $key) {
     
    4163            }
    4264
    43             $json->$replacementKey = $json->$key;
     65            $value = $json->$key;
     66            $json->$replacementKey = $value;
    4467            unset($json->$key);
     68
     69            if ($this->applyRecursive && (is_array($value) || $value instanceof \stdClass)) {
     70                $this->replace($value);
     71            }
    4572        }
    4673    }
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/src/Middleware/DocBlockAnnotations.php

    r2880636 r2912552  
    4646        }
    4747
    48         $properties = $object->getReflectedObject()->getProperties();
    4948        $intermediatePropertyMap = new PropertyMap();
    50 
    51         foreach ($properties as $property) {
     49        foreach ($this->getObjectPropertiesIncludingParents($object) as $property) {
    5250            $name = $property->getName();
    5351            $docBlock = $property->getDocComment();
     
    130128        return new AnnotationMap($var ?: null, [], null);
    131129    }
     130
     131    /** @return \ReflectionProperty[] */
     132    public function getObjectPropertiesIncludingParents(ObjectWrapper $object): array
     133    {
     134        $properties = [];
     135        $reflectionClass = $object->getReflectedObject();
     136        do {
     137            $properties = array_merge($properties, $reflectionClass->getProperties());
     138        } while ($reflectionClass = $reflectionClass->getParentClass());
     139        return $properties;
     140    }
    132141}
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/src/Middleware/TypedProperties.php

    r2880636 r2912552  
    4545        }
    4646
    47         $reflectionProperties = $object->getReflectedObject()->getProperties();
    4847        $intermediatePropertyMap = new PropertyMap();
    4948
    50         foreach ($reflectionProperties as $reflectionProperty) {
     49        foreach ($this->getObjectPropertiesIncludingParents($object) as $reflectionProperty) {
    5150            $type = $reflectionProperty->getType();
    5251
     
    9897        return $intermediatePropertyMap;
    9998    }
     99
     100    /** @return \ReflectionProperty[] */
     101    public function getObjectPropertiesIncludingParents(ObjectWrapper $object): array
     102    {
     103        $properties = [];
     104        $reflectionClass = $object->getReflectedObject();
     105        do {
     106            $properties = array_merge($properties, $reflectionClass->getProperties());
     107        } while ($reflectionClass = $reflectionClass->getParentClass());
     108        return $properties;
     109    }
    100110}
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/tests/Unit/Handler/ValueFactoryTest.php

    r2904129 r2912552  
    448448    }
    449449
     450    /**
     451     * @covers \JsonMapper\Handler\ValueFactory
     452     */
     453    public function testItCanMapToNullWhenPropertyIsNullable(): void
     454    {
     455        $property = PropertyBuilder::new()
     456            ->setName('value')
     457            ->addType(\DateTimeImmutable::class, ArrayInformation::notAnArray())
     458            ->setIsNullable(true)
     459            ->setVisibility(Visibility::PUBLIC())
     460            ->build();
     461        $propertyMap = new PropertyMap();
     462        $propertyMap->addProperty($property);
     463        $jsonMapper = $this->createMock(JsonMapperInterface::class);
     464        $valueFactory = new ValueFactory(new ScalarCaster(), new FactoryRegistry(), new FactoryRegistry());
     465
     466        $this->assertNull($valueFactory->build($jsonMapper, $property, null));
     467    }
     468
    450469    public function scalarValueDataTypes(): array
    451470    {
  • fpay-gateway/trunk/vendor/json-mapper/json-mapper/tests/Unit/Middleware/CaseConversionTest.php

    r2834802 r2912552  
    118118        self::assertObjectHasAttribute('key', $json);
    119119        self::assertEquals('placeholder', $json->key);
     120    }
     121
     122    /**
     123     * @covers \JsonMapper\Middleware\CaseConversion
     124     */
     125    public function testWillRecursivelyApplyCaseConversionWhenApplied(): void
     126    {
     127        $middleware = new CaseConversion(TextNotation::STUDLY_CAPS(), TextNotation::CAMEL_CASE(), true);
     128        $json = (object) [
     129            'One' => 1,
     130            'Object' => (object) ['TwentyOne' => 21],
     131            'Array' => [
     132                (object) ['FirstName' => 'Jane', 'LastName' => 'Doe'],
     133                (object) ['FirstName' => 'John', 'LastName' => 'Doe'],
     134            ]
     135        ];
     136        $object = new ObjectWrapper(null, \stdClass::class);
     137
     138        $middleware->handle($json, $object, new PropertyMap(), $this->createMock(JsonMapperInterface::class));
     139
     140        self::assertEquals(
     141            (object) [
     142                'one' => 1,
     143                'object' => (object) ['twentyOne' => 21],
     144                'array' => [
     145                    (object) ['firstName' => 'Jane', 'lastName' => 'Doe'],
     146                    (object) ['firstName' => 'John', 'lastName' => 'Doe'],
     147                ]
     148            ],
     149            $json
     150        );
     151    }
     152
     153    /**
     154     * @covers \JsonMapper\Middleware\CaseConversion
     155     */
     156    public function testWillNotRecursivelyApplyCaseConversionWhenNotApplied(): void
     157    {
     158        $middleware = new CaseConversion(TextNotation::STUDLY_CAPS(), TextNotation::CAMEL_CASE(), false);
     159        $json = (object) [
     160            'One' => 1,
     161            'Object' => (object) ['TwentyOne' => 21],
     162            'Array' => [
     163                (object) ['FirstName' => 'Jane', 'LastName' => 'Doe'],
     164                (object) ['FirstName' => 'John', 'LastName' => 'Doe'],
     165            ]
     166        ];
     167        $object = new ObjectWrapper(null, \stdClass::class);
     168
     169        $middleware->handle($json, $object, new PropertyMap(), $this->createMock(JsonMapperInterface::class));
     170
     171        self::assertEquals(
     172            (object) [
     173                'one' => 1,
     174                'object' => (object) ['TwentyOne' => 21],
     175                'array' => [
     176                    (object) ['FirstName' => 'Jane', 'LastName' => 'Doe'],
     177                    (object) ['FirstName' => 'John', 'LastName' => 'Doe'],
     178                ]
     179            ],
     180            $json
     181        );
    120182    }
    121183
  • fpay-gateway/trunk/vendor/react/promise/CHANGELOG.md

    r2834802 r2912552  
    11CHANGELOG for 2.x
    22=================
     3
     4## 2.10.0 (2023-05-02)
     5
     6*   Feature: Support Disjunctive Normal Form Types (DNF types) for PHP 8.2+.
     7    (#237 by @nhedger)
     8
     9    Feature: Add full support for PHP 8.2.
     10    (#233 by @WyriHaximus and #241 by @clue)
     11
     12*   Improve examples in documentation.
     13    (#226 by @nhedger)
     14
     15*   Improve test suite and project setup and report failed assertions.
     16    (#215 and #217 by @SimonFrings and #241 by @clue)
    317
    418* 2.9.0 (2022-02-11)
  • fpay-gateway/trunk/vendor/react/promise/README.md

    r2834802 r2912552  
    55[CommonJS Promises/A](http://wiki.commonjs.org/wiki/Promises/A) for PHP.
    66
    7 [![CI status](https://github.com/reactphp/promise/workflows/CI/badge.svg?branch=2.x)](https://github.com/reactphp/promise/actions)
     7[![CI status](https://github.com/reactphp/promise/actions/workflows/ci.yml/badge.svg?branch=2.x)](https://github.com/reactphp/promise/actions)
     8[![installs on Packagist](https://img.shields.io/packagist/dt/react/promise?color=blue&label=installs%20on%20Packagist)](https://packagist.org/packages/react/promise)
    89
    910Table of Contents
     
    850851
    851852```bash
    852 $ composer require react/promise:^2.9
     853composer require react/promise:^2.10
    853854```
    854855
  • fpay-gateway/trunk/vendor/react/promise/composer.json

    r2834802 r2912552  
    2929    },
    3030    "require-dev": {
    31         "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8.36"
     31        "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.36"
    3232    },
    3333    "autoload": {
  • fpay-gateway/trunk/vendor/react/promise/src/functions.php

    r2834802 r2912552  
    355355    // Extract the type of the argument and handle different possibilities
    356356    $type = $expectedException->getType();
    357    
     357
    358358    $isTypeUnion = true;
    359359    $types = [];
     
    380380
    381381    foreach ($types as $type) {
    382         if (!$type instanceof \ReflectionNamedType) {
    383             throw new \LogicException('This implementation does not support groups of intersection or union types');
     382
     383        if ($type instanceof \ReflectionIntersectionType) {
     384            foreach ($type->getTypes() as $typeToMatch) {
     385                if (!($matches = ($typeToMatch->isBuiltin() && \gettype($object) === $typeToMatch->getName())
     386                    || (new \ReflectionClass($typeToMatch->getName()))->isInstance($object))) {
     387                    break;
     388                }
     389            }
     390        } else {
     391            $matches = ($type->isBuiltin() && \gettype($object) === $type->getName())
     392                || (new \ReflectionClass($type->getName()))->isInstance($object);
    384393        }
    385 
    386         // A named-type can be either a class-name or a built-in type like string, int, array, etc.
    387         $matches = ($type->isBuiltin() && \gettype($object) === $type->getName())
    388             || (new \ReflectionClass($type->getName()))->isInstance($object);
    389 
    390394
    391395        // If we look for a single match (union), we can return early on match
  • fpay-gateway/trunk/vendor/seld/jsonlint/CHANGELOG.md

    r2834802 r2912552  
    11You can find newer changelog entries in [GitHub releases](https://github.com/Seldaek/jsonlint/releases)
     2
     3### 1.10.0 (2023-05-11)
     4
     5  * Added ALLOW_COMMENTS flag to parse while allowing (and ignoring) inline `//` and multiline `/* */` comments in the JSON document (#81)
     6
     7### 1.9.0 (2022-04-01)
     8
     9  * Internal cleanups and type fixes
    210
    311### 1.8.1 (2020-08-13)
  • fpay-gateway/trunk/vendor/seld/jsonlint/README.md

    r2834802 r2912552  
    3535- `JsonParser::ALLOW_DUPLICATE_KEYS` collects duplicate keys. e.g. if you have two `foo` keys they will end up as `foo` and `foo.2`.
    3636- `JsonParser::PARSE_TO_ASSOC` parses to associative arrays instead of stdClass objects.
     37- `JsonParser::ALLOW_COMMENTS` parses while allowing (and ignoring) inline `//` and multiline `/* */` comments in the JSON document.
    3738
    3839Example:
  • fpay-gateway/trunk/vendor/seld/jsonlint/src/Seld/JsonLint/JsonParser.php

    r2834802 r2912552  
    3131    const ALLOW_DUPLICATE_KEYS = 2;
    3232    const PARSE_TO_ASSOC = 4;
     33    const ALLOW_COMMENTS = 8;
    3334
    3435    /** @var Lexer */
     
    3738    /**
    3839     * @var int
    39      * @psalm-var int-mask-of<self::*>
     40     * @phpstan-var int-mask-of<self::*>
    4041     */
    4142    private $flags;
     
    178179     * @param  int                   $flags Bitmask of parse/lint options (see constants of this class)
    179180     * @return null|ParsingException null if no error is found, a ParsingException containing all details otherwise
     181     *
     182     * @phpstan-param int-mask-of<self::*> $flags
    180183     */
    181184    public function lint($input, $flags = 0)
     
    194197     * @return mixed
    195198     * @throws ParsingException
     199     *
     200     * @phpstan-param int-mask-of<self::*> $flags
    196201     */
    197202    public function parse($input, $flags = 0)
     
    211216        $recovering = 0;
    212217
    213         $this->lexer = new Lexer();
     218        $this->lexer = new Lexer($flags);
    214219        $this->lexer->setInput($input);
    215220
  • fpay-gateway/trunk/vendor/seld/jsonlint/src/Seld/JsonLint/Lexer.php

    r2834802 r2912552  
    2525    const T_SKIP_WHITESPACE = 0;
    2626    const T_ERROR = 2;
    27 
    28     /**
    29      * @phpstan-var array<int<0,13>, string>
     27    /** @internal */
     28    const T_BREAK_LINE = 3;
     29    /** @internal */
     30    const T_COMMENT = 30;
     31    /** @internal */
     32    const T_OPEN_COMMENT = 31;
     33    /** @internal */
     34    const T_CLOSE_COMMENT = 32;
     35
     36    /**
     37     * @phpstan-var array<int<0,17>, string>
    3038     * @const
    3139     */
    3240    private $rules = array(
    33         0 => '/\G\s+/',
    34         1 => '/\G-?([0-9]|[1-9][0-9]+)(\.[0-9]+)?([eE][+-]?[0-9]+)?\b/',
    35         2 => '{\G"(?>\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\0-\x1f\\\\"]++)*+"}',
    36         3 => '/\G\{/',
    37         4 => '/\G\}/',
    38         5 => '/\G\[/',
    39         6 => '/\G\]/',
    40         7 => '/\G,/',
    41         8 => '/\G:/',
    42         9 => '/\Gtrue\b/',
    43         10 => '/\Gfalse\b/',
    44         11 => '/\Gnull\b/',
    45         12 => '/\G$/',
    46         13 => '/\G./',
     41        0 => '/\G\s*\n\r?/',
     42        1 => '/\G\s+/',
     43        2 => '/\G-?([0-9]|[1-9][0-9]+)(\.[0-9]+)?([eE][+-]?[0-9]+)?\b/',
     44        3 => '{\G"(?>\\\\["bfnrt/\\\\]|\\\\u[a-fA-F0-9]{4}|[^\0-\x1f\\\\"]++)*+"}',
     45        4 => '/\G\{/',
     46        5 => '/\G\}/',
     47        6 => '/\G\[/',
     48        7 => '/\G\]/',
     49        8 => '/\G,/',
     50        9 => '/\G:/',
     51        10 => '/\Gtrue\b/',
     52        11 => '/\Gfalse\b/',
     53        12 => '/\Gnull\b/',
     54        13 => '/\G$/',
     55        14 => '/\G\/\//',
     56        15 => '/\G\/\*/',
     57        16 => '/\G\*\//',
     58        17 => '/\G./',
    4759    );
    4860
     
    5567    /** @var 0|positive-int */
    5668    private $offset;
     69    /** @var int */
     70    private $flags;
    5771
    5872    /** @var string */
     
    6882
    6983    /**
    70      * @return 1|4|6|8|10|11|14|17|18|21|22|23|24|-1
     84     * @param int $flags
     85     */
     86    public function __construct($flags = 0)
     87    {
     88        $this->flags = $flags;
     89    }
     90
     91    /**
     92     * @return 0|1|4|6|8|10|11|14|17|18|21|22|23|24|30|-1
    7193     */
    7294    public function lex()
    7395    {
    74         do {
     96        while (true) {
    7597            $symbol = $this->next();
    76         } while ($symbol === self::T_SKIP_WHITESPACE);
    77 
    78         return $symbol;
     98            switch ($symbol) {
     99                case self::T_SKIP_WHITESPACE:
     100                case self::T_BREAK_LINE:
     101                    break;
     102                case self::T_COMMENT:
     103                case self::T_OPEN_COMMENT:
     104                    if (!($this->flags & JsonParser::ALLOW_COMMENTS)) {
     105                        $this->parseError('Lexical error on line ' . ($this->yylineno+1) . ". Comments are not allowed.\n" . $this->showPosition());
     106                    }
     107                    $this->skipUntil($symbol === self::T_COMMENT ? self::T_BREAK_LINE : self::T_CLOSE_COMMENT);
     108                    if ($this->done) {
     109                        // last symbol '/\G$/' before EOF
     110                        return 14;
     111                    }
     112                    break;
     113                case self::T_CLOSE_COMMENT:
     114                    $this->parseError('Lexical error on line ' . ($this->yylineno+1) . ". Unexpected token.\n" . $this->showPosition());
     115                default:
     116                    return $symbol;
     117            }
     118        }
    79119    }
    80120
     
    161201
    162202    /**
    163      * @return 0|1|4|6|8|10|11|14|17|18|21|22|23|24|-1
     203     * @param int $token
     204     * @return void
     205     */
     206    private function skipUntil($token)
     207    {
     208        $symbol = $this->next();
     209        while ($symbol !== $token && false === $this->done) {
     210            $symbol = $this->next();
     211        }
     212    }
     213
     214    /**
     215     * @return 0|1|3|4|6|8|10|11|14|17|18|21|22|23|24|30|31|32|-1
    164216     */
    165217    private function next()
     
    182234        }
    183235
    184         $rulesLen = 14; // count($this->rules)
     236        $rulesLen = count($this->rules);
    185237
    186238        for ($i=0; $i < $rulesLen; $i++) {
     
    216268    /**
    217269     * @param  int $rule
    218      * @return 0|4|6|8|10|11|14|17|18|21|22|23|24|-1
     270     * @return 0|3|4|6|8|10|11|14|17|18|21|22|23|24|30|31|32|-1
    219271     */
    220272    private function performAction($rule)
    221273    {
    222274        switch ($rule) {
    223         case 0:/* skip whitespace */
     275        case 0:/* skip break line */
     276            return self::T_BREAK_LINE;
     277        case 1:/* skip whitespace */
    224278            return self::T_SKIP_WHITESPACE;
    225         case 1:
     279        case 2:
    226280            return 6;
    227         case 2:
     281        case 3:
    228282            $this->yytext = substr($this->yytext, 1, $this->yyleng-2);
    229 
    230283            return 4;
    231         case 3:
     284        case 4:
    232285            return 17;
    233         case 4:
     286        case 5:
    234287            return 18;
    235         case 5:
     288        case 6:
    236289            return 23;
    237         case 6:
     290        case 7:
    238291            return 24;
    239         case 7:
     292        case 8:
    240293            return 22;
    241         case 8:
     294        case 9:
    242295            return 21;
    243         case 9:
     296        case 10:
    244297            return 10;
    245         case 10:
     298        case 11:
    246299            return 11;
    247         case 11:
     300        case 12:
    248301            return 8;
    249         case 12:
     302        case 13:
    250303            return 14;
    251         case 13:
     304        case 14:
     305            return self::T_COMMENT;
     306        case 15:
     307            return self::T_OPEN_COMMENT;
     308        case 16:
     309            return self::T_CLOSE_COMMENT;
     310        case 17:
    252311            return self::T_INVALID;
    253312        default:
  • fpay-gateway/trunk/vendor/symfony/cache/Adapter/PhpFilesAdapter.php

    r2904129 r2912552  
    8383
    8484                if ($time >= $expiresAt) {
    85                     $pruned = $this->doUnlink($file) && !file_exists($file) && $pruned;
     85                    $pruned = ($this->doUnlink($file) || !file_exists($file)) && $pruned;
    8686                }
    8787            }
  • fpay-gateway/trunk/vendor/symfony/cache/Traits/FilesystemTrait.php

    r2904129 r2912552  
    4141            if (($expiresAt = (int) fgets($h)) && $time >= $expiresAt) {
    4242                fclose($h);
    43                 $pruned = @unlink($file) && !file_exists($file) && $pruned;
     43                $pruned = (@unlink($file) || !file_exists($file)) && $pruned;
    4444            } else {
    4545                fclose($h);
  • fpay-gateway/trunk/vendor/symfony/cache/Traits/RedisTrait.php

    r2904129 r2912552  
    333333                $params['parameters']['password'] = $auth;
    334334            }
     335
     336            if (isset($params['ssl'])) {
     337                foreach ($hosts as $i => $host) {
     338                    if (!isset($host['ssl'])) {
     339                        $hosts[$i]['ssl'] = $params['ssl'];
     340                    }
     341                }
     342            }
     343
    335344            if (1 === \count($hosts) && !($params['redis_cluster'] || $params['redis_sentinel'])) {
    336345                $hosts = $hosts[0];
     
    341350            $params['exceptions'] = false;
    342351
    343             $redis = new $class($hosts, array_diff_key($params, array_diff_key(self::$defaultConnectionOptions, ['ssl' => null])));
     352            $redis = new $class($hosts, array_diff_key($params, self::$defaultConnectionOptions));
    344353            if (isset($params['redis_sentinel'])) {
    345354                $redis->getConnection()->setSentinelTimeout($params['timeout']);
  • fpay-gateway/trunk/vendor/symfony/console/Command/DumpCompletionCommand.php

    r2880636 r2912552  
    133133    private function getSupportedShells(): array
    134134    {
    135         return array_map(function ($f) {
    136             return pathinfo($f, \PATHINFO_EXTENSION);
    137         }, glob(__DIR__.'/../Resources/completion.*'));
     135        $shells = [];
     136
     137        foreach (new \DirectoryIterator(__DIR__.'/../Resources/') as $file) {
     138            if (str_starts_with($file->getBasename(), 'completion.') && $file->isFile()) {
     139                $shells[] = $file->getExtension();
     140            }
     141        }
     142
     143        return $shells;
    138144    }
    139145}
  • fpay-gateway/trunk/vendor/symfony/console/Helper/Table.php

    r2834802 r2912552  
    806806                            $textLength = Helper::width($textContent);
    807807                            if ($textLength > 0) {
    808                                 $contentColumns = str_split($textContent, ceil($textLength / $cell->getColspan()));
     808                                $contentColumns = mb_str_split($textContent, ceil($textLength / $cell->getColspan()));
    809809                                foreach ($contentColumns as $position => $content) {
    810810                                    $row[$i + $position] = $content;
  • fpay-gateway/trunk/vendor/symfony/console/Terminal.php

    r2834802 r2912552  
    7878    {
    7979        if ('\\' === \DIRECTORY_SEPARATOR) {
    80             if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
     80            $ansicon = getenv('ANSICON');
     81            if (false !== $ansicon && preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim($ansicon), $matches)) {
    8182                // extract [w, H] from "wxh (WxH)"
    8283                // or [w, h] from "wxh"
     
    158159        ];
    159160
     161        $cp = \function_exists('sapi_windows_cp_set') ? sapi_windows_cp_get() : 0;
     162
    160163        $process = proc_open($command, $descriptorspec, $pipes, null, null, ['suppress_errors' => true]);
    161164        if (!\is_resource($process)) {
     
    168171        proc_close($process);
    169172
     173        if ($cp) {
     174            sapi_windows_cp_set($cp);
     175        }
     176
    170177        return $info;
    171178    }
  • fpay-gateway/trunk/vendor/symfony/filesystem/Filesystem.php

    r2834802 r2912552  
    171171            } elseif (is_dir($file)) {
    172172                if (!$isRecursive) {
    173                     $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-.'));
     173                    $tmpName = \dirname(realpath($file)).'/.'.strrev(strtr(base64_encode(random_bytes(2)), '/=', '-_'));
    174174
    175175                    if (file_exists($tmpName)) {
  • fpay-gateway/trunk/vendor/symfony/process/PhpExecutableFinder.php

    r2834802 r2912552  
    5757
    5858        // PHP_BINARY return the current sapi executable
    59         if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cgi-fcgi', 'cli', 'cli-server', 'phpdbg'], true)) {
     59        if (\PHP_BINARY && \in_array(\PHP_SAPI, ['cli', 'cli-server', 'phpdbg'], true)) {
    6060            return \PHP_BINARY.$args;
    6161        }
  • fpay-gateway/trunk/vendor_fpay/guzzlehttp/guzzle/src/Client.php

    r2836223 r2912552  
    444444        }
    445445
     446        if (isset($options['version'])) {
     447            $modify['version'] = $options['version'];
     448        }
     449
    446450        $request = Psr7\Utils::modifyRequest($request, $modify);
    447451        if ($request->getBody() instanceof Psr7\MultipartStream) {
  • fpay-gateway/trunk/vendor_fpay/guzzlehttp/guzzle/src/Cookie/SetCookie.php

    r2836223 r2912552  
    8181    public function __construct(array $data = [])
    8282    {
    83         /** @var array|null $replaced will be null in case of replace error */
    84         $replaced = \array_replace(self::$defaults, $data);
    85         if ($replaced === null) {
    86             throw new \InvalidArgumentException('Unable to replace the default values for the Cookie.');
    87         }
    88 
    89         $this->data = $replaced;
     83        $this->data = self::$defaults;
     84
     85        if (isset($data['Name'])) {
     86            $this->setName($data['Name']);
     87        }
     88
     89        if (isset($data['Value'])) {
     90            $this->setValue($data['Value']);
     91        }
     92
     93        if (isset($data['Domain'])) {
     94            $this->setDomain($data['Domain']);
     95        }
     96
     97        if (isset($data['Path'])) {
     98            $this->setPath($data['Path']);
     99        }
     100
     101        if (isset($data['Max-Age'])) {
     102            $this->setMaxAge($data['Max-Age']);
     103        }
     104
     105        if (isset($data['Expires'])) {
     106            $this->setExpires($data['Expires']);
     107        }
     108
     109        if (isset($data['Secure'])) {
     110            $this->setSecure($data['Secure']);
     111        }
     112
     113        if (isset($data['Discard'])) {
     114            $this->setDiscard($data['Discard']);
     115        }
     116
     117        if (isset($data['HttpOnly'])) {
     118            $this->setHttpOnly($data['HttpOnly']);
     119        }
     120
     121        // Set the remaining values that don't have extra validation logic
     122        foreach (array_diff(array_keys($data), array_keys(self::$defaults)) as $key) {
     123            $this->data[$key] = $data[$key];
     124        }
     125
    90126        // Extract the Expires value and turn it into a UNIX timestamp if needed
    91127        if (!$this->getExpires() && $this->getMaxAge()) {
  • fpay-gateway/trunk/vendor_fpay/guzzlehttp/guzzle/src/Handler/CurlFactory.php

    r2901917 r2912552  
    231231            \CURLOPT_RETURNTRANSFER => false,
    232232            \CURLOPT_HEADER         => false,
    233             \CURLOPT_CONNECTTIMEOUT => 150,
     233            \CURLOPT_CONNECTTIMEOUT => 300,
    234234        ];
    235235
     
    459459        }
    460460
     461        if (isset($options['crypto_method'])) {
     462            if (\STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT === $options['crypto_method']) {
     463                if (!defined('CURL_SSLVERSION_TLSv1_0')) {
     464                    throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.0 not supported by your version of cURL');
     465                }
     466                $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_0;
     467            } elseif (\STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT === $options['crypto_method']) {
     468                if (!defined('CURL_SSLVERSION_TLSv1_1')) {
     469                    throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.1 not supported by your version of cURL');
     470                }
     471                $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_1;
     472            } elseif (\STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT === $options['crypto_method']) {
     473                if (!defined('CURL_SSLVERSION_TLSv1_2')) {
     474                    throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.2 not supported by your version of cURL');
     475                }
     476                $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_2;
     477            } elseif (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT === $options['crypto_method']) {
     478                if (!defined('CURL_SSLVERSION_TLSv1_3')) {
     479                    throw new \InvalidArgumentException('Invalid crypto_method request option: TLS 1.3 not supported by your version of cURL');
     480                }
     481                $conf[\CURLOPT_SSLVERSION] = \CURL_SSLVERSION_TLSv1_3;
     482            } else {
     483                throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
     484            }
     485        }
     486
    461487        if (isset($options['cert'])) {
    462488            $cert = $options['cert'];
  • fpay-gateway/trunk/vendor_fpay/guzzlehttp/guzzle/src/Handler/StreamHandler.php

    r2836223 r2912552  
    395395        $body = (string) $request->getBody();
    396396
    397         if (!empty($body)) {
     397        if ('' !== $body) {
    398398            $context['http']['content'] = $body;
    399399            // Prevent the HTTP handler from adding a Content-Type header.
     
    477477            $options['http']['timeout'] = $value;
    478478        }
     479    }
     480
     481    /**
     482     * @param mixed $value as passed via Request transfer options.
     483     */
     484    private function add_crypto_method(RequestInterface $request, array &$options, $value, array &$params): void
     485    {
     486        if (
     487            $value === \STREAM_CRYPTO_METHOD_TLSv1_0_CLIENT
     488            || $value === \STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
     489            || $value === \STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT
     490            || (defined('STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT') && $value === \STREAM_CRYPTO_METHOD_TLSv1_3_CLIENT)
     491        ) {
     492            $options['http']['crypto_method'] = $value;
     493
     494            return;
     495        }
     496
     497        throw new \InvalidArgumentException('Invalid crypto_method request option: unknown version provided');
    479498    }
    480499
  • fpay-gateway/trunk/vendor_fpay/guzzlehttp/guzzle/src/RequestOptions.php

    r2836223 r2912552  
    7777     * connect_timeout: (float, default=0) Float describing the number of
    7878     * seconds to wait while trying to connect to a server. Use 0 to wait
    79      * indefinitely (the default behavior).
     79     * 300 seconds (the default behavior).
    8080     */
    8181    public const CONNECT_TIMEOUT = 'connect_timeout';
     82
     83    /**
     84     * crypto_method: (int) A value describing the minimum TLS protocol
     85     * version to use.
     86     *
     87     * This setting must be set to one of the
     88     * ``STREAM_CRYPTO_METHOD_TLS*_CLIENT`` constants. PHP 7.4 or higher is
     89     * required in order to use TLS 1.3, and cURL 7.34.0 or higher is required
     90     * in order to specify a crypto method, with cURL 7.52.0 or higher being
     91     * required to use TLS 1.3.
     92     */
     93    public const CRYPTO_METHOD = 'crypto_method';
    8294
    8395    /**
  • fpay-gateway/trunk/version.txt

    r2904111 r2912552  
    1 2.5.6
     12.5.7
Note: See TracChangeset for help on using the changeset viewer.