Giter Site home page Giter Site logo

kgestpay's Introduction

License

This gem is developed by fractalgarden (fractalgarden.com) and released under BSD license. See license file for more details.

Installation

gem install kgestpay

Running tests

Create a file /test/cc.yml with the details of the credit card to be used to run the tests:

number: cc_number
exp_month: 09
exp_year: 13
cvv: 111
name: 'Andrea Campolonghi'
email: [email protected]

callPagamS2S

Service that authorize only or complete the transaction based on the gestpay account configs provided (MOTO)

#gateway init
gateway = Kemen::KGestPay.new(:shopLogin => 'login', :endpoint => 'url del ws - test o produzione')
#call the service with the required parameters
resp = gateway.callPagamS2S(
    :uicCode => {currency code},
    :amount => ..,
    :shopTransactionId => {transaction id assigned by the seller},
    :cardNumber => ......,
    :expiryMonth => 09,
    :expiryYear => {last 2 digits of the expiring year},
    :cvv => ...,
    :buyerName => .....,
    :buyerEmail => ....)
#check the transaction result
resp.transactionResult => KO or OK
resp.authorizationCode => auth code
resp.bankTransactionID => transaction is assigned by the bank
resp.errorCode => in case of KO holds the error code assigned by gestpay
resp.errorDescription => in case of KO holds the description of the error
resp.buyer.buyerName => nome del cliente
resp.buyer.buyerEmail => email del cliente

callSettleS2S

Cash an already authorized card/amount. Used only for transaction only authorized but not yet cashed.

#gateway init
gateway = Kemen::KGestPay.new(:shopLogin => 'login', :endpoint => 'url del ws - test o produzione')
#call the service
resp = @k.callSettleS2S(
    :bankTransID => {transactionid assigned by the bank in the authorization process},
    OR
    :shopTransID => {transactionid assigned by the seller in the authorization process},
    :uicCode => {currency code},
    :amount => ...
)
#check the transaction result
resp.transactionResult => KO or OK

callDeleteS2S

Delete an authorized transaction. Available only for transaction only authorized but not yet finalized.

#gateway init
gateway = Kemen::KGestPay.new(:shopLogin => 'login', :endpoint => 'url del ws - test o produzione')
#call the service
resp = @k.callDeleteS2S(
    :shopTransactionId => {transactionid assigned by the seller in the authorization process}
    OR
    :bankTransactionId => {transactionid assigned by the bank in the authorization process}
)
#check the transaction result
resp.transactionResult => KO or OK

callRefundS2S

Refund a completed transaction. Refund can be for a partial amount. Both shopTransactionId and bankTransactionId must be provided for a bug that return a system error
if one is missing.

#gateway init
gateway = Kemen::KGestPay.new(:shopLogin => 'login', :endpoint => 'url del ws - test o produzione')
#call the service
resp = @k.callRefundS2S(
    :shopTransactionId => {transactionid assigned by the seller in the authorization process},
    :bankTransactionId => {transactionid assigned by the bank in the authorization process},
    :uicCode => 242,
    :amount => ...
)
#check the transaction result
resp.transactionResult => KO or OK

callReadTrxS2S

Read informations about a transaction.

#gateway init
gateway = Kemen::KGestPay.new(:shopLogin => 'login', :endpoint => 'url del ws - test o produzione')
#call the service
resp = @k.callRefundS2S(
    :shopTransactionId => {transactionid assigned by the seller in the authorization process},
    :bankTransactionId => {transactionid assigned by the bank in the authorization process}
)
#check the transaction result
resp.transactionResult => KO = Authorized or OK = Not Authorized
+ the same infos that are normally returned from callPagamS2S

callVerifycardS2S

Not implemented cause service is not available.

kgestpay's People

Contributors

andreacfm avatar kemen avatar

Stargazers

 avatar

Watchers

Gian Carlo Pace avatar  avatar James Cloos avatar

Forkers

marchino

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.