Sha256: db33646d92221aed24e3a6dab95d778f2f01a0e45011561c24d77678d38f5e57
Contents?: true
Size: 1.04 KB
Versions: 11
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: false module PayPal class AccessTokenRequest attr_accessor :path, :body, :headers, :verb def initialize(environment, refresh_token = nil) @path = "/v1/oauth2/token" @body = { grant_type: "client_credentials", } if refresh_token @body[:grant_type] = "refresh_token" @body[:refresh_token] = refresh_token end @headers = { "Content-Type" => "application/x-www-form-urlencoded", "Authorization" => environment.authorization_string, } @verb = "POST" end end class RefreshTokenRequest attr_accessor :path, :body, :headers, :verb def initialize(environment, authorization_code) @path = "/v1/identity/openidconnect/tokenservice" @body = { grant_type: "authorization_code", code: authorization_code, } @headers = { "Content-Type" => "application/x-www-form-urlencoded", "Authorization" => environment.authorization_string, } @verb = "POST" end end end
Version data entries
11 entries across 11 versions & 1 rubygems