checkout process with omnipay-pagseguro
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
checkout process with omnipay-pagseguro
My setup:
"aimeos/aimeos-laravel": "~2019.10",
"aimeos/ai-payments": "~2019.10",
"abdala/omnipay-pagseguro": "^1.3.0",
PHP 7.4.6 on linux
Hello,
I'm new to aimeos and love it. Thank's for the great work !
I'm having trouble implementing the PagSeguro gateway for Omnipay as I'm getting the following error during the checkout process:
Do you have any clue what is causing my problem here? Thank you for your help.
"aimeos/aimeos-laravel": "~2019.10",
"aimeos/ai-payments": "~2019.10",
"abdala/omnipay-pagseguro": "^1.3.0",
PHP 7.4.6 on linux
Hello,
I'm new to aimeos and love it. Thank's for the great work !
I'm having trouble implementing the PagSeguro gateway for Omnipay as I'm getting the following error during the checkout process:
Code: Select all
Symfony\Component\Debug\Exception\FatalThrowableError
Argument 1 passed to Aimeos\MShop\Service\Provider\Payment\OmniPay::getRedirectForm()
must be an instance of Omnipay\Common\Message\RedirectResponseInterface,
instance of Omnipay\PagSeguro\Message\PurchaseResponse given,
called in */ext/ai-payments/lib/custom/src/MShop/Service/Provider/Payment/OmniPay.php on line 894
Re: checkout process with omnipay-pagseguro
The response object you return when
is called must return a response object that implements
in case that
returns "true". Then,
can be used here:
https://github.com/aimeoscom/ai-payment ... #L816-L830
Code: Select all
$response = $provider->purchase( $data )->send();
Code: Select all
Omnipay\Common\Message\RedirectResponseInterface
Code: Select all
$response->isRedirect()
Code: Select all
$response->getRedirectData()
$response->getRedirectUrl()
$response->getRedirectMethod()
https://github.com/aimeoscom/ai-payment ... #L816-L830
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: checkout process with omnipay-pagseguro
Thank you for your explanation, I got it working by simply implementing
in Omnipay\PagSeguro\Message\PurchaseResponse. I hope that was the proper way to go about it.
However I have a subsequent problem : it seems that the PagSeguro API gives me a code 400 - Bad Request because it is expecting to receive the items' details (description, quantity, amount...) in the purchase request. How can I include those informations?
Code: Select all
Omnipay\Common\Message\RedirectResponseInterface
However I have a subsequent problem : it seems that the PagSeguro API gives me a code 400 - Bad Request because it is expecting to receive the items' details (description, quantity, amount...) in the purchase request. How can I include those informations?
Re: checkout process with omnipay-pagseguro
You have to extend the Omnipay.php class in the ai-payment package like done for other gateways because detailed order data is not passed to the payment gateway by default:
https://github.com/aimeoscom/ai-payment ... er/Payment
The getData() method is a good one for adding those data:
https://github.com/aimeoscom/ai-payment ... #L678-L706
https://github.com/aimeoscom/ai-payment ... er/Payment
The getData() method is a good one for adding those data:
https://github.com/aimeoscom/ai-payment ... #L678-L706
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star