Net::FreshBooks::API::Gateway - List gateways available in your FreshBooks account


Net-FreshBooks-API documentation Contained in the Net-FreshBooks-API distribution.

Index


Code Index:

NAME

Top

Net::FreshBooks::API::Gateway - List gateways available in your FreshBooks account

VERSION

Top

version 0.21

SYNOPSIS

Top

    my $fb = Net::FreshBooks::API->new(...);
    my $gateways = $fb->gateway->get_all();

    # or
    my $autobill_gateways = $fb->gateway->get_all({ autobill_capable => 1 });

list

Returns an Net::FreshBooks::API::Iterator object. Currently, all list() functionality defaults to 15 items per page.

    # list all gateways
    my $gateways = $fb->gateway->list();

    print $gateways->total . " gateways\n";
    print $gateways->pages . " pages of results\n";

    while ( my $gateway = $gateways->next ) {
        print join( "\t", $gateway->name, $gateway->autobill_capable ) . "\n";
    }

get_all

Returns an ARRAYREF of all possible results, handling pagination for you.

DESCRIPTION

Top

Returns a list of payment gateways enabled in your FreshBooks account that can process credit card transactions. You can optionally filter by autobill_capable to return only gateways that support auto-bills. See http://developers.freshbooks.com/docs/gateway/ for more info.

You should note that there is no "get" method for Gateways as the API does not provide it.

AUTHORS

Top

COPYRIGHT AND LICENSE

Top


Net-FreshBooks-API documentation Contained in the Net-FreshBooks-API distribution.

use strict;
use warnings;

package Net::FreshBooks::API::Gateway;
BEGIN {
  $Net::FreshBooks::API::Gateway::VERSION = '0.21';
}

use Moose;
extends 'Net::FreshBooks::API::Base';

# gateway does not provide "get"
with 'Net::FreshBooks::API::Role::Iterator' => { -excludes => 'get' };

has $_ => ( is => _fields()->{$_}->{is} ) for sort keys %{ _fields() };

sub _fields {
    return {
        name             => { is => 'ro' },
        autobill_capable => { is => 'ro' },
    };
}

__PACKAGE__->meta->make_immutable();

1;

# ABSTRACT: List gateways available in your FreshBooks account


__END__