Class: FakeBraintree::ClientToken

Inherits:
Object
  • Object
show all
Defined in:
lib/fake_braintree/client_token.rb

Class Method Summary collapse

Class Method Details

.generate(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/fake_braintree/client_token.rb', line 3

def self.generate(options = {})
  root_url = "http://localhost:#{ENV['GATEWAY_PORT']}"
  unencoded_client_token = {
    clientApiUrl: "#{root_url}/merchants/merchant_id/client_api",
    authUrl: 'http://auth.venmo.dev:9292',
    configUrl: "#{root_url}/config",
    assetsUrl: root_url,
    authorizationFingerprint: options['customer_id']
  }.to_json
  Base64.strict_encode64(unencoded_client_token)
end