Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

payture_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

payture_api

  • 0.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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.

FAQs

Package last updated on 05 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc