Page 1 of 1

Custom Payment Provider

Posted: 22 Mar 2021, 17:26
by createanet
Hello there,

We wish to extend an omnipay package. We've followed the instructions outlined below

https://aimeos.org/docs/2020.x/providers/service/

...and extending the OmniPay class.

We continue to get the following error message.

Code: Select all

Argument 1 passed to Aimeos\MShop\Service\Provider\Base::__construct() must implement interface Aimeos\MShop\Context\Item\Iface, null given, called in /Users/XXXX/Sites/aimeos/vendor/omnipay/common/src/Common/GatewayFactory.php on line 88
We're using the omnipay/braintree package and need to generate a nonce token, we figured we could manage this by extending the class data?

Is it immediately obvious what we might be doing wrong?

Thanks

Re: Custom Payment Provider

Posted: 23 Mar 2021, 07:36
by aimeos
Seems like you've mixed Aimeos and Omnipay classes. If you post your code, it might be obvious.

Re: Custom Payment Provider

Posted: 31 Mar 2021, 17:25
by createanet
This is exactly what I did, thank you.

I should have selected the new provider which was extending the omnipay provider.

The mistake I was making was assigning it as a type for the existing omnipay provider.

Re: Custom Payment Provider

Posted: 18 Jan 2023, 15:18
by TGergo
I have a custom payment provider.
In function process() i can send data to payment gateway by cURL communication
and receive an URL, I redirect user to url.
She/He can make the payment.

If I understand correctly, I need a webroute, a controller which receive payment status.
And I need to change the payment status there.

Re: Custom Payment Provider

Posted: 19 Jan 2023, 16:43
by aimeos
TGergo wrote: 18 Jan 2023, 15:18 If I understand correctly, I need a webroute, a controller which receive payment status.
And I need to change the payment status there.
This is already available and you only need to implement the updateSync() and/or updatePush() method:

- updateSync() is called if the payment status can be determined when the customer is redirected to the checkout/confirm URL.

- updatePush() receives the data sent by the payment gateway using machine to machine communication (no user involved) and the payment gateway needs the URL for the checkout/update endpoint (either by sending it along with the request or by configuration in the backend of the payment gateway).

Re: Custom Payment Provider

Posted: 24 Jan 2023, 09:39
by TGergo
OK, Thank You!

My redirect URL from the Payment gateway is: https://www.mywebsite.com/shop/confirm/ ... t_provider

And it will enter to public function updateSync.