rentease/internal/service/payment/map.go
Ruidy 146787033a
refactor(payment): extract payment logic to new service
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.
2025-11-21 10:09:30 +01:00

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")
}
}