module PayuAPI

This methods allows to retrieve paymethods which are enabled for pos. For merchants with token payments enabled it also retrieves user payments tokens. Token payments requires OAuth token with grant type trusted_merchant.

Constants

VERSION

Public Class Methods

authorize(pos_id:, key:, sandbox: false) click to toggle source
# File lib/payu_api.rb, line 23
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
signature_valid?(body:, headers:, second_key:) click to toggle source
# File lib/payu_api.rb, line 28
def self.signature_valid?(body:, headers:, second_key:)
  signature = BuildSignature.new(body: body, second_key: second_key).call
  headers['OpenPayU-Signature'] == signature
end