Sha256: cf79de095f19cd5b571cdf7d4cbbf75434e14d95526171a9db09847fc83f3d74

Contents?: true

Size: 513 Bytes

Versions: 6

Compression:

Stored size: 513 Bytes

Contents

module PayuAPI
  class AuthRequest < Request
    extend Dry::Initializer::Mixin

    option :pos_id
    option :key
    option :sandbox, default: proc { false }

    private

    def sandbox?
      sandbox
    end

    def method
      :POST
    end

    def url
      '/pl/standard/user/oauth/authorize'
    end

    def headers
      { 'Content-Type' => 'application/x-www-form-urlencoded' }
    end

    def body
      "grant_type=client_credentials&client_id=#{pos_id}&client_secret=#{key}"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
payu_api-0.1.7 lib/payu_api/auth_request.rb
payu_api-0.1.5 lib/payu_api/auth_request.rb
payu_api-0.1.4 lib/payu_api/auth_request.rb
payu_api-0.1.3 lib/payu_api/auth_request.rb
payu_api-0.1.2 lib/payu_api/auth_request.rb
payu_api-0.1.1 lib/payu_api/auth_request.rb