bookmebus / spree_vpago

Spree extension for traditional redirect off site payment gateway in Cambodia
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

close #166 support promotion, tax, adjustments in payouts #167

Closed theachoem closed 1 month ago

theachoem commented 2 months ago

I. Why?

In previous payout implementations, we disabled payouts when the order had promotions, adjustments, taxes, etc. This PR is intended to support them.

To support all types of adjustments, we need to understand who is running those adjustments to calculate the correct commission and exact money that merchant expect for each of their products. We want to automate the process as much as possible.

Example:

II. Table Design

This is the database designed to support the above use cases & records all financial data.
How payout is setup?
payout - how to setup
How payout is generated?
payout - how payout is generated_

III. Test with use cases

1. Use case #1

payout - usecase 1

2. Use case #2

payout - usecase 2

3. Use case #3

payout - usecase 3

4. Use case #4

payout - usecase 4

5. Use case #5

payout - usecase 5

6. Use case #6

payout - usecase 6

Related PR (UI for this changes):