Module: Wayforpay::Constants

Defined in:
lib/wayforpay/constants.rb

Constant Summary collapse

URL =
URI.parse('https://api.wayforpay.com/api').freeze
HOLD_ENCRYPT_FIELDS =
i[merchantAccount merchantDomainName orderReference orderDate amount currency productName productCount productPrice].freeze
REFUND_ENCRYPT_FIELDS =
i[merchantAccount orderReference amount currency].freeze
SETTLE_ENCRYPT_FIELDS =
i[merchantAccount orderReference amount currency].freeze
VERIFY_ENCRYPT_FIELDS =
i[merchantAccount merchantDomainName orderReference amount currency].freeze
HOLD_ATTRS =
{
  transactionType: 'CHARGE',
  authorizationType: 'SimpleSignature',
  merchantTransactionType: 'AUTH',
  merchantTransactionSecureType: 'NON3DS',
  apiVersion: 1
}.freeze
REFUND_ATTRS =
{
  transactionType: 'REFUND',
  apiVersion: 1
}.freeze
SETTLE_ATTRS =
{
  transactionType: 'SETTLE',
  apiVersion: 1
}.freeze
VERIFY_ATTRS =
{
  transactionType: 'VERIFY',
  apiVersion: 1
}.freeze

Class Method Summary collapse

Class Method Details

.hold_paramsObject



35
36
37
38
39
40
# File 'lib/wayforpay/constants.rb', line 35

def self.hold_params
  HOLD_ATTRS.merge(
    merchantAccount: Wayforpay.,
    merchantDomainName: Wayforpay.merchant_domain_name
  )
end

.refund_paramsObject



42
43
44
# File 'lib/wayforpay/constants.rb', line 42

def self.refund_params
  REFUND_ATTRS.merge(merchantAccount: Wayforpay.)
end

.settle_paramsObject



46
47
48
# File 'lib/wayforpay/constants.rb', line 46

def self.settle_params
  SETTLE_ATTRS.merge(merchantAccount: Wayforpay.)
end

.verify_paramsObject



50
51
52
53
54
55
# File 'lib/wayforpay/constants.rb', line 50

def self.verify_params
  VERIFY_ATTRS.merge(
    merchantAccount: Wayforpay.,
    merchantDomainName: Wayforpay.merchant_domain_name
  )
end