diff --git a/README.md b/README.md index b8b26db..4f016b7 100644 --- a/README.md +++ b/README.md @@ -48,4 +48,8 @@ WHMCS module to use Sellix as a Payment Gateway. - First created sellix invoice url will be used as before. - But now we made changes to the code that, if an invoice email, currency, or amount changed, then new sellix invoice is created with new customer and payment details instead of previously created sellix invoice url. -= 1.5.2 = Send item details to the gateway \ No newline at end of file += 1.5.2 = Send item details to the gateway + += 1.5.3 = +- Removed branded sellix checkout URL +- Added Multi-shop sellix account header authorization \ No newline at end of file diff --git a/modules/gateways/sellixpay.php b/modules/gateways/sellixpay.php index 5855d21..173be15 100644 --- a/modules/gateways/sellixpay.php +++ b/modules/gateways/sellixpay.php @@ -23,7 +23,7 @@ function sellixpay_MetaData() { return array( 'DisplayName' => 'Sellix Pay', - 'APIVersion' => '1.5.2', + 'APIVersion' => '1.5.3', 'DisableLocalCredtCardInput' => false, 'TokenisedStorage' => false, ); @@ -50,10 +50,18 @@ function sellixpay_config() 'Type' => 'text', 'Description' => 'Please enter your Sellix API Key', ), - 'url_branded' => array( + /*'url_branded' => array( 'FriendlyName' => 'Branded URL', 'Type' => 'yesno', 'Description' => 'If this is enabled, customer will be redirected to your branded sellix pay checkout url', + ),*/ + 'x_merchant' => array( + 'FriendlyName' => 'X-Sellix-Merchant', + 'Type' => 'text', + 'Description' => '
If you have more than one shop (merchant) under your Sellix account, + you can send API requests with their authorization by passing theX-Sellix-Merchant header to each request. + For example if your Sellix account has two merchants (1. Jack, 2. James) and you want to make API requests as James, + you need to pass the X-Sellix-Merchant header with value James to able to authenticate as different stores.', ), 'order_prefix' => array( 'FriendlyName' => 'Order/Invoice ID Prefix', @@ -298,11 +306,11 @@ function generateSellixPayment($configParams) } $url = $responseDecode['data']['url']; - if ($configParams['url_branded'] == 'on') { + /*if ($configParams['url_branded'] == 'on') { if (isset($responseDecode['data']['url_branded'])) { $url = $responseDecode['data']['url_branded']; } - } + }*/ return $url; } else { @@ -408,6 +416,11 @@ function sellixPostAuthenticatedJsonRequest($params, $route, $body = false, $ext 'Authorization: Bearer ' . $apiKey ]; + $x_merchant = trim($params['x_merchant']); + if (!empty($x_merchant)) { + $headers[] = 'X-Sellix-Merchant: '.$x_merchant; + } + if ($extra_headers && is_array($extra_headers)) { $headers = array_merge($headers, $extra_headers); } diff --git a/modules/gateways/sellixpay/whmcs.json b/modules/gateways/sellixpay/whmcs.json index ba1d52c..752c06a 100644 --- a/modules/gateways/sellixpay/whmcs.json +++ b/modules/gateways/sellixpay/whmcs.json @@ -1,5 +1,5 @@ { - "schema": "1.5.2", + "schema": "1.5.3", "type": "whmcs-gateways", "name": "sellixpay", "license": "MIT", diff --git a/whmcs-sellixpay-1.2.zip b/whmcs-sellixpay-1.2.zip deleted file mode 100644 index d0c33d8..0000000 Binary files a/whmcs-sellixpay-1.2.zip and /dev/null differ diff --git a/whmcs-sellixpay.zip b/whmcs-sellixpay.zip deleted file mode 100644 index 2d44c1c..0000000 Binary files a/whmcs-sellixpay.zip and /dev/null differ