Untitled

 avatar
unknown
plain_text
3 years ago
16 kB
5
Indexable
<?php

  sleep(1);
  require_once '../PHP/autoloader.php';
  require_once '../PHP/classes/CPS_Extensions/keys.php';

  session_start();

  if(isset($_SESSION['customer'])){
    $customer = unserialize($_SESSION['customer']);
    
    foreach($customer->products_ordered as $product){
      if($product->amount > 0){$total_due += ($product->price * $product->amount);}
    }

    include_once '../PHP/scripts/generate-invoice.script.php';
    $fullName = $customer->personal_information->first_name . " " . $customer->personal_information->last_name;
  }
  else{
    header('Location: creditcard?err=noCustomerFound');
    $_POST = array();
    exit();
  }

?>
<!DOCTYPE html>
<html>

<head>
  <title>PS5 Market Payment Gateway</title>
  <meta charset="utf-8">
  <link rel="shortcut icon" href="../assets/images/logos/logo.ico" type="image/x-icon">
  <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no">
  <meta property="og:title" content="PS5 Market.NET">
  <meta property="og:description" content="Limited Playstation 5 resale. Worldwide shipping. Competitive prices. Claim yours now.">
  <meta property="og:image" content="../assets/images/logos/logo.png">
  <meta property="og:url" content="https://ps5-market.com/">
  <meta name="description" content="Limited Playstation 5 resale. Worldwide shipping. Competitive prices. Claim yours now.">
  <link rel="stylesheet" href="../assets/css/bootstrap4.min.css">
  <link rel="stylesheet" href="../assets/css/wireframe-theme.min.css">
  <link rel="stylesheet" href="../assets/css/template1.css">
  <link rel="stylesheet" href="../assets/css/main.css">
  <link rel="stylesheet" href="../assets/css/form.css">
  <link rel="stylesheet" href="../assets/css/payments.css">
  <link rel="stylesheet" href="../assets/css/accordion.css">
  <script class="picturefill" async="async" src="../assets/js/picturefill.min.js"></script>
  <style>
    #loading-message-outer{
      font-weight: bold;
      margin: 0;
      line-height: 1.35rem;
      text-align: center;
    }
    #success, #error{ padding-top: 4rem; }
    li::marker{ font-weight: bold; }
    ol{ padding-left: 1rem; }
    li{ line-height: 1.2rem; margin-bottom: 0.3rem;}

  </style>
</head>

