Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
= 1.5.2 = Send item details to the gateway

= 1.5.3 =
- Removed branded sellix checkout URL
- Added Multi-shop sellix account header authorization
21 changes: 17 additions & 4 deletions modules/gateways/sellixpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function sellixpay_MetaData()
{
return array(
'DisplayName' => 'Sellix Pay',
'APIVersion' => '1.5.2',
'APIVersion' => '1.5.3',
'DisableLocalCredtCardInput' => false,
'TokenisedStorage' => false,
);
Expand All @@ -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' => '<br/>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',
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion modules/gateways/sellixpay/whmcs.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"schema": "1.5.2",
"schema": "1.5.3",
"type": "whmcs-gateways",
"name": "sellixpay",
"license": "MIT",
Expand Down
Binary file removed whmcs-sellixpay-1.2.zip
Binary file not shown.
Binary file removed whmcs-sellixpay.zip
Binary file not shown.