-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ionutcalara/master
Renamed main plugin, added default order statuses
- Loading branch information
Showing
21 changed files
with
262 additions
and
240 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* @copyright 2019 Paylike.com. | ||
* @author Panos <[email protected]> | ||
* @copyright 2019 Paylike.io. | ||
* @author Panos <[email protected]> | ||
* Date: 17/9/2019 | ||
* Time: 11:28 πμ | ||
*/ | ||
|
@@ -34,15 +34,14 @@ public function capture(&$order_info, $txnId) { | |
$pp_response['reason_text'] = $message; | ||
$update = true; | ||
} elseif ( ! empty( $capture['transaction'] ) ) { | ||
$message = __('sl_paylike.trx_id').':' . $txnId . | ||
__('sl_paylike.authorized_amount').':' . ( $capture['transaction']['amount'] / $currency_multiplier ) . | ||
__('sl_paylike.captured_amount').':'. ( $capture['transaction']['capturedAmount'] / $currency_multiplier ) . | ||
__('sl_paylike.order_time').':'. $capture['transaction']['created'] . | ||
__('sl_paylike.currency_code').':'. $capture['transaction']['currency']; | ||
$pp_response['reason_text'] = $message; | ||
$pp_response['reason_text'] = __("captured"); | ||
$pp_response['transaction_id'] = $txnId; | ||
$pp_response['captured'] = 'Y'; | ||
$pp_response['kp_paylike.order_time'] = kp_paylike_datetime_to_human($capture['transaction']['created']); | ||
$pp_response['kp_paylike.currency_code'] = $capture['transaction']['currency']; | ||
$pp_response['kp_paylike.authorized_amount'] = ( $capture['transaction']['amount'] / $currency_multiplier ); | ||
$pp_response['amount_capt'] = $capture['transaction']['capturedAmount'] / $currency_multiplier ; | ||
$pp_response['captured'] = 'Y'; | ||
array_filter($pp_response); | ||
$update = true; | ||
} | ||
if($update) { | ||
|
@@ -70,17 +69,16 @@ public function refund(&$order_info, $txnId, $amount) { | |
$pp_response['reason_text'] = $message; | ||
$update = true; | ||
} elseif ( ! empty( $capture['transaction'] ) ) { | ||
$message = __('sl_paylike.trx_id').':' . $txnId . | ||
__('sl_paylike.authorized_amount').':' . ( $capture['transaction']['amount'] / $currency_multiplier ) . | ||
__('sl_paylike.captured_amount').':'. ( $capture['transaction']['capturedAmount'] / $currency_multiplier ) . | ||
__('sl_paylike.refunded_amount').':'. ( $capture['transaction']['refundedAmount'] / $currency_multiplier ) . | ||
__('sl_paylike.order_time').':'. $capture['transaction']['created'] . | ||
__('sl_paylike.currency_code').':'. $capture['transaction']['currency']; | ||
$pp_response['reason_text'] = $message; | ||
$pp_response['reason_text'] = __("refunded"); | ||
$pp_response['transaction_id'] = $txnId; | ||
$pp_response['captured'] = 'Y'; | ||
$pp_response['kp_paylike.order_time'] = kp_paylike_datetime_to_human($capture['transaction']['created']); | ||
$pp_response['kp_paylike.currency_code'] = $capture['transaction']['currency']; | ||
$pp_response['kp_paylike.authorized_amount'] = ( $capture['transaction']['amount'] / $currency_multiplier ); | ||
$pp_response['amount_capt'] = $capture['transaction']['capturedAmount'] / $currency_multiplier ; | ||
$pp_response['amount_refu'] = $capture['transaction']['refundedAmount'] / $currency_multiplier ; | ||
$pp_response['captured'] = 'Y'; | ||
$pp_response['refunded'] = 'Y'; | ||
array_filter($pp_response); | ||
$update = true; | ||
} | ||
if($update) { | ||
|
@@ -109,16 +107,14 @@ public function void(&$order_info, $txnId) { | |
$pp_response['reason_text'] = $message; | ||
$update = true; | ||
} elseif ( ! empty( $capture['transaction'] ) ) { | ||
$message = __('sl_paylike.trx_id').':' . $txnId . | ||
__('sl_paylike.captured_amount').':'. ( $capture['transaction']['capturedAmount'] / $currency_multiplier ) . | ||
' Void Amount: ' . ( $capture['transaction']['voidedAmount'] / $currency_multiplier ) . | ||
__('sl_paylike.order_time').':'. $capture['transaction']['created'] . | ||
__('sl_paylike.currency_code').':'. $capture['transaction']['currency']; | ||
$pp_response['reason_text'] = $message; | ||
$pp_response['reason_text'] = __("voided"); | ||
$pp_response['transaction_id'] = $txnId; | ||
$pp_response['captured'] = 'N'; | ||
$pp_response['kp_paylike.order_time'] = kp_paylike_datetime_to_human($capture['transaction']['created']); | ||
$pp_response['kp_paylike.currency_code'] = $capture['transaction']['currency']; | ||
$pp_response['voided_amount'] = $capture['transaction']['voidedAmount'] / $currency_multiplier ; | ||
$pp_response['captured'] = 'N'; | ||
$pp_response['voided'] = 'Y'; | ||
array_filter($pp_response); | ||
$update = true; | ||
} | ||
if($update) { | ||
|
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...pp/addons/sl_paylike/Paylike/Currency.php → ...pp/addons/kp_paylike/Paylike/Currency.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* @copyright 2019 Paylike.com. | ||
* @author Panos <[email protected]> | ||
* @copyright 2019 Paylike.io. | ||
* @author Panos <[email protected]> | ||
* Date: 17/9/2019 | ||
* Time: 10:17 πμ | ||
*/ | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<addon scheme="3.0"> | ||
<id>sl_paylike</id> | ||
<id>kp_paylike</id> | ||
<name>Paylike.io payment gateway</name> | ||
<version>1.0</version> | ||
<version>1.1</version> | ||
<priority>5200</priority> | ||
<position>0</position> | ||
<default_language>en</default_language> | ||
<auto_install>MULTIVENDOR</auto_install> | ||
<status>active</status> | ||
<supplier>paylike.io</supplier> | ||
<supplier_link>https://paylike.io</supplier_link> | ||
<supplier>Paylike.io</supplier> | ||
<supplier_link>http://Paylike.io</supplier_link> | ||
<author> | ||
<name>CS-Cart.in</name> | ||
<url>http://cs-cart.in</url> | ||
<name>Paylike.io</name> | ||
<url>http://Paylike.io</url> | ||
<email>[email protected]</email> | ||
</author> | ||
<queries> | ||
|
@@ -21,6 +21,6 @@ | |
</item> | ||
</queries> | ||
<functions> | ||
<item for="uninstall">sl_paylike_delete_payment_processors</item> | ||
<item for="uninstall">kp_paylike_delete_payment_processors</item> | ||
</functions> | ||
</addon> |
4 changes: 2 additions & 2 deletions
4
...l_paylike/controllers/backend/paylike.php → ...p_paylike/controllers/backend/paylike.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* @copyright 2019 Paylike.com. | ||
* @author Panos <[email protected]> | ||
* @copyright 2019 Paylike.io. | ||
* @author Panos <[email protected]> | ||
* Date: 17/9/2019 | ||
* Time: 12:26 μμ | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
<?php | ||
/** | ||
* @copyright 2019 Paylike.io. | ||
* @author Panos <[email protected]> | ||
* @author Panos <[email protected]> | ||
* Date: 16/9/2019 | ||
* Time: 10:10 πμ | ||
*/ | ||
use Tygh\Registry; | ||
|
||
function sl_paylike_currencies() { | ||
function kp_paylike_currencies() { | ||
return \Paylike\Currency::getCurrenciesList(); | ||
} | ||
|
||
function sl_paylike_get_order_statuses_list() { | ||
function kp_paylike_get_order_statuses_list() { | ||
$statuses = fn_get_statuses(); | ||
$data = array(); | ||
foreach ($statuses as $k => $status) { | ||
|
@@ -19,7 +20,7 @@ function sl_paylike_get_order_statuses_list() { | |
return $data; | ||
} | ||
|
||
function fn_sl_paylike_change_order_status($status_to, $status_from, &$order_info, $force_notification, $order_statuses, $place_order) { | ||
function fn_kp_paylike_change_order_status($status_to, $status_from, &$order_info, $force_notification, $order_statuses, $place_order) { | ||
$doCapture = false; | ||
$doVoid = false; | ||
$txnId = false; | ||
|
@@ -51,7 +52,7 @@ function fn_sl_paylike_change_order_status($status_to, $status_from, &$order_inf | |
} | ||
} | ||
|
||
function sl_paylike_can_refund_order($order_info) { | ||
function kp_paylike_can_refund_order($order_info) { | ||
$out = false; | ||
if($order_info['payment_method']['processor']=='Paylike') { | ||
$captured = !empty($order_info['payment_info']['captured']) ? $order_info['payment_info']['captured'] : 'Y'; | ||
|
@@ -66,8 +67,17 @@ function sl_paylike_can_refund_order($order_info) { | |
return $out; | ||
} | ||
|
||
function sl_paylike_delete_payment_processors() | ||
function kp_paylike_delete_payment_processors() | ||
{ | ||
db_query("UPDATE ?:payments SET processor_id = 0, processor_params='', status='D' WHERE processor_id IN (SELECT processor_id FROM ?:payment_processors WHERE processor_script IN ('paylike.php'))"); | ||
db_query("DELETE FROM ?:payment_processors WHERE processor_script IN ('paylike.php')"); | ||
db_query("UPDATE ?:payments SET processor_id = 0, processor_params='', status='D' WHERE processor_id IN (SELECT processor_id FROM ?:payment_processors WHERE processor_script IN ('paylike.php'))"); | ||
db_query("DELETE FROM ?:payment_processors WHERE processor_script IN ('paylike.php')"); | ||
} | ||
|
||
function kp_paylike_datetime_to_human($dt) { | ||
$t = strtotime($dt); | ||
$out = sprintf("%s %s", | ||
fn_date_format($t,Registry::get('settings.Appearance.date_format')), | ||
fn_date_format($t,Registry::get('settings.Appearance.time_format')) | ||
); | ||
return $out; | ||
} |
4 changes: 2 additions & 2 deletions
4
...aylike/src/app/addons/sl_paylike/init.php → ...aylike/src/app/addons/kp_paylike/init.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* @copyright 2019 Paylike.com. | ||
* @author Panos <[email protected]> | ||
* @copyright 2019 Paylike.io. | ||
* @author Panos <[email protected]> | ||
* Date: 17/9/2019 | ||
* Time: 11:17 πμ | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<?php | ||
/** | ||
* @copyright 2019 Paylike.com. | ||
* @author Panos <[email protected]> | ||
* @copyright 2019 Paylike.io. | ||
* @author Panos <[email protected]> | ||
* Date: 16/9/2019 | ||
* Time: 9:48 πμ | ||
*/ | ||
|
@@ -46,19 +46,16 @@ | |
elseif ( is_array( $fetch ) && $fetch['transaction']['custom']['order_id']==$order_id) { | ||
$total = $fetch['transaction']['amount'] / $currency_multiplier; | ||
$amount = $fetch['transaction']['amount']; | ||
|
||
$message = __('sl_paylike.trx_id').': ' . $txnId . | ||
' '.__('sl_paylike.authorized_amount').': ' . ( $fetch['transaction']['amount'] / $currency_multiplier ) . | ||
' '.__('sl_paylike.captured_amount').': ' . ( $fetch['transaction']['capturedAmount'] / $currency_multiplier ) . | ||
' '.__('sl_paylike.order_time').': ' . $fetch['transaction']['created'] . | ||
' '.__('sl_paylike.currency_code').': ' . $fetch['transaction']['currency']; | ||
$pp_response['order_status'] = $processor_data['processor_params']['delayed_status']; | ||
$pp_response['amount_auth'] = $fetch['transaction']['amount'] / $currency_multiplier ; | ||
$pp_response['amount_capt'] = $fetch['transaction']['capturedAmount'] / $currency_multiplier ; | ||
$pp_response['amount_refu'] = 0; | ||
$pp_response['reason_text'] = $message; | ||
|
||
$pp_response['reason_text'] = __("delayed"); | ||
$pp_response['transaction_id'] = $txnId; | ||
$pp_response['kp_paylike.order_time'] = kp_paylike_datetime_to_human($fetch['transaction']['created']); | ||
$pp_response['kp_paylike.currency_code'] = $fetch['transaction']['currency']; | ||
$pp_response['amount_auth'] = $fetch['transaction']['amount'] / $currency_multiplier ; | ||
//$pp_response['amount_capt'] = $fetch['transaction']['capturedAmount'] / $currency_multiplier ; | ||
$pp_response['captured'] = 'N'; | ||
array_filter($pp_response); | ||
} | ||
} else { | ||
|
||
|
@@ -73,19 +70,15 @@ | |
$pp_response['order_status'] = 'F'; | ||
$pp_response['reason_text'] = $message; | ||
} elseif ( ! empty( $capture['transaction'] ) ) { | ||
|
||
$message = __('sl_paylike.trx_id'). ': ' . $txnId . | ||
' '.__('sl_paylike.authorized_amount').': ' . ( $capture['transaction']['amount'] / $currency_multiplier ) . | ||
' '.__('sl_paylike.captured_amount').': ' . ( $capture['transaction']['capturedAmount'] / $currency_multiplier ) . | ||
' '.__('sl_paylike.order_time').': ' . $capture['transaction']['created'] . | ||
' '.__('sl_paylike.currency_code').': ' . $capture['transaction']['currency']; | ||
$pp_response['order_status'] = 'P'; | ||
$pp_response['reason_text'] = __("captured"); | ||
$pp_response['transaction_id'] = $txnId; | ||
$pp_response['kp_paylike.order_time'] = kp_paylike_datetime_to_human($capture['transaction']['created']); | ||
$pp_response['kp_paylike.currency_code'] = $capture['transaction']['currency']; | ||
$pp_response['amount_auth'] = $capture['transaction']['amount'] / $currency_multiplier ; | ||
$pp_response['amount_capt'] = $capture['transaction']['capturedAmount'] / $currency_multiplier ; | ||
$pp_response['amount_refu'] = 0; | ||
$pp_response['reason_text'] = $message; | ||
$pp_response['transaction_id'] = $txnId; | ||
$pp_response['captured'] = 'Y'; | ||
array_filter($pp_response); | ||
} else { | ||
$transaction_failed = true; | ||
} | ||
|
@@ -125,12 +118,12 @@ | |
]; | ||
$view->assign('customer', $customer); | ||
$platform = [ | ||
'name' => PRODUCT_NAME, | ||
'name' => 'CS-CART ' . PRODUCT_NAME, | ||
'version' => PRODUCT_VERSION, | ||
'addon_name' => 'Paylike addon', | ||
'addon_version' => fn_get_addon_version('sl_paylike'), | ||
'addon_name' => 'Paylike.io CS-Cart Kit', | ||
'addon_version' => fn_get_addon_version('kp_paylike'), | ||
]; | ||
$view->assign('platform', $platform); | ||
$view->display('addons/sl_paylike/components/payment_page.tpl'); | ||
$view->display('addons/kp_paylike/components/payment_page.tpl'); | ||
die(1); | ||
} |
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
...aylike/hooks/orders/payment_info.post.tpl → ...aylike/hooks/orders/payment_info.post.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{if sl_paylike_can_refund_order($order_info)} | ||
{if kp_paylike_can_refund_order($order_info)} | ||
|
||
<a class="btn cm-dialog-opener cm-ajax" | ||
href="{"paylike.refund?order_id=`$order_info.order_id`"|fn_url}" | ||
data-ca-dialog-title="Refund" | ||
>{__("sl_paylike.refund")}</a> | ||
>{__("kp_paylike.refund")}</a> | ||
{/if} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.