- 
                Notifications
    You must be signed in to change notification settings 
- Fork 130
Fix PHP 8.2 and Other Related Issues #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 11 commits
76dc113
              591629c
              b81fb0b
              fad9d56
              f4e69f4
              c6138da
              d580082
              959b1a7
              475e87f
              dd38b0f
              6da6e4f
              6c17547
              a096ea6
              ba9a468
              96d67ae
              c1f8164
              ce7d988
              87bfb35
              c31570d
              a12582a
              aa87640
              156a26d
              089bff7
              964ee7e
              596cca5
              cfe79c5
              d77e72b
              85d3080
              27520ac
              d3f2448
              6dc14ea
              0149fb7
              f205667
              275dfda
              87f0929
              ed80f9f
              6b9f10f
              f5303e0
              3f3e135
              91ca58a
              586b770
              0268830
              beac573
              File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -11,6 +11,6 @@ composer.lock | |
|  | ||
| .* | ||
| !.github | ||
| !.php_cs | ||
| !.php-cs-fixer.* | ||
| !.gitignore | ||
| !.gitattributes | ||
|         
                  mralaminahamed marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | 
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
|  | ||
| $finder = (new PhpCsFixer\Finder()) | ||
| ->in(__DIR__.'/MangoPay') | ||
| ->in(__DIR__.'/tests') | ||
| ; | ||
|  | ||
| return (new PhpCsFixer\Config()) | ||
| ->setRules([ | ||
| '@PSR12' => true, | ||
| 'fully_qualified_strict_types' => true, | ||
| 'array_syntax' => ['syntax' => 'short'], | ||
| 'visibility_required' => [ | ||
| 'elements' => ['property', 'method'], // 'const' is removed for old PHP compat | ||
| ], | ||
| ]) | ||
| ->setFinder($finder) | ||
| ; | 
This file was deleted.
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -13,6 +13,23 @@ class PayIn extends Transaction | |
| */ | ||
| public $CreditedWalletId; | ||
|  | ||
| /** | ||
| * The mode applied for the 3DS protocol for CB, Visa, and Mastercard. | ||
| * Default values: DEFAULT. Allowed values: DEFAULT, FORCE, NO_CHOICE | ||
| * | ||
| * @var string | ||
| */ | ||
| public $SecureMode; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for adding this to the PayIn class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * The 3DS protocol version to be applied to the transaction. Allowing values: V1, V2_1 | ||
| * | ||
| * @see https://mangopay.com/docs/concepts/payments/payment-methods/card/3ds | ||
| * @see https://mangopay.com/docs/endpoints/direct-card-payins#direct-card-payin-object | ||
| * @var string | ||
| */ | ||
| public $Requested3DSVersion; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for adding this to the PayIn class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * PaymentType {CARD, BANK_WIRE, DIRECT_DEBIT, PAYPAL, PAYCONIQ } | ||
| * @var string | ||
|  | @@ -43,6 +60,32 @@ class PayIn extends Transaction | |
| */ | ||
| public $RecurringPayinRegistrationId; | ||
|  | ||
| /** | ||
| * The IP address of the end user initiating the transaction, in IPV4 or IPV6 format. | ||
| * @var string | ||
| */ | ||
| public $IpAddress; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for adding this to the PayIn class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * Information about the browser used by the end user (author) to perform the payment. | ||
| * @var BrowserInfo | ||
| */ | ||
| public $BrowserInfo; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for adding this to the PayIn class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * Information about the end user billing address. If left empty, the default values will be automatically taken into account. | ||
| * Default values: FirstName, LastName, and Address information of the Shipping object if any, otherwise the user (author). | ||
| * @var Billing | ||
| */ | ||
| public $Billing; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for adding this to the PayIn class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * Information about the end user’s shipping address. If left empty, the default values will be automatically taken into account. | ||
| * Default values: FirstName, LastName, and Address information of the Billing object, if supplied, otherwise of the user (author). | ||
| * @var Shipping | ||
| */ | ||
| public $Shipping; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What is the reason for adding this to the PayIn class? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * Get array with mapping which property depends on other property | ||
| * @return array | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
|  | @@ -37,6 +37,12 @@ class Refund extends Transaction | |
| */ | ||
| public $RefundReason; | ||
|  | ||
| /** | ||
| * Message related to the refund | ||
| * @var string | ||
| */ | ||
| public $RefundReasonMessage; | ||
| There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you add this param? I don't see it in the docs (correct me if I'm wrong) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This property was identified in both the documentation and PHP SDK. I verified its existence through debug logs and implemented it accordingly. | ||
|  | ||
| /** | ||
| * @var string | ||
| */ | ||
|  | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| FROM php:8.1-cli | ||
|  | ||
| # Update and import specific required librairies | ||
|  | ||
| RUN apt-get update && apt-get install -y apt-utils | ||
| RUN apt-get install -y \ | ||
| unzip \ | ||
| libicu-dev \ | ||
| libonig-dev \ | ||
| gcc \ | ||
| wget \ | ||
| zlib1g-dev \ | ||
| libzip-dev | ||
|  | ||
| # Parametrize PHP | ||
|  | ||
| RUN docker-php-ext-install mbstring | ||
| RUN docker-php-ext-install intl | ||
| RUN docker-php-ext-install zip | ||
| RUN docker-php-ext-install pcntl | ||
| RUN docker-php-source delete | ||
|  | ||
| # Install composer | ||
| COPY composer.sh / | ||
| RUN chmod +x composer.sh | ||
| RUN /composer.sh | ||
| RUN mv composer.phar /usr/local/bin/composer | ||
| RUN mkdir /.composer && chmod o+rwx /.composer | ||
|         
                  mralaminahamed marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/sh | ||
