Advertisement
Guest User

Untitled

a guest
Jul 30th, 2020
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP7 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 4.1.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 15.05.2020
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. function _get_status($url, $app, $servername, $domain)
  15. {
  16. $cURL = curl_init();
  17. curl_setopt_array($cURL, [
  18. CURLOPT_RETURNTRANSFER => 1,
  19. CURLOPT_SSL_VERIFYPEER => false,
  20. CURLOPT_SSL_VERIFYHOST => false,
  21. CURLOPT_URL => $url,
  22. CURLOPT_USERAGENT => 'cURL Request',
  23. CURLOPT_POST => 1,
  24. CURLOPT_POSTFIELDS => ['app' => $app, 'domain' => $domain, 'server' => $servername, 'ip' => $_SERVER['REMOTE_ADDR']]
  25. ]);
  26. $result = curl_exec($cURL);
  27. $erro = '';
  28.  
  29. if ($result === false) {
  30. $erro = curl_error($cURL);
  31. }
  32.  
  33. $response = curl_getinfo($cURL, CURLINFO_HTTP_CODE);
  34. $result = json_decode($result);
  35. curl_close($cURL);
  36. return (object) ['response' => $response, 'result' => $result, 'erro' => $erro];
  37. }
  38.  
  39. function faturaMP($mp_data, $obj)
  40. {
  41. $itens_p = [];
  42. $items_mp = [];
  43. $obj->select()->from('lista')->where('lista_pedido = ' . $obj->pedido_id)->execute();
  44.  
  45. if ($obj->result()) {
  46. $obj->cut('lista_title', 60, '...');
  47. $itens = $obj->data;
  48.  
  49. foreach ($itens as $i) {
  50. $obj->map($i);
  51. $obj->lista_preco = preg_replace('/\\,/', '', $obj->lista_preco);
  52. $itens_p['id'] = $obj->lista_item;
  53. $itens_p['title'] = (string) $obj->lista_title;
  54. $itens_p['quantity'] = $obj->lista_qtde;
  55. $itens_p['description'] = (string) $obj->lista_title;
  56. $itens_p['category_id'] = 'Produtos';
  57. $itens_p['unit_price'] = $obj->lista_preco;
  58. $items_mp[] = $itens_p;
  59. }
  60. }
  61.  
  62. $cli_zip = str_replace('-', '', $obj->endereco_cep);
  63. $cliente_email = $obj->cliente_email;
  64. $cli_rua = $obj->endereco_rua;
  65. $cli_num = $obj->endereco_num;
  66. if (isset($_POST['cardholderName']) && !empty($_POST['cardholderName'])) {
  67. $cliente_full = explode(' ', $_POST['cardholderName']);
  68. if (isset($cliente_full[0]) && !empty($cliente_full[0])) {
  69. $cliente_nome = $cliente_full[0];
  70. }
  71. else {
  72. $cliente_nome = '';
  73. }
  74. if (isset($cliente_full[1]) && !empty($cliente_full[1])) {
  75. $cliente_sobrenome = $cliente_full[1];
  76. }
  77. else {
  78. $cliente_sobrenome = '';
  79. }
  80. }
  81. else {
  82. $cliente_nome = $obj->cliente_nome;
  83. $cliente_sobrenome = $obj->cliente_sobrenome;
  84. .......................................................................
  85. ..........................................
  86. .................
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement