-
Notifications
You must be signed in to change notification settings - Fork 129
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
Add new payment method #110
Comments
Hi, I'm happy that someone is going to implement a new Payment Method. First, forget about the Library/Paypal.php file, that's used in the legacy system and we didn't remove it yet because i may break things with the old admin. The key is to implement In the core code we have 3 payment implementations Cash, Paypal and Pool. There's a 4th implementation in the Goteo-Dev plugin that registers itself if you activate the plugin in its start.php file. if you study these cases you shouldn't have problems to implement a new Payment method. And I don't think you'll need to create any Check the documentation of Omnipay regarding Stripe. About the paypal fields: There are not related to the payment, all the payment info is in the Feel free to start coding and show me your progress, I'll give you my comments, but please use the latests versions of the Goteo source code. Good luck! |
Hi! Thanks! |
Hi @microstudi ,
At that point, I've needed to add a new step, that's to show a pop-up from Stripe site to ask customer credit card data to make the Stripe purchase() request.
Now, when I submit that form, it wil be catched on paymentFormAction() method from InvestController.php So, my question here is, is it possible to override an existing controller, in this case, InvestController.php, like we do with templates, only creating the same file name and paths into plugin folder, as it follows:
or it's better to add the specific Stripe response data treatment code on general InvestController?
And if it's possible to override a controller, does it is possible to override only one method? Or when overriding, we must copy-implement all original controller code ? I don't want to mess up all... Thanks in advance. |
I think you should go to a different approach. However creating a plugin and adding a line in composer.json is a little bit like mixing things (although it should work). IMO either we extend the source code or put everything in the plugin. Custom composer extension in the plugin can be done as is explained here, check the files composer.json and start.php of this demo plugin: https://github.com/microstudi/goteo-project-twitter-plugin That being said, I don't see any reference to the use of Omnipay in your comment, not using it? the point to use Ommnipay is to automate all the controller related petitions from goteo to the payment platform so there would be no need to change any view or controller code. However, you can make a custom plugin and override almost everything. In the case of controllers, you have to define a route (override an existing one) that points to your own controller. <?php
use Goteo\Application\App;
// Default routes
$routes = App::getRoutes();
// remove home route (for instance)
$routes->remove('home');
// Add a whole collection of routes:
$custom_routes = include (__DIR__ .'/src/routes.php');
// Add the official routes to our custom routes:
// we want custom routes before official routes
$custom_routes->addCollection($routes);
App::setRoutes($custom_routes); The in <?php
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
use Symfony\Component\HttpFoundation\RedirectResponse;
$custom_routes = new RouteCollection();
// Home replacement
$custom_routes->add('home', new Route(
'/',
array('_controller' => 'MyControllers\CustomIndexController::indexAction')
));
return $custom_routes; That being said, I think adding Stripe could be accomplish by only adding a new |
Thanks a lot @microstudi , I'll do a try as you said! |
Hi @ramoncodit You are already adding a new |
Any Updates for the Stripe payment gateway? |
Hi @ramoncodit I have created a new Payment/Method/StripePaymentMethod.php file to my local directory and in config/settings.yml, the following lines
What do I need to do to make Stripe show up as a payment mode ? I am happy to help with Stripe gateway - need some guidance Thanks |
Hi @microstudi Additional custom payment methods should be added herestripe: Thanks |
Hi @rajanbarara007 , I see you have added those lines in the payments settings. The way to have it shown is to add is as a payment inside the Config.php using the \Goteo\Payment\Payment:addMethod() method. In case you are building a plug-in you can do it in your start.php file. I think this is all you need to do. In any case, do you have a github repo where we can see your progress? Cheers, |
@davidbeig Thanks for your suggestion - I am able to see the Stripe payment icon . Now I would like to start working on integrating the new PaymentIntent interface from Stripe. Where should the integration be for adding the javascript plugin on client side ? I am getting an error "The paymentMethod parameter is required" on the payment page when I click on Contribute button. Attached is the StripePaymentMethod file. |
Hi @rajanbarara007, thanks a lot for supporting the integration of stripe payment. where can we see your progress? Best wishes |
Good evening,
I'm looking for to add a new Payment method.
As far as I could see, Goteo platform is using Omnipay lib, who allows to interact with a wide variety of payment platforms, with Paypal among that.
In config/settings.yml I can see payment gateway settings, by default paypal:
As it can be read, there's a comment line where appoints to add new payment form:
I have checked that Omnipay allows Stripe gateway and has its methods into vendor/omnipay folder.
So, I tried to add Stripe payment method. Here are my steps:
In order to continue, I realised that all payment steps are controlled into :
In other hand, I found a PayPal library file on:
And a "Payment lib" who works as a payment library methods, I suppose...
I suppose I must implement de Stripe library, something as create a file like follows:
to implement specific methods to interact with Stripe API.
And this other one too:
But what worries me is that I have seen that in project config, in step 6, appears a check to allow to pay it with paypal method. That option is saved into database table project_account, with specific fields: 'paypal' & 'paypal_owner', next to fields 'bank' & 'bank_owner'
So, my question is, to add Stripe payment method, it has to been added new fields like 'stripe' & 'stripe_owner' in that table ?
In that way, to add new payment method, means that are straight "hard-linked" to project definition ?
Or maybe I'm complicating the matter more than I should... ?
Thanks in advance for to have read till here.
Greetings
The text was updated successfully, but these errors were encountered: