Finance::Bank::SuomenVerkkomaksut

Process payments through JSON API of Suomen Verkkomaksut in Finland
Download

Finance::Bank::SuomenVerkkomaksut Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Oskari Ojala
  • Publisher web site:
  • http://search.cpan.org/~okko/

Finance::Bank::SuomenVerkkomaksut Tags


Finance::Bank::SuomenVerkkomaksut Description

Process payments through JSON API of Suomen Verkkomaksut in Finland Finance::Bank::SuomenVerkkomaksut is a Perl module to process payments from all Finnish Banks online: Nordea, Osuuspankki, Sampo, Tapiola, Aktia, Nooa, Paikallisosuuspankit, Säästöpankit, Handelsbanken, S-Pankki, Ålandsbanken, also from Visa, Visa Electron, MasterCard credit cards through Luottokunta, and PayPal, billing through Collector and Klarna.SYNOPSIS use Finance::Bank::SuomenVerkkomaksut; # Creating a new payment my $tx = Finance::Bank::SuomenVerkkomaksut->new({merchant_id => 'XXX', merchant_secret => 'YYY'}); # All content in accordance to http://docs.verkkomaksut.fi/ field specs $tx->content({ orderNumber => 1, referenceNumber => 13, description => 'Order 1', currency => 'EUR', locale => 'fi_FI', urlSet => {success => $c->uri_for('/payment/success').'/', failure => $c->uri_for('/payment/failure').'/', pending => $c->uri_for('/payment/pending').'/', notification => $c->uri_for('/payment/notification').'/', }, orderDetails => { includeVat => 1, contact => { firstName => 'First', lastName => 'Last', email => 'first@example.com', telephone => '555123', address => { street => 'Street 123', postalCode => '00100', postalOffice => 'Helsinki', country => 'FI', } }, products => , }, }); # set to 1 when you are developing, 0 in production $tx->test_transaction(1); my $submit_result = $tx->submit(); if ($submit_result) { print "Please go to ". $tx->url() ." $url to pay your order number ". $tx->order_number().', see you soon.'; } else { die 'Failed to generate payment'; } # Verifying the payment when the user returns or when the notify address receives a request my $tx = Finance::Bank::SuomenVerkkomaksut->new({merchant_id => 'XXX', merchant_secret => 'YYY'}); my $checksum_matches = $tx->verify_return({ ORDER_NUMBER => $c->req->params->{ORDER_NUMBER}, TIMESTAMP => $c->req->params->{TIMESTAMP}, PAID => $c->req->params->{PAID}, METHOD => $c->req->params->{METHOD}, RETURN_AUTHCODE => $c->req->params->{RETURN_AUTHCODE} }); if ($checksum_matches) { # depending on the return address, mark payment as paid (if returned to RETURN_ADDRESS), # as pending (if returned to PENDING_ADDRESS) or as canceled (if returned to CANCEL_ADDRESS). if ($url eq $return_url) { # &ship_products(); } } else { print "Checksum mismatch, returning not processed. Please contact our customer service if you believe this to be an error."; } Requirements: · Perl


Finance::Bank::SuomenVerkkomaksut Related Software