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
CREATE_INVOICE_ENCRYPT_FIELDS =
%i[merchantAccount merchantDomainName orderReference orderDate amount currency productName productCount productPrice].freeze
ACCEPT_INVOICE_PAYMENT_ENCRYPT_FIELDS =
%i[orderReference status time].freeze
GET_CLIENT_ENCRYPT_FIELDS =
%i[merchantAccount recToken card].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
CREATE_INVOICE_ATTRS =
{
  transactionType: 'CREATE_INVOICE',
  authorizationType: 'SimpleSignature',
  merchantTransactionType: 'AUTH',
  merchantTransactionSecureType: 'NON3DS',
  apiVersion: 1
}.freeze
ACCEPT_INVOICE_PAYMENT_ATTRS =
{
  status:'accept'
}.freeze
GET_CLIENT_ATTRS =
{
  transactionType: 'GET_CLIENT',
  apiVersion: 1
}

Class Method Summary collapse

Class Method Details

.accept_invoice_payment_paramsObject



84
85
86
# File 'lib/wayforpay/constants.rb', line 84

def self.accept_invoice_payment_params
  ACCEPT_INVOICE_PAYMENT_ATTRS
end

.create_invoice_paramsObject



77
78
79
80
81
82
# File 'lib/wayforpay/constants.rb', line 77

def self.create_invoice_params
  CREATE_INVOICE_ATTRS.merge(
    merchantAccount: Wayforpay.,
    merchantDomainName: Wayforpay.merchant_domain_name
  )
end

.get_client_paramsObject



88
89
90
# File 'lib/wayforpay/constants.rb', line 88

def self.get_client_params
  GET_CLIENT_ATTRS.merge(merchantAccount: Wayforpay.)
end

.hold_paramsObject



55
56
57
58
59
60
# File 'lib/wayforpay/constants.rb', line 55

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

.refund_paramsObject



62
63
64
# File 'lib/wayforpay/constants.rb', line 62

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

.settle_paramsObject



66
67
68
# File 'lib/wayforpay/constants.rb', line 66

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

.verify_paramsObject



70
71
72
73
74
75
# File 'lib/wayforpay/constants.rb', line 70

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