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 #170 migrate Spree::PayoutProfilePayment to Spree::Payout #171

Closed theachoem closed 1 month ago

theachoem commented 1 month ago

Payout profile payment is previous solution but it didn't specify which line item of that payout payment. New payout model will have a relationship to the line item as well. This PR also include some changes which are auto-correct by rubocop that hard to ignore.

image

Generate above payouts is process as follow:

  1. User create payment
  2. When it supported payout, payment generate payouts with amount required by merchant & store (with state :created)
  3. Payment use payouts records to construct payout params for create transaction in bank.
  4. When paid, bank will send us transaction info:
    • We check if total payout amount from bank is equal to payouts of that payment, then update state to :confirmed.

In next PR, we focus on making payout support tax, shipment, adjustment run by store or merchant.