Business-PayPoint

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

NAME
    Business::PayPoint - PayPoint online payment

VERSION
    version 0.01

SYNOPSIS
        use Business::PayPoint;

        my $bp = Business::PayPoint->new();
        $bp->set_credentials($mid, $vpn_pass, $remote_pass);

DESCRIPTION
    <https://www.paypoint.net/assets/guides/Gateway_Freedom.pdf>

  METHODS
   set_credentials
        $bp->set_credentials($mid, $vpn_pass, $remote_pass);
        # $bp->set_credentials('secpay', 'secpay', 'secpay');

   validateCardFull
        my %result = $bp->validateCardFull(
            'trans_id' => 'tran0001',
            'ip' => '127.0.0.1',
            'name' => 'Mr Cardholder',
            'card_number' => '4444333322221111',
            'amount' => '50.00',
            'expiry_date' => '0115',
            'billing' => "name=Fred+Bloggs,company=Online+Shop+Ltd,addr_1=Dotcom+House,addr_2=London+Road,city=Townville,state=Countyshire,post_code=AB1+C23,tel=01234+567+890,fax=09876+543+210,email=somebody%40secpay.com,url=http%3A%2F%2Fwww.somedoma...

examples/test.pl  view on Meta::CPAN

#!/usr/bin/perl

use strict;
use warnings;
use FindBin qw/$Bin/;
use lib "$Bin/../lib";
use Business::PayPoint;
use Data::Dumper;

my $bp = Business::PayPoint->new();
$bp->set_credentials( 'secpay', 'secpay', 'secpay' );

my %result = $bp->validateCardFull(
    'trans_id'    => 'tran0001',
    'ip'          => '127.0.0.1',
    'name'        => 'Mr Cardholder',
    'card_number' => '4444333322221111',
    'amount'      => '50.00',
    'expiry_date' => '0115',
    'billing' =>
"name=Fred+Bloggs,company=Online+Shop+Ltd,addr_1=Dotcom+House,addr_2=London+Road,city=Townville,state=Countyshire,post_code=AB1+C23,tel=01234+567+890,fax=09876+543+210,email=somebody%40secpay.com,url=http%3A%2F%2Fwww.somedomain.com",

lib/Business/PayPoint.pm  view on Meta::CPAN

    $args->{debug} ||= $ENV{PAYPOINT_DEBUG};
    SOAP::Trace->import('all') if $args->{debug};

    $SOAP::Constants::PREFIX_ENV = 'soap';
    $args->{soap} ||= SOAP::Lite->readable(1)
      ->proxy('https://www.secpay.com/java-bin/services/SECCardService?wsdl');

    bless $args, $class;
}

sub set_credentials {
    my ( $self, $mid, $vpn_pass, $remote_pass ) = @_;

    $self->{__mid}         = $mid;
    $self->{__vpn_pswd}    = $vpn_pass;
    $self->{__remote_pswd} = $remote_pass;
}

sub validateCardFull {
    my $self = shift;
    my $args = @_ % 2 ? $_[0] : {@_};

lib/Business/PayPoint.pm  view on Meta::CPAN

        'currency',            'options'
    ];
    $self->_request( 'performTransactionViaAlternatePaymentMethod',
        $ordered_keys, $args );
}

sub _request {
    my ( $self, $method, $ordered_keys, $args ) = @_;

    unless ( $self->{__mid} ) {
        return { valid => 'false', message => 'credentials is not setup yet' };
    }

    my @requests = ( vpn_pswd => $self->{__vpn_pswd}, mid => $self->{__mid} );
    foreach my $k (@$ordered_keys) {
        if ( $k eq 'amount' ) {
            push @requests, ( amount => sprintf( '%.2f', $args->{amount} ) );
        }
        elsif ( $k eq 'remote_pswd' ) {
            push @requests, ( remote_pswd => $self->{__remote_pswd} || '' );
        }

lib/Business/PayPoint.pm  view on Meta::CPAN


=head1 VERSION

version 0.01

=head1 SYNOPSIS

    use Business::PayPoint;

    my $bp = Business::PayPoint->new();
    $bp->set_credentials($mid, $vpn_pass, $remote_pass);

=head1 DESCRIPTION

L<https://www.paypoint.net/assets/guides/Gateway_Freedom.pdf>

=head2 METHODS

=head3 set_credentials

    $bp->set_credentials($mid, $vpn_pass, $remote_pass);
    # $bp->set_credentials('secpay', 'secpay', 'secpay');

=head3 validateCardFull

    my %result = $bp->validateCardFull(
        'trans_id' => 'tran0001',
        'ip' => '127.0.0.1',
        'name' => 'Mr Cardholder',
        'card_number' => '4444333322221111',
        'amount' => '50.00',
        'expiry_date' => '0115',



( run in 0.249 second using v1.01-cache-2.11-cpan-4d50c553e7e )