I’d appreciate some help for implementing the Tryon Taler integration. I tried to learn from account_payment_braintree and …_strip, with limit success.
For the Taler Merchant Backend integration I need to map the payment states from those in Taler and those in Tryton. In addition Taler support refunding partially and several refunds (up to the total payment, of course). Also the payment system can charge fees from the merchant, reducing the amount transferred to the bank account.
Taler works a bit different than credit card payments or direct debit: With Taler, for paying the customer transfers “coins” to the merchant backend. The payment has status “paid” then. Refunds can be granted until the “refund deadline”. After the “refund deadline” (and some other delay), the coins are transferred (“wired”) to the bank account.
(You can learn more about this in the Taler Merchant API docuentation.)
Due to this complex scheme (and some other technical reasons), a payment in Taler has several states:
paid
refunded
wired
Now I wonder:
In Tryton, shall the payment “succeed” if the it is “paid” in Taler? Or only after it ha been “wired”?
How are refunds handled in regard to the payment status?
Anythng to keep in mind in regard to multiple refunds on the same payment?
Does the account_payment_taler module need to take care about financial accounting for refunds? Or is this done by some other part if Tryton?
Does account_payment_taler need to take care about financial accounting for fees?
PS: Taler also provides an API to track wire transfers and match these to payments and fees. Currently there are no plans to implement this.
What you descrive is not as much different as Stripe or other payment methods. For example using Stripe workflow it will work as following:
A payment of 100€ is processed by Strip.
When the payment is succeed it is marked as succed. So 100€ are added to your Stripe account balance. At this point, you can use the account_payment_clearing module to create an accounting move and map the Stripe balance with the balance of one account in tryton.
Stripe issues and invoices with the fees of the payments. You will never pay this invoice as they substract it directly from your account balance.
After some days a wire transfer is issued, so the stripe balance is moved to your bank account.
In order to process point 4, you should use account_statment module where you paid the invoice and subsctract the balance from the clearing account balance.
If you do not want to use the account_payment_clearing when receiving the funds you need to relate the wire transfers with all the linked payments, so the related invoices are marked as paid.
For me, the payment must succed once its paid on taller. Latter you can faild or update the state if needed before the money is wired.
I don’t think so. Normally the fees are subsctracted when the money is wired. So you just book the expense (or pay the invoice) when the money is transfered.