$data = PaypalAPI::execute_post($url, array(), $credentials, $method); if ($data['ACK'] == 'Failure') { echo returnErrorMsgWithHeader($data['L_SHORTMESSAGE0'], $data['L_LONGMESSAGE0']); } else { if ($data['ACK'] == 'Success') { echo returnSuccessMsgWithHeader("Your Available Balance", $data['L_CURRENCYCODE0'] . " " . $data['L_AMT0']); $_credentials = Paypal::newInstance()->selectPaypalData(); if ($_credentials == null) { Paypal::newInstance()->insertPaypalData($username, $password, $signature, $url); } else { Paypal::newInstance()->updatePaypalData($username, $password, $signature, $url, $enable, $_credentials['pk_pp_username']); } } } } $_credentials = Paypal::newInstance()->selectPaypalData(); $username = null; $password = null; $signature = null; $url = null; if ($_credentials != null) { $username = $_credentials['pk_pp_username']; $password = $_credentials['pp_password']; $signature = $_credentials['pp_signature']; $url = $_credentials['pp_server']; $enable = $_credentials['pp_status']; if ($enable == TRUE) { $checked = "checked"; } else { $checked = ""; }