Sha256: b9f33a6662443b99d2c92bfb11f561c15b73cfcf761bf2cc0f462461c4c3928c

Contents?: true

Size: 978 Bytes

Versions: 2

Compression:

Stored size: 978 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/responses/paymethods_response'
require 'payu_api/build_signature'
require 'payu_api/order'
require 'payu_api/paymethods'
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.new(body: body, second_key: second_key).call
    headers['OpenPayU-Signature'] == signature
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
payu_api-0.1.7 lib/payu_api.rb
payu_api-0.1.5 lib/payu_api.rb