fix recharge
This commit is contained in:
parent
061224b469
commit
b6204a5f94
@ -9,6 +9,14 @@ use PEAR2\Net\RouterOS;
|
|||||||
|
|
||||||
class Package
|
class Package
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @param int $id_customer String user identifier
|
||||||
|
* @param string $router_name router name for this package
|
||||||
|
* @param int $plan_id plan id for this package
|
||||||
|
* @param string $gateway payment gateway name
|
||||||
|
* @param string $channel channel payment gateway
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
|
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
|
||||||
{
|
{
|
||||||
global $_c, $_L;
|
global $_c, $_L;
|
||||||
|
@ -139,7 +139,7 @@ function duitku_get_status($trx, $user)
|
|||||||
if ($result['statusCode'] == '01') {
|
if ($result['statusCode'] == '01') {
|
||||||
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
|
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
|
||||||
} else if ($result['statusCode'] == '00' && $trx['status'] != 2) {
|
} else if ($result['statusCode'] == '00' && $trx['status'] != 2) {
|
||||||
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_method'] . ' ' . $result['payment_channel'])) {
|
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $trx['payment_channel'])) {
|
||||||
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
|
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ function tripay_get_status($trx, $user)
|
|||||||
if ($result['status'] == 'UNPAID') {
|
if ($result['status'] == 'UNPAID') {
|
||||||
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
|
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
|
||||||
} else if (in_array($result['status'], ['PAID', 'SETTLED']) && $trx['status'] != 2) {
|
} else if (in_array($result['status'], ['PAID', 'SETTLED']) && $trx['status'] != 2) {
|
||||||
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_method'] . ' ' . $result['payment_channel'])) {
|
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_name'])) {
|
||||||
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
|
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,7 +107,7 @@ function xendit_get_status($trx, $user)
|
|||||||
if ($result['status'] == 'PENDING') {
|
if ($result['status'] == 'PENDING') {
|
||||||
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
|
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
|
||||||
} else if (in_array($result['status'], ['PAID', 'SETTLED']) && $trx['status'] != 2) {
|
} else if (in_array($result['status'], ['PAID', 'SETTLED']) && $trx['status'] != 2) {
|
||||||
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_method'] . ' ' . $result['payment_channel'])) {
|
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_channel'])) {
|
||||||
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
|
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
|
||||||
}
|
}
|
||||||
$trx->pg_paid_response = json_encode($result);
|
$trx->pg_paid_response = json_encode($result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user