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

wompi

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wompi

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Wompi client

Ruby gem to use the Wompi API simple (Is still in progress)

Installation

Add this line to your application's Gemfile:

gem 'wompi'

And then execute:

$ bundle

Or install it yourself as:

$ gem install wompi

Usage

For Rails First create an wompi.rb in your config/initializers

require "wompi"

Wompi::RApi.configure do |config|
  config.pub_key = "pub_key"
  config.prv_key = "prv_key"
  config.webhook = "https://domain.com/wompi_webhook"
  config.sandbox = true # or false for production
end

Flow

First login

wompi_login = Wompi::RApi::Login.new
wompi_login.get_acceptance_token

wompi_card = Wompi::RApi::PaymentMethod.new(wompi_login)
wompi_card.as_dummy_card(params["card_status"])
wompi_card.create

if wompi_card.success?
  # DO something
end

Second prepare and create transaction

# login
wompi_login = Wompi::RApi::Login.new
wompi_login.get_acceptance_token

# handle payment method
wompi_card = Wompi::RApi::PaymentMethod.new(wompi_login)
wompi_card.as_card_with_known_id("token")
wompi_card.as_dummy_card("APPROVED") # or "DECLINED"
wompi_card.as_card("number", "cvc", "exp_month", "exp_year", "holder")
wompi_card.as_dummy_nequi("APPROVED") # or "DECLINED"
wompi_card.as_nequi("phone")
wompi_card.get_nequi("id")
wompi_card.check_nequi("phone") # use after initializing PaymentMethod and using get_nequi

# create payment source from payment method
wompi_source = Wompi::RApi::PaymentSource.new(wompi_login)
wompi_source.create(wompi_card, "email")

# create transaction
wompi_trans = Wompi::RApi::Transaction.new(wompi_login)
wompi_trans.prepare("amount_in_cents", "currency", "customer_email", "payment_source", "installments", "reference")
wompi_trans.create

if wompi_trans.success?
  # DO something
end

FAQs

Package last updated on 24 Jun 2021

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