storj/satellite/payments/stripecoinpayments
Kaloyan Raev 073f9ed499 satellite/payments: deduct stripe discount first
We have 3 types of discounts:
1) Promotional credits/coupons
2) Bonus from depositing STORJ tokens
3) Stripe discounts (e.g. 100% off for Storjlings, 30% off for Early
Adopters, etc.)

So far the discounts were applied in the above order. But because the
Stripe discount is applied on all of the project usage fees, this could
sometimes lead to negative total in the invoice. Especially, if the
Stripe discount is 100% or all of the project fees are covered by
coupons and bonus.

To resolve this issue, before applying promotional coupons and deposit
bonuses, the Stripe discount will be applied first to the project fees.

Change-Id: I5dcbec04ec3a04e7f76b11e0a228ccb3195f2db0
2020-05-12 09:26:27 +00:00
..
accounts.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
clearing.go satellite/payments: remove unused code 2020-02-20 16:04:19 +02:00
conversion.go satellite/payments: token deposit accept cents (#3628) 2019-11-21 16:25:37 +02:00
coupons_test.go all: remove old uuid 2020-04-02 19:30:36 +03:00
coupons.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
creditcards.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
credits_test.go all: remove old uuid 2020-04-02 19:30:36 +03:00
credits.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
customers_test.go satellite/payments/stripecoinpayments: fix test flakyness 2020-04-29 12:06:35 +00:00
customers.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
db.go satellite/payments : deposit bonuses (credits) added 2020-02-11 11:11:42 +00:00
endpoint.go satellite/payments/stripecoinpayments: added ApplyInvoiceCredits 2020-02-12 20:06:08 +02:00
invoices.go satellite/payments: fix invoice amount in billing history 2020-05-08 11:43:41 +00:00
projectrecords_test.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
projectrecords.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
service.go satellite/payments: deduct stripe discount first 2020-05-12 09:26:27 +00:00
tokens.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
transactions_test.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
transactions.go all: switch to storj.io/common/uuid 2020-03-31 19:16:41 +03:00
version.go common: separate repository 2019-12-27 14:11:15 +02:00