Hello Bod,

is long to read it carefully, so just some notes.

$attrs{'currency'} //= 'GBP'; defined or was intruduced in 5.10.0 so you need use 5.010; in your code and in your Makefile.PL or what you use instead of it. If you want to support older perl versions you need an alternative syntax like:  $attrs{'currency'} = $attrs{'currency'} ? $attrs{'currency'} : 'GBP' ;

my %attrs = @_; you put some type checking some line below. I like it splitted into another, dedicated sub: my %attrs = _check_args(@_); here you can excercise your fantasy at will. Wrong args can be common for a public used module.

Carp is another things I like a lot. Generally a misuse by a module consumer should point to code invoking and provoking the error, not to your module code at line ... Internal errors of your module should be highlighted more carefully, possibly pointing both to your and their code.

Searching for attrs in your code I noticed something strange: your methods get_intent get_intent_id get_ids all starts with my ($self, %attrs) = @_; I do not understand: only get_ids is called with arguments. Then (but I do not looked to it closer) why these attrs are not incapsulated inside the main object?

Internal usage of HTTP_HOST and the alike should be documented. I dont recall the whole thing, but document it. They are always used by every server? Only by some? (I'm not a web expert as you can see ;)

Finally I like your pod because it explains nicely what the matter is: this is a rare quality!

It appears you are using CGI as all your example use it: in 2021 one might expect some example at least in Dancer2

Then, but is my lack of understanding, I dont get why your module ends returning some html. I think you try to explain it in the pod but I dont get it :)

Do you plan to test your module against a live sandbox api? In author tests or during make test aka everytime someone install your module? This can be fun :)

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

In reply to Re: [RFC] Module code and POD for CPAN by Discipulus
in thread [RFC] Module code and POD for CPAN by Bod

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.