Net::FreshBooks::API::Payment - FreshBooks Payment access


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

Index


Code Index:

NAME

Top

Net::FreshBooks::API::Payment - FreshBooks Payment access

VERSION

Top

version 0.21

SYNOPSIS

Top

    my $fb = Net::FreshBooks::API->new({ ... });
    my $payment = $fb->payment;

create

Create a new payment in the FreshBooks system

    my $payment = $fb->payment->create({...});

delete

    my $payment = $fb->payment->get({ payment_id => $payment_id });
    $payment->delete;

get

    my $payment = $fb->payment->get({ payment_id => $payment_id });

update

    $payment->notes('Payment Refunded.');
    $payment->update;

    # or more directly
    $client->update( { notes => 'Payment refunded' } );

list

Returns a Net::FreshBooks::API::Iterator object.

    my $payments = $fb->payment->list;
    while ( my $payment = $payments->list ) {
        print $payment->payment_id, "\n";
    }

DESCRIPTION

Top

This class gives you object to FreshBooks payment information. Net::FreshBooks::API will construct this object for you.

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::Payment;
BEGIN {
  $Net::FreshBooks::API::Payment::VERSION = '0.21';
}

use Moose;
extends 'Net::FreshBooks::API::Base';
with 'Net::FreshBooks::API::Role::CRUD';

use Net::FreshBooks::API::Links;

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

sub _fields {
    return {
        payment_id    => { is => 'ro' },
        client_id     => { is => 'rw' },
        invoice_id    => { is => 'rw' },
        date          => { is => 'rw' },
        amount        => { is => 'rw' },
        currency_code => { is => 'rw' },
        type          => { is => 'rw' },
        notes         => { is => 'rw' },
        updated       => { is => 'ro' },
    };
}

__PACKAGE__->meta->make_immutable();

1;

# ABSTRACT: FreshBooks Payment access


__END__