frappe / erpnext

Free and Open Source Enterprise Resource Planning (ERP)
https://erpnext.com
GNU General Public License v3.0
21.17k stars 7.24k forks source link

Add stripe payment service as a 'Pay Now' option on Sales Invoices #2090

Closed jevonearth closed 7 years ago

jevonearth commented 10 years ago

Feature request in User Story:

As a customer of a company that uses ERPNext, I want to receive invoices via email, and click a 'Pay Now' link on the invoice, that opens a webpage (https://erpnext.example.net/invoice/036zfd34-c3cd-4dce-a808-32xefaa1302b) so that I can pay the invoice by credit-card quickly and easily.

As a billing user of ERPNext, I want to send my customers invoices that have a 'Pay Now' link on the invoice PDF that, when clicked, the customer is taken to a on-line payment screen where the payment is processed via stripe, so that erpnext automatically updates the Sales Invocies as paid.

Examples of how a similar feature is implemented in the Xero accounting product;

Image showing payment link on a Invoice PDF Image showing payment link on a Invoice PDF

Image showing invoice on-line and prompting user for payment details. Image showing invoice on-line and prompting user for payment details.

The Pay Now link on the Payment Invoice has a hashed URL, which makes it a 'private link'. When the customer opens the link, they see their invoice, and the option to pay that invoice via credit-card (in this case stripe).

This feature request is related to #2088

anandpdoshi commented 10 years ago

+1

On Wednesday, August 20, 2014, Jev Björsell notifications@github.com wrote:

Feature request in User Story:

As a customer of a company that uses ERPNext, I want to receive invoices via email, and click a 'Pay Now' link on the invoice, that opens a webpage ( https://erpnext.example.net/invoice/036zfd34-c3cd-4dce-a808-32xefaa1302b) so that I can pay the invoice by credit-card quickly and easily.

As a billing user of ERPNext, I want to send my customers invoices that have a 'Pay Now' link on the invoice PDF that, when clicked, the customer is taken to a on-line payment screen where the payment is processed via stripe, so that erpnext automatically updates the Sales Invocies as paid.

Examples of how a similar feature is implemented in the Xero accounting product;

[image: Image showing payment link on a Invoice PDF] https://cloud.githubusercontent.com/assets/1114943/3980401/b21795fe-2861-11e4-9136-99825ee6166a.png

[image: Image showing invoice on-line and prompting user for payment details.] https://cloud.githubusercontent.com/assets/1114943/3980411/db56ecb2-2861-11e4-9e1a-54a7527919e7.png

The Pay Now link on the Payment Invoice has a hashed URL, which makes it a 'private link'. When the customer opens the link, they see their invoice, and the option to pay that invoice via credit-card (in this case stripe).

This feature request is related to #2088 https://github.com/frappe/erpnext/issues/2088

— Reply to this email directly or view it on GitHub https://github.com/frappe/erpnext/issues/2090.

rmehta commented 10 years ago

Payment gateway frappe app:

viktor-zhuromskyy commented 10 years ago

+1

amruthp commented 10 years ago

+1

yashodhank commented 9 years ago

:+1:

betabank commented 9 years ago

It is possible to add also the "Pay now" div in the shopping cart?

system19 commented 9 years ago

+1

pifiu commented 9 years ago

+1 you could also add braintree or some other gateways. If you implement stripe, it would not be much more work to do any others.

yashodhank commented 9 years ago

:+1:

Option to Automate Recurring Payments.

To handle Payment Subscriptions will be very useful addition if not implemented yet.

rmehta commented 9 years ago

sorry moving this to 5.1 - we need to close new development in 5.0

abhijeetramgir commented 9 years ago

How do we do this?

abhijeetramgir commented 9 years ago

how do we do this?

marri2k commented 9 years ago

Still waiting for this !!!!

hubdotcom commented 9 years ago

Could this been done using current actions / filters without modifying core code?

rmehta commented 9 years ago

Not out of the box (yet)

hubdotcom commented 9 years ago

Soon :)

How would we go about adding this? Would it have to be core code modification?

rmehta commented 9 years ago

@saurabh6790 will start working on this. We need to create a new document type called Payment Request that will trigger the re-direct to the payment gateway and keep track of callbacks (for each type of gateway)

We can then call payment request from an Invoice or Shopping Cart.

tkhamdan commented 8 years ago

Any updates here? On the roadmap for v7?

mach-kernel commented 8 years ago

Hi,

I have a requirement for this for one of my clients and wish to pick up integrating this. My only barrier is that I cannot find a consistent way to run this locally, because every update to master breaks some miscellaneous CLI tool out of the 999 required to deploy erpnext and I can't make any progress.

Is there any stable snapshot branch?

yashodhank commented 8 years ago

@mach-kernel open new topic for your issues at https://discuss.erpnext.com

mach-kernel commented 8 years ago

@yashodhank I managed to get it running. I'm implementing this in the POS app first so that cards can be used on the spot with ERPNext, but this feature will be something that can follow.

pifiu commented 8 years ago

bumping this to see if there is a way to finally get this into the core update? Even if its just Stripe, although adding other processors is not much more difficult (example: braintree)

mach-kernel commented 8 years ago

I have a working Stripe POS integration here, but I need to clean a few things up. It was not that hard to do.

Quick edit: The extra field in the payment dialog is no longer necessary. Ignore that. Was trying a few things out and it's late.

More updates in the next few days, in the form of a pull request. I accept coffee as thanks!

pifiu commented 8 years ago

@rmehta If @mach-kernel or another developer has this setup, can we push this on the next update?

rmehta commented 8 years ago

I think @mach-kernel still needs to connect web-hooks to update the payment status in the invoice and create a payment entry.

Also it would be cleaner if the integration is done in a separate app (which in not so easy in the current POS design).

Maybe time to completely redesign the POS, add offline capability etc.

mach-kernel commented 8 years ago

Hi all,

I've submitted a pull request. I'll need to develop some other nice supporting features, but if you need basic CC checkout via Stripe, this can do it.

yashodhank commented 8 years ago

@mach-kernel simply awesome! really appreciate it..

pifiu commented 8 years ago

@mach-kernel thanks for this contribution! What other supporting features do you suggest? How about recurring payment/subscriptions?

mach-kernel commented 8 years ago

@pifiu,

I think that the next thing that should be done is reconciliation confirmation via webhooks, but that's going to be a bit difficult due to having to actually build a webhook listener for erpnext which I think is a greater architectural consideration. I'd actually want to loop in some of the main architects of the project before tackling something like that.

At any rate: Once that is all decided the work to do something like this is actually rather easy to do. I don't actually know who does what here so if you can get the attention of the right people then this would move right along.

Best,

David

pifiu commented 8 years ago

@mach-kernel you can contact @rmehta and also @MaxMorais

MaxMorais commented 8 years ago

Hey! Nice to see my name here!

@mach-kernel,

Build a webhook listener to ERPNext is not hard to get! Do you can build it simply using whitelisted methods!

If do you need samples, or if you have doubts, ping me on gitter! I'll love answer any doubt!

TIP: I'm hosted on Brazil, my time zone, is GTM-3, usually, I'm online until 02 am, returning on noon!

mach-kernel commented 8 years ago

@MaxMorais if you can show me an example of what a whitelisted method is and where I'd plug it in I can go and wire up the rest. I really like Frappe but one thing this project needs is a really good API reference because I've been reading the "build a project from scratch" guide but I don't really want all that info when I want to see how something works -- I'm sure others would agree :)

