Sha256: 76fb2f7fe56b2208a98af2af3879f0460275b5b5ee2571f63a13478fca1e0621

Contents?: true

Size: 899 Bytes

Versions: 2

Compression:

Stored size: 899 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.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.4 lib/payu_api.rb
payu_api-0.1.3 lib/payu_api.rb