| 1 | package SMS::Send::NL::Mollie; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use base 'SMS::Send::Driver'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Net::SMS::Mollie; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use vars qw{$VERSION}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 1 | $VERSION = '0.01'; | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||
| 13 | 0 | my ($class, %params) = @_; | |||||||||
| 14 | |||||||||||
| 15 | 0 | foreach(qw/username password/) { | |||||||||
| 16 | 0 | ▶ | Carp::croak("No $_ specified") unless(defined $params{"_$_"}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 0 | my $self = bless { %params }, $class; | |||||||||
| 20 | |||||||||||
| 21 | 0 | return $self; | |||||||||
| 22 | } | ||||||||||
| 23 | |||||||||||
| 24 | 0 | ▶ | sub send_sms { | ||||||||
|
Subroutine
send_sms: not called CC=3 SCAR=24.8
| |||||||||||
| 25 | 0 | my $self = shift; | |||||||||
| 26 | 0 | my %params = @_; | |||||||||
| 27 | |||||||||||
| 28 | my $mollie = Net::SMS::Mollie->new( | ||||||||||
| 29 | username => $self->{"_username"}, | ||||||||||
| 30 | 0 | password => $self->{"_password"}, | |||||||||
| 31 | ); | ||||||||||
| 32 | $mollie->originator($self->{"_originator"}) | ||||||||||
| 33 | 0 | ▶ | if(defined $self->{"_originator"}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | $mollie->originator($self->{"_gateway"}) | ||||||||||
| 35 | 0 | ▶ | if(defined $self->{"_gateway"}); | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | |||||||||||
| 37 | 0 | $mollie->recipient($params{"to"}); | |||||||||
| 38 | 0 | return $mollie->send($params{"text"}); | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | #################### main pod documentation begin ################### | ||||||||||
| 42 | |||||||||||
| 43 | =head1 NAME | ||||||||||
| 44 | |||||||||||
| 45 | SMS::Send::NL::Mollie - SMS::Send driver for www.mollie.nl | ||||||||||
| 46 | |||||||||||
| 47 | =head1 SYNOPSIS | ||||||||||
| 48 | |||||||||||
| 49 | use SMS::Send; | ||||||||||
| 50 | |||||||||||
| 51 | my $sender = SMS::Send->new('NL::Mollie', | ||||||||||
| 52 | _username => 'MyUserName', | ||||||||||
| 53 | _password => 'P4ssw0rd!', | ||||||||||
| 54 | _originator => '0612345678', | ||||||||||
| 55 | _gateway => 2, | ||||||||||
| 56 | ); | ||||||||||
| 57 | |||||||||||
| 58 | my $sent = $sender->send_sms( | ||||||||||
| 59 | text => 'My very urgent message', | ||||||||||
| 60 | to => '0687654321', | ||||||||||
| 61 | ); | ||||||||||
| 62 | |||||||||||
| 63 | =head1 DESCRIPTION | ||||||||||
| 64 | |||||||||||
| 65 | SMS::Send::NL::Mollie is a L<SMS::Send> driver which allows you to send | ||||||||||
| 66 | messages through L<http://www.mollie.nl/>. | ||||||||||
| 67 | |||||||||||
| 68 | =head1 METHODS | ||||||||||
| 69 | |||||||||||
| 70 | =head2 new | ||||||||||
| 71 | |||||||||||
| 72 | The C<new> method takes a few parameters. C<_username> and C<_password> | ||||||||||
| 73 | are mandatory, C<_originator>, and C<_gateway> are optional. | ||||||||||
| 74 | See L<Net::SMS::Mollie> for details on these parameters. | ||||||||||
| 75 | |||||||||||
| 76 | This driver is a very simplified wrapper around L<Net::SMS::Mollie> | ||||||||||
| 77 | and provides a lot less functionality than L<Net::SMS::Mollie>. | ||||||||||
| 78 | |||||||||||
| 79 | =head2 send_sms | ||||||||||
| 80 | |||||||||||
| 81 | Takes C<to> as recipient phonenumber, and C<text> as the text that's | ||||||||||
| 82 | supposed to be delivered. | ||||||||||
| 83 | |||||||||||
| 84 | =head1 SEE ALSO | ||||||||||
| 85 | |||||||||||
| 86 | =over 5 | ||||||||||
| 87 | |||||||||||
| 88 | =item * L<Send::SMS> | ||||||||||
| 89 | |||||||||||
| 90 | =item * L<Net::SMS::Mollie> | ||||||||||
| 91 | |||||||||||
| 92 | =back | ||||||||||
| 93 | |||||||||||
| 94 | =head1 BUGS | ||||||||||
| 95 | |||||||||||
| 96 | Please report any bugs to L<http://rt.cpan.org/Ticket/Create.html?Queue=Send-SMS-NL-Mollie> | ||||||||||
| 97 | |||||||||||
| 98 | =head1 AUTHOR | ||||||||||
| 99 | |||||||||||
| 100 | M. Blom | ||||||||||
| 101 | E<lt>blom@cpan.orgE<gt> | ||||||||||
| 102 | L<http://menno.b10m.net/perl/> | ||||||||||
| 103 | |||||||||||
| 104 | =head1 COPYRIGHT | ||||||||||
| 105 | |||||||||||
| 106 | This program is free software; you can redistribute | ||||||||||
| 107 | it and/or modify it under the same terms as Perl itself. | ||||||||||
| 108 | |||||||||||
| 109 | The full text of the license can be found in the | ||||||||||
| 110 | LICENSE file included with this module. | ||||||||||
| 111 | |||||||||||
| 112 | =cut | ||||||||||
| 113 | |||||||||||
| 114 | 1 | 1; | |||||||||