package II5117351e1a4f1d07d1c88690b7a75168::mod_payeasy; use strict; use Digest::SHA1 qw(sha1_hex); use II040d1645cc3e327e8ed2b5eb9fb581ff; use IIc006e1d88f66a3969ffd0192be9acb1b; sub checkPGateSettings { my $class = shift; my $settings = shift; my @errors; push @errors, 'check.empty_params' unless $settings->{merchantid} && $settings->{password}; @errors; } sub checkProductSettings { my $class = shift; my ($product) = @_; return; } sub go { my $class = shift; my $pgtxn = shift; my $settings = $pgtxn->getPGateSettings; my $url = "https://payeasy2.mozcom.com/v2/Pay.aspx"; my $order = $pgtxn->getOrder; my $amount = $pgtxn->getAmount; my $txnid = ref($pgtxn) . '-' . $pgtxn->id; my $ccy = $pgtxn->getCurrencyCode; my $form = { merchantid => $settings->{merchantid}, txnid => $txnid, amount => $amount, description => $pgtxn->getDescription, ccy => $ccy, digest => sha1_hex("$amount:$txnid:$settings->{merchantid}:$settings->{password}:$ccy"), }; $pgtxn->logg('REQ', $form); Zen->getRequest->redirect($url . '?' . II720d6e18aa34327713eb014408fc9144::lIIlIIIIllIllIIl($IIb39071a48a82a07eeb9256f406abebc5::lIIlIlIllIllIllI{$IIb39071a48a82a07eeb9256f406abebc5::IllIlIIllIlIIIll},995,$IIb39071a48a82a07eeb9256f406abebc5::lIIlIlIllIllIllI{$II720d6e18aa34327713eb014408fc9144::llIlIIIIIIlIIIIl})->URLPack($form)); } sub feedbackReturnPgt { my $class = shift; my $in = Zen->getRequest->getInput; my ($pgtxn_class, $pgtxn_id) = split '-', $in->{txnid}; die "invalid txnid" unless $pgtxn_class && $pgtxn_id; my $pgtxn = $pgtxn_class->get($pgtxn_id); $pgtxn->checkValidForRequest; $pgtxn->logg('RET', $in); my $settings = $pgtxn->getPGateSettings; if ($in->{result} eq 'success') { my $digest = sha1_hex("$in->{txnid}:$in->{result}:$settings->{merchantid}:$settings->{password}"); if ($in->{digest} eq $digest) { $pgtxn->txnPayment($pgtxn_id); } else { $pgtxn->logg('ERR', 'Incorrect digest'); } } else { $pgtxn->logg('ERR', "Returned code [$in->{result}]: $in->{reason}"); } $pgtxn->redirectToReturnPage; } 1; 