|         
                  mralaminahamed marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
|  | ||
| EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" | ||
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
| ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | ||
|  | ||
| if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] | ||
| then | ||
| >&2 echo 'ERROR: Invalid installer checksum' | ||
| rm composer-setup.php | ||
| exit 1 | ||
| fi | ||
|  | ||
| php composer-setup.php --quiet | ||
| RESULT=$? | ||
| rm composer-setup.php | ||
| exit $RESULT | ||
|         
                  mralaminahamed marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| FROM php:8.2-cli | ||
|  | ||
| # Update and import specific required librairies | ||
|  | ||
| RUN apt-get update && apt-get install -y apt-utils | ||
| RUN apt-get install -y \ | ||
| unzip \ | ||
| libicu-dev \ | ||
| libonig-dev \ | ||
| gcc \ | ||
| wget \ | ||
| zlib1g-dev \ | ||
| libzip-dev | ||
|  | ||
| # Parametrize PHP | ||
|  | ||
| RUN docker-php-ext-install mbstring | ||
| RUN docker-php-ext-install intl | ||
| RUN docker-php-ext-install zip | ||
| RUN docker-php-ext-install pcntl | ||
| RUN docker-php-source delete | ||
|  | ||
| # Install composer | ||
| COPY composer.sh / | ||
| RUN chmod +x composer.sh | ||
| RUN /composer.sh | ||
| RUN mv composer.phar /usr/local/bin/composer | ||
| RUN mkdir /.composer && chmod o+rwx /.composer | 
| Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #!/bin/sh | ||
|         
                  mralaminahamed marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
|  | ||
| EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" | ||
| php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
| ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | ||
|  | ||
| if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] | ||
| then | ||
| >&2 echo 'ERROR: Invalid installer checksum' | ||
| rm composer-setup.php | ||
| exit 1 | ||
| fi | ||
|  | ||
| php composer-setup.php --quiet | ||
| RESULT=$? | ||
| rm composer-setup.php | ||
| exit $RESULT | ||
|         
                  mralaminahamed marked this conversation as resolved.
              Outdated
          
            Show resolved
            Hide resolved | ||
Uh oh!
There was an error while loading. Please reload this page.