mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-10 12:46:53 +00:00
Moves all payment-related logic (manual payments, Stripe sync, webhook handling) from the booking service into a dedicated payment service (`internal/service/payment`). Updates server, cron, and handler wiring to inject and use the new payment service. Adjusts tests, routes, and documentation to reflect the new separation of concerns. This improves cohesion, clarifies responsibilities, and prepares for future payment features. No database schema changes are introduced.
22 lines
594 B
Go
22 lines
594 B
Go
package payment
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"github.com/rjNemo/rentease/internal/config"
|
|
)
|
|
|
|
func mapStripeMethod(method string) config.PaymentMethod {
|
|
switch strings.ToLower(method) {
|
|
case "card", "link", "apple_pay", "google_pay", "cashapp":
|
|
return config.PaymentMethod("Card")
|
|
case "ach_credit_transfer", "ach_debit", "us_bank_account", "sepa_debit", "bank_transfer", "blik", "bancontact":
|
|
return config.PaymentMethod("Transfer")
|
|
case "cash":
|
|
return config.PaymentMethod("Cash")
|
|
case "check":
|
|
return config.PaymentMethod("Cheque")
|
|
default:
|
|
return config.PaymentMethod("Card")
|
|
}
|
|
}
|