Module: Justifi

Extended by:
Forwardable
Defined in:
lib/justifi.rb,
lib/justifi/util.rb,
lib/justifi/oauth.rb,
lib/justifi/payout.rb,
lib/justifi/refund.rb,
lib/justifi/dispute.rb,
lib/justifi/payment.rb,
lib/justifi/version.rb,
lib/justifi/webhook.rb,
lib/justifi/business.rb,
lib/justifi/checkout.rb,
lib/justifi/list_object.rb,
lib/justifi/sub_account.rb,
lib/justifi/configuration.rb,
lib/justifi/justifi_error.rb,
lib/justifi/api_operations.rb,
lib/justifi/justifi_object.rb,
lib/justifi/payment_intent.rb,
lib/justifi/payment_method.rb,
lib/justifi/in_memory_cache.rb,
lib/justifi/checkout_session.rb,
lib/justifi/justifi_response.rb,
lib/justifi/justifi_operations.rb,
lib/justifi/balance_transaction.rb

Defined Under Namespace

Modules: APIOperations, BalanceTransaction, Business, Checkout, CheckoutSession, Dispute, JustifiOperations, JustifiResponseBase, OAuth, Payment, PaymentIntent, PaymentMethod, Payout, Refund, SubAccount, Util, Webhook Classes: BadCredentialsError, Configuration, Error, InMemoryCache, InvalidHttpResponseError, JustifiObject, JustifiResponse, JustifiResponseHeaders, ListObject

Constant Summary collapse

REFUND_REASONS =
%w[duplicate fraudulent customer_request]
VERSION =
"0.9.0"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.cacheObject (readonly)

Returns the value of attribute cache.



41
42
43
# File 'lib/justifi.rb', line 41

def cache
  @cache
end

.configObject (readonly)

Returns the value of attribute config.



41
42
43
# File 'lib/justifi.rb', line 41

def config
  @config
end

Class Method Details

.clearObject



58
59
60
61
# File 'lib/justifi.rb', line 58

def clear
  Justifi.clear_cache
  Justifi.clear_credentials
end

.get_idempotency_keyObject



75
76
77
# File 'lib/justifi.rb', line 75

def get_idempotency_key
  SecureRandom.uuid
end

.seller_account_deprecation_warningObject



79
80
81
# File 'lib/justifi.rb', line 79

def 
  warn "[DEPRECATED] seller account has been deprecated, please use sub account"
end

.setup(client_id:, client_secret:, environment: "production") ⇒ Object



63
64
65
66
67
68
69
# File 'lib/justifi.rb', line 63

def setup(client_id:, client_secret:, environment: "production")
  @config = Justifi::Configuration.setup { |config|
    config.client_id = client_id
    config.client_secret = client_secret
    config.environment = environment
  }
end

.tokenObject



71
72
73
# File 'lib/justifi.rb', line 71

def token
  Justifi.cache.get(:access_token)
end