You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fatal error: Uncaught TypeError: Return value of Application\Libraries\PaymentWeb::getInstallments() must be an instance of ArrayObject, instance of stdClass returned in C:\xampp74\htdocs\corecms\application\Libraries\PaymentWeb.php on line 100
In the PHP DOC of this method, show a ArrayObject in return, so i use ArrayObject in return, but the real return is object (stdClass).
I change the return to stdClass and it works correctly, then i create this issue.
pagarme-php/src/Endpoints/Transactions.php
Line 171 in a70d329
I start a new implementation of this lib, using PHP 7.4.
in my implementation, i've created a abtraction of the method transactions()->calculateInstallments([]);
public function getInstallments(int $amount, string $freeInstallments = CONF_PAGARME_CREDIT_CARD_MAX_FREE_INSTALLMENTS, string $maxInstallments = CONF_PAGARME_CREDIT_CARD_MAX_INSTALLMENTS, float $interestRate = CONF_PAGARME_CREDIT_CARD_PENALTY): ArrayObject { return $this->pagarme->transactions()->calculateInstallments([ 'amount' => $amount, 'free_installments' => $freeInstallments, 'max_installments' => $maxInstallments, 'interest_rate' => $interestRate ]); }
But when i try to use, i receive a error message:
Fatal error: Uncaught TypeError: Return value of Application\Libraries\PaymentWeb::getInstallments() must be an instance of ArrayObject, instance of stdClass returned in C:\xampp74\htdocs\corecms\application\Libraries\PaymentWeb.php on line 100
In the PHP DOC of this method, show a ArrayObject in return, so i use ArrayObject in return, but the real return is object (stdClass).
I change the return to stdClass and it works correctly, then i create this issue.
public function getInstallments(int $amount, string $freeInstallments = CONF_PAGARME_CREDIT_CARD_MAX_FREE_INSTALLMENTS, string $maxInstallments = CONF_PAGARME_CREDIT_CARD_MAX_INSTALLMENTS, float $interestRate = CONF_PAGARME_CREDIT_CARD_PENALTY): object { return $this->pagarme->transactions()->calculateInstallments([ 'amount' => $amount, 'free_installments' => $freeInstallments, 'max_installments' => $maxInstallments, 'interest_rate' => $interestRate ]); }
The text was updated successfully, but these errors were encountered: