Project

mokapay

0.0
No commit activity in last 3 years
No release in over 3 years
Ruby gem for Moka payment system.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 2.1.0
~> 3.0

Runtime

~> 1.8, >= 1.8.0
 Project Readme

Mokapay

Unofficial API wrapper for MOKA Payment System.

Installation

Add this line to your application's Gemfile:

gem 'mokapay', require: 'moka'

And then execute:

$ bundle

Or install it yourself as:

$ gem install mokapay

Usage

require 'moka'

Moka.configure do |config|
  config.dealer_code  = '1730'
  config.username     = 'TestMoka1'
  config.password     = 'YHSUSHDYHUDHD'
  config.env          = 'test' # Default production 
end

Note: When making any request, you can use all parameters on the official documentation with snake case. For example you can use card_holder_full_name for CardHolderFullName on official documentation.

Create Direct Payment

payment = Moka::Payment.new({
  card_holder_full_name: 'Huseyin TUNC',
  card_number: '5269552233334444',
  exp_month: '12',
  exp_year: '2022',
  cvc_number: '000',
  amount: 10.10,
  client_ip: '1.2.3.4',
  other_trx_code: 1
})

payment.pay # Make request (also returns the response)
payment.success? # To check if it success
payment.response # Returns the response 

Create 3D Payment

payment = Moka::Payment.new({
  card_holder_full_name: 'Huseyin TUNC',
  card_number: '5269552233334444',
  exp_month: '12',
  exp_year: '2022',
  cvc_number: '000',
  amount: 10.10,
  client_ip: '1.2.3.4',
  other_trx_code: 1,
  redirect_url: 'http://localhost:3000/payments/success'
})

payment.pay_three_d

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/hsyntnc/mokapay. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.