~singpolyma/jmp-pay

fc2d632ccfb8a723590081de4b50973c016e8742 — Stephen Paul Weber 3 months ago d949a09
Guard against empty params
1 files changed, 2 insertions(+), 0 deletions(-)

M config.ru
M config.ru => config.ru +2 -0
@@ 403,6 403,8 @@ class JmpPay < Roda
	end

	def retail_rate(rates)
		return unless rates&.first&.dig("total")

		total = BigDecimal(rates.first["total"], 2)
		total *= 0.75 if params["currency"] == "USD"
		params["country-name"] == "US" ? total.round : total.ceil