NAME
Business::Payr::PaymentSession - class representing a Payr payment session returned by the /thirdparty/user-login/ endpoint.
SYNOPSIS
my $Session = $Payr->create_payment_session( '[email protected]' );
# Embed the payment interface in your page
print $Session->iframe_html;
# Or build the URL yourself
my $url = $Session->url;
DESCRIPTION
A Business::Payr::PaymentSession object is returned by "create_payment_session" in Business::Payr. It encapsulates the temporary session URL (valid for 15 minutes) that is used to embed the Payr payment iframe into your platform.
ATTRIBUTES
- url (Str, required)
-
The full iframe URL returned by the
/thirdparty/user-login/endpoint, including the session token and session ID as query parameters. This URL is valid for 15 minutes.Example:
https://sandbox.mypayr.co.uk/third-party?token=abc123&session_id=def456
METHODS
iframe_html
Returns an HTML <iframe> snippet ready to embed in your page. The iframe loads the Payr payment interface at the session URL.
my $html = $Session->iframe_html;
# Override default width / height
my $html = $Session->iframe_html( width => '80%', height => 800 );
Optional keyword arguments:
- width
-
The
widthattribute of the iframe. Defaults to'100%'. - height
-
The
heightattribute of the iframe in pixels. Defaults to700.
Returns a plain string of HTML.
SEE ALSO
AUTHORS
Lee Johnson - leejo@cpan.org
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. If you would like to contribute documentation, features, bug fixes, or anything else then please raise an issue / pull request:
https://github.com/payprop/business-payr