module Googlepay

Constants

SCOPE
VERSION

Attributes

configuration[RW]

Public Class Methods

configure() { |configuration| ... } click to toggle source
# File lib/googlepay.rb, line 29
def self.configure
  yield(configuration)
end
reset() click to toggle source
# File lib/googlepay.rb, line 25
def self.reset
  @configuration = Configuration.new
end
token() click to toggle source
# File lib/googlepay.rb, line 13
def self.token
  fetch_token
end

Private Class Methods

fetch_token() click to toggle source
# File lib/googlepay.rb, line 35
def self.fetch_token
  json_key = Tempfile.new
  json_key.write(Googlepay.configuration.service_account.to_json)
  json_key.rewind
  authorizer = Google::Auth::ServiceAccountCredentials.make_creds(
    json_key_io: json_key,
    scope: SCOPE
  )
  json_key.close
  authorizer.fetch_access_token!['access_token']
end
root() click to toggle source
# File lib/googlepay.rb, line 47
def self.root
  File.expand_path '../..', __FILE__
end