Changeset 2615350
- Timestamp:
- 10/17/2021 10:06:58 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gateway-payping-easy-digital-downloads/trunk/gateways/payping.php
r2615295 r2615350 13 13 $message = json_encode( $object, JSON_UNESCAPED_UNICODE ); 14 14 $label = "Debug".($label ? " ($label): " : ': '); 15 $console_log = esc_html("<script>console.log(\"$label\", $message);</script>"); 16 echo $console_log; 15 echo sprintf("<script>console.warn(\"%s\", %s);</script>", esc_html($label), esc_html($messages)); 17 16 file_put_contents(EDD_GPPDIR.'/log_payping.txt', $label."\n".$message."\n\n", FILE_APPEND); 18 17 } … … 136 135 unset( $_SESSION['pp_payment'] ); 137 136 if ( ! $payment ) { 138 wp_die( 'رکورد پرداخت موردنظر وجود ندارد!');137 $payment = edd_get_payment( sanitize_text_field( $_GET['clientrefid'] ) ); 139 138 } 140 139 if ( $payment->status == 'complete' ) return false; … … 147 146 148 147 $data = array( 149 'amount' => $amount,148 'amount' => $amount, 150 149 'refId' => $refid 151 150 ) ; … … 180 179 $Fault = 'wp-remote Error.'; 181 180 $Message = 'خطا در ارتباط به پیپینگ : شرح خطا '.$payping_id_request; 182 }else{ 181 }else{ 183 182 $code = wp_remote_retrieve_response_code( $response ); 184 if ( $code == =200 ) {183 if ( $code == 200 ) { 185 184 if (isset($refid) and $refid != '') { 186 edd_insert_payment_note( $payment->ID, 'شماره تراکنش بانکی: '.$refid );185 edd_insert_payment_note( $payment->ID, 'شماره تراکنش: '.$refid ); 187 186 edd_update_payment_meta( $payment->ID, 'payping_refid', $refid ); 188 187 edd_update_payment_status( $payment->ID, 'publish' ); … … 196 195 } 197 196 }else{ 197 198 198 $Message = wp_remote_retrieve_response_message( $response ); 199 199 edd_insert_payment_note( $payment->ID, $Message ); … … 201 201 edd_update_payment_status( $payment->ID, 'failed' ); 202 202 wp_redirect( get_permalink( $edd_options['failure_page'] ) ); 203 exit; 203 204 } 204 205 } … … 216 217 $refid = edd_get_payment_meta( $payment->ID, 'payping_refid' ); 217 218 if ( $refid ) { 218 $res_refid = esc_html('<tr class="payping-ref-id-row ezp-field ehsaan-me"><td><strong>شماره تراکنش بانکی:</strong></td><td>'.$refid.'</td></tr>'); 219 echo $res_refid; 219 echo sprintf('<tr class="payping-ref-id-row epp-field ehsaan-me"><td><strong>شماره تراکنش بانکی:</strong></td><td>%s</td></tr>', esc_attr($refid)); 220 220 } 221 221 }
Note: See TracChangeset
for help on using the changeset viewer.