NAME

Stancer::Device - Device representation

VERSION

version 1.0.0

ATTRIBUTES

city

Read/Write string.

Customer's city.

country

Read/Write string.

Customer's country.

http_accept

Read/Write string.

Customer's browser acceptance.

ip

Read/write IP address.

Customer's IP address.

May be an IPv4 (aka 212.27.48.10) or an IPv6 (2a01:e0c:1::1).

languages

Read/Write string.

Customer's browser accepted languages.

port

Read/Write integer.

Customer's port.

user_agent

Read/Write string.

Customer's browser user agent.

METHODS

Stancer::Device->new() : self

Stancer::Device->new(%args) : self

Stancer::Device->new(\%args) : self

You may not need to create yourself a device instance, it will automatically be created for you.

# Get an empty new device
my $new = Stancer::Device->new();

This object needs a valid IP address (IPv4 or IPv6) ans a valid port, it will automatically used environment variables as created by Apache or nginx (aka SERVER_ADDR and SERVER_PORT).

If variables are not available or if you are using a proxy, you must give IP and port at object instanciation.

my $device = Stancer::Device->new(ip => $ip, port => $port);

Stancer::Device->hydrate_from_env() : self

Hydrate frpm environment.

USAGE

Logging

We use the Log::Any framework for logging events. You may tell where it should log using any available Log::Any::Adapter module.

For example, to log everything to a file you just have to add a line to your script, like this: #! /usr/bin/env perl use Log::Any::Adapter (File => '/var/log/payment.log'); use Stancer::Device;

You must import Log::Any::Adapter before our libraries, to initialize the logger instance before use.

You can choose your log level on import directly: use Log::Any::Adapter (File => '/var/log/payment.log', log_level => 'info');

Read the Log::Any documentation to know what other options you have.

SECURITY

  • Never, never, NEVER register a card or a bank account number in your database.

  • Always uses HTTPS in card/SEPA in communication.

  • Our API will never give you a complete card/SEPA number, only the last four digits. If you need to keep track, use these last four digit.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Stancer or by email to bug-stancer@rt.cpan.org.

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

AUTHOR

Joel Da Silva <jdasilva@corp.free.fr>

COPYRIGHT AND LICENSE

This software is Copyright (c) 2018 by Iliad78.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)