At any rate, thanks for checking in!

MaxMorais commented 8 years ago

@mach-kernel, frappe.whitelist is a decorator, that you can use to enable a external call over the function. It's like a the flask.route with a small difference, do you dont pass the URL, the argument will be ever the path of the function, compatible with python module sintax, eg: myapp.mymodule.doctype.my_doctype.my_doctype_module.my_function, and the arguments of the function are passed as a dict, named args, so, you lose the positional arguments, but works fine, with named arguments.

frappe, have 2 apis, by default the global REST handler, that is not whitelisted, because it works like a view https://github.com/frappe/frappe/blob/develop/frappe/api.py

and the client https://github.com/frappe/frappe/blob/develop/frappe/client.py, that is based in the first concept of the whitelisted method.

Some integrations, will require modifications in the format of the response, here https://github.com/frappe/frappe/blob/d8f24822a978f4bf9c05ca6b23cbf29357924f86/frappe/utils/response.py do you can see, advanced modifications in the response, to get it compatible with the frappe formats!

I believe that these examples, are everything that do you need to get started with API's, and whitelisted methods management in frappe.

qrevel commented 7 years ago

Still not available on v7. It would be a really useful feature. When do you plan to release it ?

mach-kernel commented 7 years ago

@qrevel et al, I totally forgot about this. I have some old code from a while ago but the PR was declined because it was quite hackish and not built according to erpnext's idioms. I can try to dig up my changes and will write back if I can find anything useful. Do ping me here if you do not hear from me within a week as I am unfortunately quite forgetful 😢

pifiu commented 7 years ago

@mach-kernel I am reminding you since its been a week!

mach-kernel commented 7 years ago

@pifiu After looking it over it seems that I would have to start writing it from scratch. That being said, it doesn't seem to be too difficult. I can't promise it'll happen super fast but I've put it on a list of things to do and when I catch some free time I may pick it off. Sorry for the less than stellar news -- just got a lot on my plate at the moment.

rmehta commented 7 years ago

Stripe Payments are now merged!