-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
[10.0] [ADD] contract_auto: Automatic Payment For Contracts #67
Conversation
4a10a9c
to
8806c31
Compare
ab5741c
to
c893f0e
Compare
Thank you @lasley. Yesterday I had some problems during installation (XML issues) but now I could install it fine. I just created a contract and I will have to wait to see if everything goes fine. I wonder a couple of things: What if the customer decides to switch to another payment method which involves switching to another payment-gateway? (this scenario is related to my first question). I would like to test the module using stripe, which implements s2s methods, however I don't understand how a specific person will be charged for a contract. Do you know how to debug this to try to understand better the process? What first comes to my mind is to save the customer on the stripe backend and link a credit card number as primary so it can be automatically retrieved during the payment, but I will have to test that. |
The payment token represents the credit card, which is linked to a partner and acquirer. Changing either is as easy as changing the payment token. The catch here is that the credit card already has to be saved to the partner's account as a payment token. This happens during the website_sale checkout process if the customer checks the option to remember their card. You can also create a token at your acquirer manually and add into Odoo for use. |
Hi @lasley , Please could you add a usage section detailed in order to know what to test? After seeing this PR I have read again #55 and #45 (comment) but I have some doubts about how it works. You want that contract set invoices paid base on? I read "This module adds logic to automatically pay invoices that are created by a contract" but I don't understand why you want invoices paid without knowing if they are paid o not really with a transfer, bank card, paypal or similar. I'm interested. Thanks |
@rafaelbn - readme updated & instructions added to the main comment of this PR. Let me know if this doesn't clarify. |
e4a079e
to
466effc
Compare
@lasley, thank you very much for your guidance; It makes total sense now! Stripe is missing this important feature (saving the credit card). I am trying the module using authorize, however even though I check the "remember the CC details", it doesn't seem to be remembered at all. Truth to be told I am still struggling with authorize itself (the payment gets processed properly but the return URL doesn't seem to work, I need to further dig into this). I assume that the payment.token is created prior redirecting to authorize.net website and the failed return to the odoo website has nothing to do with it (not 100% sure though). I tried to create a payment token manually by going (with developer mode) to Accounting / Configuration / Payments / Saved Payment Data, however I am not sure how to fill the acquirer Ref. I guess it is the token which maps to the record with the payment-gateway website record (some sort of id). Unfortunately I am having some troubles to test this out, since as for today, the only two acquirers that I am aware that support remembering the payment details are authorize and ogone. Ogone is a nightmare to setup (I need more time) and authorize doesn't seem to remember anything. If I achieve something with authorize I will be more than happy to document it along with the readme (or in a separated folder) |
@vonpupp - the payment token memorization definitely works with a proper Authorize setup, so I would assume it's just something in the configuration. Make sure that you're using a sandbox account set to live mode in the Authorize console, and that you set the acquirer to sandbox mode in Odoo. Regarding Stripe, I see all of the server to server methods implemented in the v10 acquirer, such as the token creation |
Thank you very much @lasley. Yes indeed the problem is on my side. Apparently the payment information gets saved once it succeeds. Authorize.net does not seem to be documented. I have found this issue, which pretty much describes my problem. I have configured the URLs accordingly however the problem persists (Default Receipt URL is /shop/confirmation and Default Relay Response URL is /payment/authorize/return). I configured also the silent URL to be a request bin, to check out the POST parameters coming back from authorize.net so I try to replicate the request using curl. The sad part is that I always get a 404 on odoo when trying to access route Sorry that I haven't been helpful in testing your module. Hopefully I will manage to solve all this issues soon. Unfortunately Stripe do not allow to remember the payment details. |
It does though, I linked the token creation above. I definitely see it taking credit card numbers, then turning it into a payment token. Maybe try skipping the process entirely & just use |
2df9a86
to
e0d06b0
Compare
This is ready for review if a PSC would please mark as such. I just need to fix a few missing test holes, but no functional code |
f5c19be
to
c5d094c
Compare
Amazing, @lasley. Thank you very much! I created #70 for this purpose. Please feel free to give your impressions. Just to be clear, you provided the Currently I am working on the missing parts of the |
@rafaelbn - I agree with the rename. Looks like I forgot to add |
ca1eea9
to
aca8d78
Compare
Hi @lasley travis is red, could you take a look please? |
bcee98f
to
fe0cc9c
Compare
Alright we're 🍏 ! |
Any PSC have thoughts on this one? |
Hi @lasley I'm rebuilding for testing but it looks runbot is broken everywhere... 😞 |
@rafaelbn - I rebuilt and it looks good now. must have been the space issue from earlier |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested 👍
@lasley do you want to squash before merge?
894825c
to
9d1ae5c
Compare
Contract Auto (RFC #55)
This module allows for the configuration of automatic payments on invoices that are created by a contract.
Usage
Enable Automatic Payment
Auto Pay?
box to enable automatic paymentPayment Token
to the payment token that should be used for automatic paymentAutomatic Payment Settings
The following settings are available at both the contract and contract template level:
Payment Token
A valid payment token is required to use this module. These tokens are typically created during the
website_sale
checkout process, but they can also be created manually at the acquirer.A payment token can be defined in one of two areas: