<?php
include_once(dirname(__FILE__) . '/auth_tokens.php');
error_reporting(0);
ini_set('display_errors', 0);
if (empty($_POST['user-id']) && $_POST['auth-token'] != TRADES_PAYMENT_AUTH_TOKEN) {
header('location:https://www.trades.lk/packages/?request-url-not-valid');
}
//load RSA library
include 'Crypt/RSA.php';
//initialize RSA
$rsa = new Crypt_RSA();
$publickey = "-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6JhIexNdCdsgZo+IjEM3vjG1iT/tSG5RzbywYHBKcc7lcyuzuSmHq/Bq+I1wImwuUVo4RaIXzddCZWjbPBAedsX9gel1cW+edsi3sHXv780EWdH2u+x010nXJgJNRtYVGk/fh4J6k8L6kdI/bbpLNAargVbt/Ea6y3LMyFFOpTwIDAQAB-----END PUBLIC KEY-----";
//load public key for encrypting
$rsa->loadKey($publickey);
//encode for data passing
$plaintext = $_POST['order-no'] . '|' . $_POST['price']; // unique_order_id|total_amount
$encrypt = $rsa->encrypt($plaintext);
$payment = base64_encode($encrypt);
$custom_fields = base64_encode($_POST['user-id'] . '|' . $_POST['auth-token'] . '|' . $_POST['order-no'] . '|' . $_POST['pay-for'] . '|' . $_POST['pay-type']); //custom fields //cus_1|cus_2|cus_3|cus_4
//checkout URL
$url = 'https://webxpay.com/index.php?route=checkout/billing';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sublime Payments | checkout form</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<div class="wrapper">
<section class="list-detail pt-1">
<div class="container padd-0 ">
<div class="container detail-wrapper">
<div class="row">
<div class="col-sm-6 d-flex justify-content-start align-items-center">
<a class="navbar-brand" href="https://trades.lk/" target="_blank">
<img src="https://trades.lk/assets/img/logo/text-only.png" class="logo logo-scrolled" alt="trades.lk logo">
</a>
</div>
<div class="col-sm-6 d-flex justify-content-end align-items-center">
<a class="navbar-brand" href="https://sublime.lk/" target="_blank">
<img src="img/sublime-logo.png" class="img-responsive " alt="" />
</a>
</div>
</div>
<div class="detail-wrapper-body px-0">
<div class="payment-card">
<header class="payment-card-header cursor-pointer" data-toggle="collapse" data-target="#paypal">
<div class="payment-card-title flexbox">
<h4><?= str_replace("-", " ", ucwords($_POST['pay-for'])) ?> Package Subscription</h4>
</div>
</header>
<form action="<?php echo $url; ?>" method="POST">
<div class="payment-card-body">
<div class="row mrg-r-10 mrg-l-10">
<div class="col-sm-6">
<label>First Name *</label>
<input class="form-control" type="text" name="first_name" value="<?= explode(" ", trim($_POST['name']))[0] ?>" <?= empty(explode(" ", trim($_POST['name']))[0]) ? "required" : "readonly" ?>>
</div>
<div class="col-sm-6">
<label>Last Name *</label>
<input class="form-control" type="text" name="last_name" value="<?= explode(" ", trim($_POST['name']))[1] ?>" <?= empty(explode(" ", trim($_POST['name']))[1]) ? "required" : "readonly" ?>>
</div>
<div class="col-sm-6">
<label>Email *</label>
<input class="form-control" type="text" name="email" value="<?= $_POST['email'] ?>" readonly>
</div>
<div class="col-sm-6">
<label>Contact Number *</label>
<input class="form-control" type="text" name="contact_number" value="<?= $_POST['phone'] ?>" required>
</div>
<div class="col-sm-12">
<label>Address *</label>
<input class="form-control" type="text" name="address_line_one" value="<?= $_POST['address'] ?>" readonly>
</div>
<div class="col-sm-12">
<label>City</label>
<input class="form-control" type="text" name="city" value="<?= $_POST['city'] ?>" readonly>
</div>
<div class="col-sm-6">
<label>Amount *</label>
<input class="form-control" type="text" value="<?= number_format($_POST['price'], 2) ?>" readonly>
</div>
<div class="col-sm-6">
<label>currency *</label>
<input class="form-control" type="text" name="process_currency" value="<?= $_POST['currency'] ?>" readonly>
</div>
<div class="col-sm-12 mt-2">
<span class="custom-checkbox d-block">
<input type="checkbox" id="agree-terms-and-condition" required>
<label for="agree-terms-and-condition">
I have read and agree to the
<a href="https://www.trades.lk/terms-and-conditions/" target="_blank">
Terms & Conditions of trades.lk
</a>
</label>
</span>
</div>
<!-- End Debit & Credit Option -->
<div class="col-sm-12 text-left mt-2">
<!-- POST parameters -->
<input type="hidden" name="cms" value="PHP">
<input type="hidden" name="secret_key" value="b1197ac7-098f-4031-810d-b56605b33daf">
<!-- <input type="hidden" name="secret_key" value="5b85b6ff-5cb6-4852-9c7c-c88667e36db2"> -->
<input type="hidden" name="custom_fields" value="<?php echo $custom_fields; ?>">
<input type="hidden" name="payment" value="<?php echo $payment; ?>">
<input type="hidden" name="postal_code" value="<?php echo $_POST['postal_code']; ?>">
<input type="hidden" name="country" value="srilanka">
<input type="submit" value="Pay Now" class="btn theme-btn">
<!-- <a href="#" class="btn theme-btn" id="checkout" name="checkout">Checkout</a> -->
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</secton>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
</html> |