Changeset 3153110
- Timestamp:
- 09/17/2024 08:31:25 AM (19 months ago)
- File:
-
- 1 edited
-
payping-donate/trunk/payping-donate.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
payping-donate/trunk/payping-donate.php
r3151743 r3153110 99 99 wp_send_json_error('مبلغ به درستی وارد نشده است'); 100 100 } 101 101 if ($Name == '') { 102 wp_send_json_error('فیلد نام نمیتواند خالی باشد!'); 103 } 102 104 if ($payPingDonate_Unit == 'ریال') { 103 105 $SendAmount = $Amount / 10; … … 184 186 //////////////////////////////////////////////////// 185 187 /// RESPONSE 186 if (isset($_REQUEST['Status'])) { 187 $id = $_REQUEST['ClientRefId']; 188 $status = $_REQUEST['Status']; 189 190 if ($status == -1) { 188 if (isset($_REQUEST['status'])) { 189 $data = stripslashes($_REQUEST['data']); 190 $newData = json_decode($data, true); 191 $id = $newData['clientRefId']; 192 $status = $_REQUEST['status']; 193 194 if ($status == 0) { 191 195 payPingDonate_ChangeStatus($id, 'ERROR'); 192 196 $error .= esc_html(get_option('payPingDonate_IsError')) . "<br>\r\n"; … … 194 198 payPingDonate_SetAuthority($id, $status); 195 199 } else { 196 $refid = $ _REQUEST['PaymentRefId'];200 $refid = $newData['paymentRefId']; 197 201 $Record = payPingDonate_GetDonate($id); 202 $amount = $newData['amount']; 198 203 if ($Record === false) { 199 204 $error .= 'چنین تراکنشی در سایت ثبت نشده است' . "<br>\r\n"; 200 205 } else { 201 $data = array(' PaymentRefId' => $refid, 'Amount' => $_REQUEST['Amount']);206 $data = array('paymentRefId' => $refid, 'amount' => $amount); 202 207 try { 203 208 $response = wp_remote_post('https://api.payping.ir/v3/pay/verify', array( … … 225 230 if ($status_code == 200) { 226 231 $response_data = json_decode($response_body, true); 227 if (!empty($ _REQUEST["PaymentRefId"])) {232 if (!empty($refid)) { 228 233 payPingDonate_ChangeStatus($id, 'OK'); 229 234 payPingDonate_SetAuthority($id, $refid); … … 231 236 $message .= 'کد پیگیری تراکنش: ' . esc_html($refid) . "<br>\r\n"; 232 237 $payPingDonate_TotalAmount = get_option("payPingDonate_TotalAmount"); 233 update_option("payPingDonate_TotalAmount", $payPingDonate_TotalAmount + $ _REQUEST['Amount']);238 update_option("payPingDonate_TotalAmount", $payPingDonate_TotalAmount + $amount); 234 239 } else { 235 240 payPingDonate_ChangeStatus($id, 'ERROR');
Note: See TracChangeset
for help on using the changeset viewer.