From df834622d05070ab3fa6fecda91910f9a1631742 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Re=C3=BCel=20van=20der=20Steege?= Date: Thu, 8 Aug 2024 10:10:34 +0200 Subject: [PATCH] Add plugin information to `RedirectTransactionRequestMessage`. --- src/XML/RedirectTransactionRequestMessage.php | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/XML/RedirectTransactionRequestMessage.php b/src/XML/RedirectTransactionRequestMessage.php index 9fe9f13..12de411 100644 --- a/src/XML/RedirectTransactionRequestMessage.php +++ b/src/XML/RedirectTransactionRequestMessage.php @@ -48,6 +48,26 @@ public function __construct( $merchant, $customer, $transaction ) { public function get_document() { $document = parent::get_document(); + // Plugin - Information about your integration (useful for debugging). + $plugin = XML_Util::add_element( $document, $document->documentElement, 'plugin' ); + + XML_Util::add_elements( + $document, + $plugin, + [ + // The name of your ecommerce application. + 'shop' => 'WordPress - Pronamic Pay', + // The version of your ecommerce application. + 'shop_version' => \get_bloginfo( 'version' ), + // The version of your integration. + 'plugin_version' => \pronamic_pay_plugin()->get_version(), + // The name of the third party that developed the ecommerce application (if relevant). + 'partner' => 'Pronamic', + // The root/base URL of the ecommerce application. + 'shop_root_url' => \get_bloginfo( 'url' ), + ] + ); + // Merchant. $merchant = XML_Util::add_element( $document, $document->documentElement, 'merchant' );