From 25c0ed17e95aad626b60bff25d155dce9a454f9e Mon Sep 17 00:00:00 2001 From: "mayur.vachchewar" Date: Tue, 28 Sep 2021 17:27:49 +0530 Subject: [PATCH] gravityform - invoice mapping added --- src/Clients/SdkClient.php | 4 ++++ src/Data/Order.php | 6 ++++++ src/Requests/RequestArg.php | 1 + 3 files changed, 11 insertions(+) diff --git a/src/Clients/SdkClient.php b/src/Clients/SdkClient.php index 70d31bd..464ac02 100644 --- a/src/Clients/SdkClient.php +++ b/src/Clients/SdkClient.php @@ -196,6 +196,10 @@ protected function prepareRequestObjects() if ($this->hasArgument(RequestArg::AUTH_AMOUNT)) { $this->builderArgs['authAmount'] = array($this->getArgument(RequestArg::AUTH_AMOUNT)); } + + if ($this->hasArgument(RequestArg::INVOICE_NUMBER)) { + $this->builderArgs['invoiceNumber'] = array($this->getArgument(RequestArg::INVOICE_NUMBER)); + } } /** diff --git a/src/Data/Order.php b/src/Data/Order.php index c2b9dff..3d35cc1 100644 --- a/src/Data/Order.php +++ b/src/Data/Order.php @@ -56,6 +56,11 @@ class Order */ public $transactionType; + /** + * @var string + */ + public $invoiceNumber; + /** * @return Array */ @@ -72,6 +77,7 @@ public function asArray() RequestArg::REQUEST_MULTI_USE_TOKEN => $this->requestMultiUseToken, RequestArg::SHIPPING_ADDRESS => $this->shippingAddress, RequestArg::TXN_TYPE => $this->transactionType, + RequestArg::INVOICE_NUMBER => $this->invoiceNumber, ); } } diff --git a/src/Requests/RequestArg.php b/src/Requests/RequestArg.php index 33616fa..2bf4387 100644 --- a/src/Requests/RequestArg.php +++ b/src/Requests/RequestArg.php @@ -16,4 +16,5 @@ abstract class RequestArg public const DESCRIPTION = 'DESCRIPTION'; public const AUTH_AMOUNT = 'AUTH_AMOUNT'; public const REQUEST_MULTI_USE_TOKEN = 'REQUEST_MULTI_USE_TOKEN'; + public const INVOICE_NUMBER = 'INVOICE_NUMBER'; }