优化结构
This commit is contained in:
@@ -385,11 +385,6 @@ func paypalOrderResult(order *paypal.OrderDetail, queryID, fallbackTradeNo strin
|
||||
return result, nil
|
||||
}
|
||||
|
||||
func paypalOrderTradeNo(order *paypal.OrderDetail) string {
|
||||
tradeNo, _ := paypalOrderIdentity(order)
|
||||
return tradeNo
|
||||
}
|
||||
|
||||
func paypalOrderIdentity(order *paypal.OrderDetail) (string, error) {
|
||||
if order == nil {
|
||||
return "", nil
|
||||
@@ -648,17 +643,6 @@ func paypalAmountScale(currency string, c map[string]any) (int64, error) {
|
||||
}
|
||||
}
|
||||
|
||||
func normalizePayPalOrderState(state string) string {
|
||||
switch strings.ToUpper(strings.TrimSpace(state)) {
|
||||
case "COMPLETED":
|
||||
return "success"
|
||||
case "VOIDED":
|
||||
return "failed"
|
||||
default:
|
||||
return "pending"
|
||||
}
|
||||
}
|
||||
|
||||
func normalizePayPalCaptureState(state string) string {
|
||||
switch strings.ToUpper(strings.TrimSpace(state)) {
|
||||
case "COMPLETED", "PARTIALLY_REFUNDED", "REFUNDED":
|
||||
|
||||
Reference in New Issue
Block a user