0.0
No commit activity in last 3 years
No release in over 3 years
Payture API for Ruby. To get started with Payture, you will need an account, please contact Payture directly. Please also note that this module was not developed by Payture.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.13
~> 1.6
~> 10.0
~> 3.0
 Project Readme

Payture for Ruby

Welcome to the Payture for Ruby gem! This gem allows you to integrate Payture into your Ruby application (Rails, etc.)

Installation

Add this line to your application's Gemfile:

gem 'payture_ruby'

And then execute:

$ bundle

Or install it yourself as:

$ gem install payture_ruby

Usage

In your code you will need to require the gem:

require 'payture'

API

Payture::Wallet

Init

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_ADD = ENV['PAYTURE_ADD'] // VWMerchantExampleAdd

payload = {
  OrderId:      'ABC123',
  SessionType:  'Block',
  VWUserLgn:    @user.email,
  VWUserPsw:    @user.token,
  Amount:       100
}

wallet = Payture::Wallet.new(HOST)
result = wallet.init(MERCHANT_ADD, payload)

Pay

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_PAY = ENV['PAYTURE_PAY'] // VWMerchantExamplePay

payload = {
  OrderId:      'DCB312',
  VWUserLgn:    @user.email,
  VWUserPsw:    @user.token,
  Amount:       100
  CardId:       @order.card_id
}

wallet = Payture::Wallet.new(HOST)
result = wallet.pay(MERCHANT_PAY, payload)

Payture::User

Register

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_ADD = ENV['PAYTURE_ADD'] // VWMerchantExampleAdd

payload = {
  VWUserLgn:    @user.email,
  VWUserPsw:    @user.token
}

wallet = Payture::User.new(HOST)
result = wallet.register(MERCHANT_ADD, payload)

Update

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_ADD = ENV['PAYTURE_ADD'] // VWMerchantExampleAdd

payload = {
  VWUserLgn:    @user.email,
  VWUserPsw:    @user.token,
  Phone:        @user.phone
}

wallet = Payture::User.new(HOST)
result = wallet.update(MERCHANT_ADD, payload)

Check

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_ADD = ENV['PAYTURE_ADD'] // VWMerchantExampleAdd

payload = {
  VWUserLgn:    @user.email,
  VWUserPsw:    @user.token
}

wallet = Payture::User.new(HOST)
result = wallet.check(MERCHANT_ADD, payload)

Delete

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_ADD = ENV['PAYTURE_ADD'] // VWMerchantExampleAdd
PASSWORD = ENV['PAYTURE_PASSWORD']

payload = {
  VWUserLgn:    @user.email,
  password:     PASSWORD
}

wallet = Payture::User.new(HOST)
result = wallet.delete(MERCHANT_ADD, payload)

Payture::Cards

GetList

HOST = ENV['PAYTURE_HOST'] // i.e. sandbox.payture.com
MERCHANT_ADD = ENV['PAYTURE_ADD'] // VWMerchantExampleAdd

payload = {
  VWUserLgn:    @user.email,
  VWUserPsw:    @user.token
}

wallet = Payture::Cards.new(HOST)
result = wallet.list(MERCHANT_ADD, payload)

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/payture_ruby. 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.