Sha256: b3bce60fece64f92a5bf5812625f863854db6a3cbc33700a3ef99eb71f5f1eba

Contents?: true

Size: 895 Bytes

Versions: 1

Compression:

Stored size: 895 Bytes

Contents

require 'json'
require 'digest'
require 'faraday'
require 'dry-initializer'

require 'payu_api/version'
require 'payu_api/errors'
require 'payu_api/request'
require 'payu_api/api_request'
require 'payu_api/auth_request'
require 'payu_api/response'
require 'payu_api/responses/auth_response'
require 'payu_api/responses/get_response'
require 'payu_api/responses/create_response'
require 'payu_api/responses/refund_response'
require 'payu_api/build_signature'
require 'payu_api/order'
require 'payu_api/client'

module PayuAPI
  def self.authorize(pos_id:, key:, sandbox: false)
    request = AuthRequest.new(pos_id: pos_id, key: key, sandbox: sandbox)
    AuthResponse.new(http_response: request.call)
  end

  def self.signature_valid?(body:, headers:, second_key:)
    signature = BuildSignature(body: body, second_key: second_key).call
    headers['OpenPayU-Signature'] == signature
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
payu_api-0.1.2 lib/payu_api.rb