Simplify expresssion

It's worth noting that a falsy value won't get cached (as before).
But I didn't take the time to investigate if that makes a difference or not.
This commit is contained in:
David Cook
2025-03-06 10:04:21 +11:00
parent 633cdaca56
commit 45eedd1e89

View File

@@ -68,11 +68,8 @@ module PaymentGateways
end
def valid_payment_intent?
@valid_payment_intent ||= if params["payment_intent"]&.starts_with?("pi_")
order_and_payment_valid?
else
false
end
@valid_payment_intent ||= params["payment_intent"]&.starts_with?("pi_") &&
order_and_payment_valid?
end
def order_and_payment_valid?