Sha256: 9ad11ffe03e36e456d162e8732b6eba81d0ce991ab6283888408de1135042821
Contents?: true
Size: 896 Bytes
Versions: 3
Compression:
Stored size: 896 Bytes
Contents
module Workarea module Admin class AfterpayConfigurationViewModel < ApplicationViewModel include Storefront::AfterpayConfiguration def au_limits return unless Workarea::Afterpay.merchant_id(:au).present? limits = afterpay_configuration(:au).first { min: min_price(limits), max: max_price(limits) } end def us_limits return unless Workarea::Afterpay.merchant_id(:us).present? limits = afterpay_configuration(:us).first { min: min_price(limits), max: max_price(limits) } end private def min_price(limits) return 0.to_m unless limits["minimumAmount"].present? limits["minimumAmount"]["amount"].to_m end def max_price(limits) limits["maximumAmount"]["amount"].to_m end end end end
Version data entries
3 entries across 3 versions & 1 rubygems