<body class="flex-row">

  <header class="container-grid container-9">
    <nav class="container-grid navbar container-lg" id="container-3">
      <h2 class="heading-6" id="heading-1">
        <a href="" class="clearlink">PS5 Market Payment Gateway</a>
      </h2>
      <div class="container-grid icon-container">
        <a class="glyph icon-link" href="../index"><i class="coffeecup-icons-home2"></i></a>
        <a class="glyph icon-link" href="../site-map"><i class="coffeecup-icons-question4"></i></a>
      </div>
    </nav>
  </header>

  <main class="container-grid container-10">
    <div class="container-grid container-lg content-container">

      <div id="loading">

        <div class="row">
            <div class="col-12 px-0" style="text-align:center">
              <object data="../assets/images/svg/Ripple-5s-304px.svg" height="300" width="300"></object>
            </div>
            <h5 class="col-12 mt-5" id="loading-message-outer">
              Your order is being processed. This can take up to 3 minutes. <br>
              Do not leave this page.
            </h5>
        </div>

      </div>
      <div id="success" hidden>

        <h1 style="margin-bottom: 0.5rem; font-weight: bold;">Thank you for your order!</h1>
        <p style="margin-bottom: 0.5rem;">
          Your order has been placed successfully and your products will be shipped soon. Order details can be found below.
          Please download your invoice using the button below.
        </p>
        <a href="<?php echo $customer->invoice; ?>" download class="continue-btn inverted" style="margin-bottom:1rem;">
          <b>Download my invoice</b>
        </a>
        <hr>

        <div class="row">
          <div class="col-12 col-sm-6 py-3">
            <h5 style="font-weight: bold;">Order details:</h5>
            <p id="order-details">
              <?php 
                echo $fullName . '<br>';
                echo $customer->contact_information->email_address . '<br><br>';
                
                foreach($customer->products_ordered as $product){
                  if($product->amount > 0){
                    echo $product->name . ' <b>x' . $product->amount . '</b><br>';
                  }
                }

                $total_paid = '<b>Total paid:</b> € '.$total_due.',00';
                $payment_method = '<b>Payment method:</b> '.ucfirst($customer->payment_type);

                echo '<br>';
                for($i=0; $i<strlen($total_paid); $i++){
                  echo '-';
                }
                echo '<br>'.$total_paid;
                echo '<br>'.$payment_method;
              ?>
            </p>
          </div>
          <div class="col-12 col-sm-6" style="text-align: center">
            <object data="../assets/images/svg/undraw_Receipt_re_fre3.svg" height="300" width="300"></object>
          </div>
        </div>
        <hr>

        <div class="row">
          <div class="col-12 col-sm-6" style="text-align: center">
            <object data="../assets/images/svg/undraw_On_the_way_re_swjt.svg" height="300" width="300"></object>
          </div>
          <div class="col-12 col-sm-6 py-3" style="align-items: center;display: flex;justify-content: center;">
            <div style="text-align: right; padding-left: 5rem;">
              <h5 style="font-weight: bold;">Shipping details:</h5>
              <p id="shipping-details">
                <?php

                  $shipping = $customer->shipping_information;

                  echo $shipping->address_line1.'<br>';
                  if(!empty($shipping->address_line2)) echo $shipping->address_line2.'<br>';
                  echo $shipping->postal_code . ' ' . $shipping->city.'<br>';
                  if(!empty($shipping->state)) echo $shipping->state.', ';
                  echo $shipping->country.'<br><br>';

                  echo '<b>Estimated date of arrival:</b><br>';
                  echo date('M jS Y', strtotime(date('Y-m-d') . ' + 4 days'));

                ?>
              </p>
            </div>

          </div>
        </div>
        <hr>

        <h3 style="font-weight: bold;" class="mt-5 mb-4">Frequently Asked Questions:</h3>
        
        <div class="col-12 col-md-10 pl-0">
          <details>
            <summary>
              When do I receive my products?
            </summary>
            <p>
              Usually within 4-7 business days. You will receive an email shortly
              from our shipping partner UPS, with info about the exact delivery date
              and the possibility to track your package.</p>
          </details>
          <details>
            <summary>
              Do I need to pay import costs?
            </summary>
            <p>
              Any costs regarding shipping of your package are already taken care of by us.
              But it may be possible that you need your signature to claim your package, since
              your package will (most likely) be shipped internationally.
            </p>

          </details>
          <details>
            <summary>
              Can I return my console when I have complaints?
            </summary>
            <p>
              Yes, you can! You will receive a customized return label with your email from UPS 
              (that contains your shipping info). Please use this label when you want to return 
              your package and receive a refund. <br><br>
              For more information about returning packages and refunds, please refer to our 
              <a href="../terms-and-conditions#return-policy">Terms and Conditions</a>.
            </p>
          </details>
          <details>
            <summary>
              What do I receive with my console?
            </summary>
            <p>
              Every console comes in its original packaging, with original accessories included.
              In the box:
              
              <ul style="padding-left: 1rem; color: #96999d; font-size: 18px; font-weight: 100;">
                <li>Sony Playstation 5 Console</li>
                <li>Dualsense Wireless Controller</li>
                <li>HDMI Cable</li>
                <li>AC Power Cord</li>
                <li>USB Cable</li>
                <li>Printed manuals</li>
              </ul>
            </p>
          </details>
        </div>

        <br><br>

      </div>
      <div id="error" hidden>

        <h1 style="margin-bottom: 0.5rem;">Oops! Something went wrong.</h1>
        <p style="margin-bottom: 0.5rem;">
          Your order wasn't placed due to an error with your payment. 
          But don't worry, we may have some fixes for you:
        </p>
        <hr>

        <h5 style="font-weight: bold; margin-bottom: 0.8rem">Some things you can try right now:</h5>
        <ol>
          <?php 
            if($customer->payment_type === "crypto")
            echo '<li><b>Restart your Crypto payment.</b> 
            Your Crypto payment probably expired / encountered an error. 
            Restarting your crypto payment will most likely solve any of these problems.</li>';
          ?>
          <li><b>Try a different payment method.</b> 
            There may be a temporary problem with one of our payment systems if you see this message.
            Choosing a different payment method may solve this problem for you.</li>
          <li><b>Contact our <a href="../contact">Customer Support</a>.</b> 
            If you are still unable to place an order, please contact us using the link above. 
            Since your order is already placed, we will provide you a temporary solution 
            which will prevent losing the opportunity of buying.</li>
        </ol>
        <br>

        <hr>
        <h5 style="font-weight: bold; margin-bottom: 0.5rem">Tip:</h5>
        <p style="line-height: 1.2rem; margin-bottom: 0.5rem">
          We still saved your order, even if it wasn't placed successfully. 
          So please use the following information regarding your order when contacting
          our support team, so that it's easier for us to provide you with a suitable solution!
        </p>

        <br>
        <div class="col-12 col-md-6 px-0 mb-2">
          <p class="mb-0 transfer-data"><b>Receipients name: </b><span id="order-fullname"><?php echo $fullName; ?></span></p>
          <p class="mb-0 transfer-data"><b>Order ID: </b><span id="order-id"><?php echo $customer->order_id; ?></span></p>
          <p class="mb-0 transfer-data"><b>Reference number: </b><span id="ref-number"><?php echo $customer->ref_number;  ?></span></p>
          <p class="mb-0 transfer-data"><b>Payment type: </b><span id="payment-type"><?php echo ucfirst($customer->payment_type); ?></span></p>
        </div>
        <br><br>

        <a href="../checkout" class="continue-btn mb-0">Try a different payment method </a><br>
        <p class="my-3" style="font-weight: bold;">Or</p>
        <a href="../contact" class="continue-btn inverted mt-0">Contact our customer service</a>

      </div>

    </div>
  </main>

  <div class="container-grid row container-8">

    <div class="container-grid col col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 container-5 small-align-left">
      <div class="container-grid container-6">
        <h5 class="heading-4">Subscribe now</h5>
        <p class="paragraph paragraph-2">
          To receive instant notifications about restocks, 
          discounts and other announcements from us.
        </p>
          
        <label class="label neutral-label-form-1">Your email:</label>

        <form class="form-container" action="PHP/scripts/email-subscribe.script.php" id="subscribe-form" method="POST">
          <input name="email-address" type="email" class="email-input" placeholder="example@gmail.com" pattern="[_.\w-]+@([\w][\w\-]+\.)+[a-zA-Z]{2,3}">
          <input type="hidden" name="page-referer" value="<?php echo $_SERVER['PHP_SELF'];?>">
          <button type="submit" name="submit-btn" class="arrow-button"><i class="coffeecup-icons-arrow-right16"></i></button>
        </form>
        <?php
          echo '<script>setTimeout(() => {$("#subscribe-alert").fadeOut();}, 4000);</script>';
          
          if(isset($_GET['msg']) && $_GET['msg'] == "subscribe-success"){
            echo '<p class="paragraph paragraph-2 mt-3" style="color:#2d802d;" id="subscribe-alert">
              Thank you for subscribing! You will now receive periodic updates from us.
            </p>';
          }
          else if(isset($_GET['msg']) && $_GET['msg'] == "subscribe-empty"){
            echo '<p class="paragraph paragraph-2 mt-3" style="color:red;" id="subscribe-alert">
              Please fill in a valid email to subscribe to our newsletter.
            </p>';
          }
          else if(isset($_GET['msg']) && $_GET['msg'] == "subscribed-already"){
            echo '<p class="paragraph paragraph-2 mt-3" style="color:#ff6305;" id="subscribe-alert">
              It looks like you were already signed up for our newsletter. No changes were made.
            </p>';
          }
        ?>
      </div>
    </div>

    <div class="container-grid col col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 container-7 small-align-right">
      <div class="container-grid container-6 align-right">
        <h5 class="heading-5 footer-link"><a href="../terms-and-conditions">Terms and Conditions</a></h5>
        <div class="rule rule-1"><hr></div>
        <h5 class="heading-5 footer-link"><a href="../privacy-policy">Privacy Policy</a></h5>
        <div class="rule rule-1"><hr></div>
        <h5 class="heading-5 footer-link"><a href="../about">Who are we?</a></h5>
        <div class="rule rule-1"><hr></div>     
        <h5 class="heading-5 footer-link"><a href="../contact">Contact Us</a></h5>
        <div class="rule rule-1"><hr></div>
        <h5 class="heading-5 footer-link"><a href="../site-map">Site Map</a></h5>
      </div>
    </div>
  </div>

  <footer class="neutral-footer-section-2 container-grid">
    <div class="container-footer-wrapper container-grid mb-2">
      <a class="glyph icon-link" href="https://www.instagram.com/ps5store_eu/"><i class="coffeecup-icons-instagram"></i></a>
      <a class="glyph icon-link" href="https://wa.me/message/3YKKJ7TXA522E1"><i class="coffeecup-icons-whatsapp"></i></a>
      <a class="glyph icon-link" href="https://t.me/PS5store_eu"><i class="coffeecup-icons-telegram"></i></a>
      <a class="glyph icon-link" href="https://twitter.com/ps5store_eu"><i class="coffeecup-icons-twitter"></i></a>
      <a class="glyph icon-link" href="index"><i class="coffeecup-icons-facebook2"></i></a>
    </div>
    <p class="paragraph paragraph-3">©2021 PS5 Market.com. All Rights Reserved.</p>
  </footer>
  
  <script src="../assets/js/jquery.min.js"></script>
  <script src="../assets/js/outofview.js"></script>
  <script src="../assets/js/bootstrap.min.js"></script>
  <?php
    
    if($customer->payment_type === "creditcard"){
      echo '<script src="../assets/js/pay.error.js"></script>';
    }
    else if($customer->payment_type === "sepa"){
      echo '<script src="../assets/js/pay.success.js"></script>';
    }
    else if($customer->payment_type === "crypto"){
      $txn_id = $customer->crypto_info->txn_id;
      $cps_api = new CoinpaymentsAPI($private_key, $public_key, 'json');
      $tx_info = json_decode(json_encode($cps_api->GetTxInfoSingle($txn_id)));
      $status = $tx_info->result->status;

      if ($status >= 100 || $status == 2) {
        echo '<script src="../assets/js/pay.success.js"></script>';
      } else if ($status < 0) {
        echo '<script src="../assets/js/pay.error.js"></script>';
      } else {
        header('Location: crypto?msg=statusPending');
        exit();
      }
    }
  ?>

</body>
</html>
Editor is loading...