mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-02 02:11:33 +00:00
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:
@@ -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?
|
||||
|
||||
Reference in New Issue
Block a user