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

payment_3p

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

payment_3p

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Payment3p

Provides integration with payment gateways (MIGS initially) to perform 3-Party online payment

Installation

Add this line to your application's Gemfile:

gem 'payment_3p'

And then execute:

$ bundle

Or install it yourself as:

$ gem install payment_3p

Now run a generator to create payment_3p.yml configuration file which contains the payment gateway configurations

$ rails generate payment3p:config

Add your specific configurations for the secure secret, access code and merchant id.

That's it, you're now ready to go.

Usage

Generate the payment URL that you'll redirect your users to

Payment3p.payment_url(
  vpc_MerchTxnRef: "1",
  vpc_ReturnURL: "http://example.com/payment_callback",
  vpc_OrderInfo: "CART_1",
  vpc_Amount: "100",
)

Where

  • vpc_MerchTxnRef usually contains the transaction number used to identify this transaction in your application
  • vpc_ReturnURL the callback URL with payment result, the payment gateway will redirect to this URL
  • vpc_OrderInfo usually contains additional order information like cart number or order id for example
  • vpc_Amount is the amount in CENTS

Now validate the payment response in your callback, this validates that the response is a payment gateway response

Payment3p.validate_response(response)

Which will return a boolean indicating whether the response was validated or not

NOTE:

You still need to validate that the transaction paid through the payment gateway is the same transaction that was generated by your application, don't just rely on validating the payment gateway response there are a lot of bad people out there!!!

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 04 Feb 2014

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