Online...:HTTPS(3pm)

πŸ“¦
version 3.05 Β· 2 versions
  • 3.05 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 3.05 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Business::OnlinePayment::HTTPS β€” the base class for HTTPS payment APIs, bestie. It's giving "mom friend of the payment modules." πŸ‘‘


✨ SYNOPSIS ✨

okay so picture this, you're writing your own processor subclass and you're like "how do I even":

package Business::OnlinePayment::MyProcessor;
use base qw(Business::OnlinePayment::HTTPS);

sub submit {
    my $self = shift;

    #...

    # pass a list (order is preserved, if your gateway needs that)
    ( $page, $response, %reply_headers )
        = $self->https_get( field => 'value', ... );

    # or a hashref
    my %hash = ( field => 'value', ... );
    ( $page, $response_code, %reply_headers )
          = $self->https_get( \%hash );

    #...
}

like. that's it. that's the whole vibe. πŸ¦‹


🌸 DESCRIPTION 🌸

This is a base class for HTTPS based gateways, and it hands you useful code if you're out here implementing HTTPS payment APIs. no cap. πŸ’…

It depends on Net::HTTPS::Any, which in turn depends on Net::SSLeay _or_ ( Crypt::SSLeay and LWP::UserAgent ). yes it's dependencies all the way down, we don't make the rules 😭


πŸŽ€ METHODS πŸŽ€

https_get [ \%options ] HASHREF | FIELD => VALUE, ...

okay so she takes parameters as either a hashref or a list of fields and values. If you go the list route, the ordering is preserved β€” and if you want that same ordering while passing a hashref, go look at Tie::IxHash, it's the plug 🫢

She returns a list made of:

  • the page content as a string πŸ“
  • the HTTP response code and message (i.e. "200 OK" or "404 Not Found")
  • a list of key/value pairs representing the HTTP response headers

The options hashref supports setting headers, like so:

{
    headers => { 'X-Header1' => 'value', ... },
}

https_post [ \%options ] SCALAR | HASHREF | FIELD => VALUE, ...

Same energy, but she accepts form fields and values as either a hashref or a list. List mode? ordering preserved. Hashref mode? again, Tie::IxHash is your bestie for that. πŸ’œ

She also accepts, instead of all that, a simple scalar containing the raw content. versatile queen. πŸ‘‘

Returns a list consisting of:

  • the page content as a string
  • the HTTP response code and message (i.e. "200 OK" or "404 Not Found")
  • a list of key/value pairs representing the HTTP response headers

The options hashref supports setting headers and Content-Type:

{
    headers => { 'X-Header1' => 'value', ... },
    Content-Type => 'text/namevalue',
}

🌈 SEE ALSO 🌈

  • Business::OnlinePayment
  • Net::HTTPS::Any

okay that's the whole page, you ate that, go build a payment gateway or whatever πŸ’…βœ¨

this was Online...:HTTPS(3pm), User Contributed Perl Documentation, from perl v5.36.0, dated 2023-01-22. mwah, ily, go read the source bestie πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from