GithubHelp home page GithubHelp logo

mohitsaxenaknoldus / six_saferpay Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fadendaten/six_saferpay

0.0 0.0 0.0 370 KB

Gem for the SIX Saferpay API

License: MIT License

Ruby 98.86% Shell 0.19% HTML 0.95%

six_saferpay's Introduction

Gem Version Build Status Maintainability

SixSaferpay

Current API Version

This gem is compatible with the SIX API version: 1.20

Installation

Add this line to your application's Gemfile:

gem 'six_saferpay'

And then execute:

$ bundle

Or install it yourself as:

$ gem install six_saferpay

Configuration

Please configure your gem:

SixSaferpay.configure do |config|
  config.customer_id = YOUR_SIX_SAFERPAY_CUSTOMER_ID
  config.terminal_id = YOUR_SIX_SAFERPAY_TERMINAL_ID
  config.username = YOUR_SIX_SAFERPAY_USERNAME
  config.password = YOUR_SIX_SAFERPAY_PASSWORD
  config.success_url = YOUR_SIX_SAFERPAY_SUCCESS_URL
  config.fail_url = YOUR_SIX_SAFERPAY_FAIL_URL
  config.base_url = YOUR_SIX_SAFERPAY_BASE_URL
  config.css_url = YOUR_SIX_SAFERPAY_CSS_URL
end

Usage

SIX Saferpay provides multiple interfaces. We give you a short introduction in the usage of the gem by showing you two examples for the initialize requests.

SIX Saferpay Payment Page

The SIX Saferpay Payment Page is a simple implementation of the payment gateway of SIX.

PaymentPage Initialize

Before we start we have to create a two basic objects. The first object is the SixSaferpay::Amount. This object represents the value of your cart in the currency you sell your products. The second object is the SixSaferpay::Payment. This object represents the payment a user of your shop will do. As you can see, the amount object is includes in this object.

amount = SixSaferpay::Amount.new(value: 100, currency_code: "CHF")
payment = SixSaferpay::Payment.new(amount: amount, order_id: 1234, description: 'Order #1234')

After we create those two objects, we can create the initialize object for the SIX Saferpay Payment Page.

initialize = SixSaferpay::SixPaymentPage::Initialize.new(payment: payment)

Now we can send the initialize request to the API. We can use the client object to send a post request to the API.

initialize_response = SixSaferpay::Client.post(initialize)

The client will return a response object. After an initialize request, the client will return you a initialize response object (SixSaferpay::InitializeResponse).

If the request goes wrong the client raises a SixSaferpay::Error

Other Requests

You will find for all the other requests an predefined object. Feel free to use this according the SIX Saferpay API documentation.

SIX Saferpay Transaction

TODO

SIX Secure PayGate API

If you want to use the SIX Secure PayGate API, you have to use an other Client:

create_offer_request = SixSaferpay::SecurePayGateOffer.new(...)
create_offer_response = SixSaferpay::SecurePayGateApi::Client.new(create_offer_request)

Documentation

SIX Saferpay JSON API

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/six_saferpay.

Implementation Status

SIX Payment Page

  • Initialize
  • Assert

SIX Transaction

  • Initialize
  • Authorize
  • QueryPaymentMeans
  • AdjustAmount
  • AuthorizeDirect
  • AuthorizeReferenced
  • Capture
  • MultipartCapture
  • AssertCapture
  • MultipartFinalize
  • Refund
  • AssertRefund
  • RefundDirect
  • Cancel
  • RedirectPayment (Deprecated)
  • AssertRedirectPayment (Deprecated)
  • Inquire

SIX Secure Card Data

  • Insert
  • AssertInsert
  • InsertDirect
  • Delete

SIX Batch

  • Close

SIX OmniChannel

  • InsertAlias
  • AcquireTransaction

Secure PayGate API

  • CreateOffer

License

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

six_saferpay's People

Contributors

f3lan avatar knorrli avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.