Skip to content

smartexio/smartex-perl-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Using the Smartex Perl Client Library

Prerequisites

You must have a Smartex merchant account to use this library. It's free to sign-up for a Smartex merchant account.

Once you have a Smartex merchant account, you will need a working Smartex Access Token – this can be done either via the library or manually in the Smartex Dashboard.

Quick Start

use Business::Smartex;
my $smartex = Business::Smartex->new($api_key);

# create new invoice
$invoice = $smartex->create_invoice(price => 10, currency => 'USD');

# get invoice data
$invoice = $smartex->get_invoice($invoice->{id});

New Object Creation

my $smartex = Business::Smartex->new($api_key);

Construct Business::Smartex object.

Creating an Invoice

my $invoice = $smartex->create_invoice(price => 10, currency => 'USD');

Creates new invoice. This method will croak in case of error. Full list of fields and their description can be found in C section of Smartex API documentation.

Returns hashref representing of the invoice object. Description can be found in C section of the Smartex API documentation.

Retrieving an Invoice

my $invoice = $smartex->get_invoice($invoice_id);

Returns invoice hashref or croak if error occurred. Returned invoice object has exactly the same format as that which is returned when creating an invoice.

Releases

No releases published

Packages

No packages published

Languages