Handling PayPal Payments in Tryton for Both Web Shop Orders and Manual Payment Links

Hi,

I have a Tryton setup integrated with a web shop where customers can place orders and pay directly via PayPal. Tryton receives order updates and processes payments when marked as succeeded by the shop. That all works. However, I also want to allow customers to pay directly using PayPal links that I generate for them (outside the web shop).

The challenge is ensuring consistency in Tryton for both types of payments since Shop-originated payments do not explicitly create PayPal transactions in Tryton. As I dont really know where to start and which modules could be used for this purpose I have a few questions:

  • The existing account_payment_* modules (e.g. stripe, braintree) all assume already existing payments and connect them with transactions. There is no gateway module that is able to fetch transactions without payments, is that right?
  • How can I standardize the payment handling in Tryton for both Shopify-originated and manually generated PayPal transactions?
  • What is the best way to automatically reconcile/assign the payments with their respective invoices/orders in Tryton?

Any insights or examples of similar scenarios are greatly appreciated! Thanks

I guess that by “Paypal” you mean “Braintree” (but Stripe supports also Paypal).

Anyway as long as you get the transaction id, you can create the corresponding account.payment and fill braintree_transaction_id with it. Once created you need to set to “processing”.
At this point the module will be able to keep the payment in sync with the broker.