As I announced, I’m going to integrate the Taler payment system into Tryton. Taler will only be used of receiving customer payments and for refunding –at least for now. While technically this is not much of an issue, I discovered that I did not understand the sale, invoice and payment process well enough yet.
For the customer to be able to pay, Tryton needs to create an “Order” in Taler and then pass back an URL containing the “Order-ID” to the customer, e.g. by printing a QR-code on the invoice. For Tryton to get noticed about the payment, there are several methods: For offline payment (classic invoicing), Tryton would just poll Taler. For online payment (like a web-shop) the customer would be redirected to a URL, which is a Tryton route.
What I don’t get yet is: Where within the sale–invoice–payment process do I hook in creating the order, how do I hook in and how do I connect the payment with the sale/invoice.
-
For a web-shop, I assume creating a route like account_payment_braintree.route.checkout() solves creating the Taler “Order”. as well as a Tryton “Receiving Payment”. After payment, another route can connect the Receiving Payment with the sale/cart and the invoice. I “just” need to store the Taler Order-ID with the sale/cart. Correct? Is there some example for this?
-
For offline. payment, one creates a sale (optional) and an invoice. When the invoice is posted, a “Line to Pay” is created. anyhow. How to also create the Tryton “Receiving Payment” and the Taler “Order” here – which I need for printing the QR-code.
Thanks for any input in advance