Gateway for GestPay
Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
lib
test
.gitignore
README.textile
Rakefile
kgestpay.gemspec
license

README.textile

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@email.com

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.