Subscription > payment provider
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Subscription > payment provider
Hello,
I currently plan to add a new service provider to handle subscription. Therefor i initially thought to "copy" the mollie omnipay gateway and adapt as needed, though, it may be easier to create a new payment provider from scratch that uses already v2 of the api, instead of dissecting the omnipay one.
Is there a suggestion on your end?
EDIT: While digging into it, I just noticed that the default OminPay Payment Provider does not create a customer id / reference, so I would need to make my own anyway, or am I wrong on that part?
I currently plan to add a new service provider to handle subscription. Therefor i initially thought to "copy" the mollie omnipay gateway and adapt as needed, though, it may be easier to create a new payment provider from scratch that uses already v2 of the api, instead of dissecting the omnipay one.
Is there a suggestion on your end?
EDIT: While digging into it, I just noticed that the default OminPay Payment Provider does not create a customer id / reference, so I would need to make my own anyway, or am I wrong on that part?
Re: Subscription > payment provider
If there's a Mollie v2 API that is incompatible with v1 API then yes, it's better to create a new Omnipay driver.
Aimeos uses a not yet standardized way in Omnipay to get the required token for subscription payments:
- Create token: https://github.com/aimeoscom/ai-payment ... y.php#L694
- Get token: https://github.com/aimeoscom/ai-payment ... y.php#L928
- Use token: https://github.com/aimeoscom/ai-payment ... y.php#L445
Aimeos uses a not yet standardized way in Omnipay to get the required token for subscription payments:
- Create token: https://github.com/aimeoscom/ai-payment ... y.php#L694
- Get token: https://github.com/aimeoscom/ai-payment ... y.php#L928
- Use token: https://github.com/aimeoscom/ai-payment ... y.php#L445
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: Subscription > payment provider
Thanks, I already started to build my own payment driver. That seems to be the cleanest solution, as it'll just be used for subscriptions.
However, can you please tell me the difference between updatePush and updateSync?
The webhook URL calls update?action=update. Which one of it is it?
EDIT:
Alright, nevermind. Solved that one now. Though, I added my own processor for the subscription, but the class cant be found.
I edited the /config/controller.php and added my processor.
The Standard.php file is located in myExtensionName/controller/common/src/Controller/Common/Subscription/Process/Processor/MollieSubscription but i get the error Class "\Aimeos\Controller\Common\Subscription\Process\Processor\MollieSubscription\Standard" not found
Here is the first bits of my Class:
However, can you please tell me the difference between updatePush and updateSync?
The webhook URL calls update?action=update. Which one of it is it?
EDIT:
Alright, nevermind. Solved that one now. Though, I added my own processor for the subscription, but the class cant be found.
I edited the /config/controller.php and added my processor.
Code: Select all
return [
'common' => [
'subscription' => [
'process' => [
'processors' => ['MollieSubscription']
]
]
],
'frontend' => [
],
'jobs' => [
],
];
Here is the first bits of my Class:
Code: Select all
namespace Aimeos\Controller\Common\Subscription\Process\Processor\MollieSubscription;
class MollieSubscription
extends \Aimeos\Controller\Common\Subscription\Process\Processor\Base
implements \Aimeos\Controller\Common\Subscription\Process\Processor\Iface
{
Re: Subscription > payment provider
Alright, it seems the manual at https://aimeos.org/docs/Developers/Cont ... processors is outdated. Once i changed the class name to Standard and adapted \Aimeos\MShop\Factory::createManager to \Aimeos\MShop::createManager it works.
I need to access the payment config, to be precise the apiKey I put there. How do I get it?
I need to access the payment config, to be precise the apiKey I put there. How do I get it?
Re: Subscription > payment provider
Thanks for the hint, documentation is updated now. Also, it must be:
The update methods will be called at different occurences:
- updateSync: The customer hits the checkout confirm (thank you) page
- updatePush: The payment gateway notifies the shop via the checkout update page
You can get the configuration of the payment provider with:
See also: https://aimeos.org/docs/Developers/Libr ... ng_methods
Code: Select all
\Aimeos\MShop::create()
- updateSync: The customer hits the checkout confirm (thank you) page
- updatePush: The payment gateway notifies the shop via the checkout update page
You can get the configuration of the payment provider with:
Code: Select all
$this->getConfigValue( 'key' )
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: Subscription > payment provider
$this->getConfigValue() was the first thing I tried but didn’t work. Call to undefined function.
Maybe I need to load the service properly before as I’m in the subscription processor?
Maybe I need to load the service properly before as I’m in the subscription processor?
Re: Subscription > payment provider
That method isn't available in the subscription processor and I doubt you need one if you implement repay() in your payment service provider.
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: Subscription > payment provider
Okay, maybe I have the wrong approach.
I am not using tokens, Mollie handles that completly. I make the first payment in the checkout and thought to use the subscription processor to start, stop and re-enable the subscription / recurring payment on mollie.
What would be your suggested approach? Also how to use repay() in the subscription processor?
I am not using tokens, Mollie handles that completly. I make the first payment in the checkout and thought to use the subscription processor to start, stop and re-enable the subscription / recurring payment on mollie.
What would be your suggested approach? Also how to use repay() in the subscription processor?
Re: Subscription > payment provider
Payment of subscriptions is completely handled by the subscription job, you don't have to care about that:
https://github.com/aimeos/ai-controller ... rd.php#L96
Your Omnipay driver only needs to take care of the code lines pointed to first so you may not even implement an Aimeos payment service provider. Only if the Mollie way of handling (recurring) payments doesn't fit into the Omnipay way, you have to implement that special case code in the repay() method of the Aimeos payment service provider for you Mollie implementation.
https://github.com/aimeos/ai-controller ... rd.php#L96
Your Omnipay driver only needs to take care of the code lines pointed to first so you may not even implement an Aimeos payment service provider. Only if the Mollie way of handling (recurring) payments doesn't fit into the Omnipay way, you have to implement that special case code in the repay() method of the Aimeos payment service provider for you Mollie implementation.
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: Subscription > payment provider
Ah, Okay. So the Subscription Processor fires repay along the way.
Will the new "invoice" be send per mail or just process the payment in the background?
Will the new "invoice" be send per mail or just process the payment in the background?