class Afterpay::Config
Attributes
afterpay_plugin[RW]
app_id[RW]
currency[RW]
description[RW]
env[RW]
maximum_amount[RW]
merchant_website_url[RW]
minimum_amount[RW]
platform[RW]
raise_errors[RW]
secret[RW]
skip_remote_config[RW]
system_information[RW]
type[RW]
Public Class Methods
new()
click to toggle source
# File lib/afterpay/config.rb, line 11 def initialize @env = "sandbox" @raise_errors = true @skip_remote_config = false end
Public Instance Methods
fetch_remote_config()
click to toggle source
Called only after app_id
and secred is set
# File lib/afterpay/config.rb, line 18 def fetch_remote_config response_body = Afterpay.client.get("/v2/configuration").body @minimum_amount = response_body.dig(:minimumAmount, :amount).to_f @maximum_amount = response_body.dig(:maximumAmount, :amount).to_f end