Skip to content

Instantly share code, notes, and snippets.

View deepak140596's full-sized avatar
🎯
Focusing

Deepak Prasad deepak140596

🎯
Focusing
View GitHub Profile
<?php
include'config/db.php'; // Your database connection file if needed
$status=$_POST["status"];
$firstname=$_POST["firstname"];
$amount=$_POST["amount"];
$txnid=$_POST["txnid"];
$posted_hash=$_POST["hash"];
$key=$_POST["key"];
$productinfo=$_POST["productinfo"];
$email=$_POST["email"];
String hashSequence = merchantKey + "|" + txnId + "|" + amount + "|" + productInfo + "|" + firstName + "|" + email + "|" +
udf1 + "|" + udf2 + "|" + udf3 + "|" + udf4 + "|" + udf5 + "|" + "|" + "|" + "|" + "|" + "|" + salt;
public static String hashCal(String type, String hashString) {
StringBuilder hash = new StringBuilder();
MessageDigest messageDigest = null;
try {
messageDigest = MessageDigest.getInstance(type);
messageDigest.update(hashString.getBytes());
byte[] mdbytes = messageDigest.digest();
<style name="PaymentAppTheme">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="colorButtonNormal">@color/primary_green</item>
<item name="alertDialogTheme">@style/AlertDialogStyle_Default</item>
<item name="actionMenuTextColor">@color/white</item>
</style>
class PaymentActivity : AppCompatActivity(){
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
// Result Code is -1 send from Payumoney activity
log(D, "request code $requestCode resultcode $resultCode")
if (requestCode == PayUmoneyFlowManager.REQUEST_CODE_PAYMENT
&& resultCode == Activity.RESULT_OK && data != null) {
val transactionResponse =
class PaymentActivity : AppCompatActivity() {
private val builder = PayUmoneySdkInitializer.PaymentParam.Builder()
var paymentParam: PayUmoneySdkInitializer.PaymentParam? = null
val merchantID = "6392590"
private fun startPay(
amount: String, txnid: String, phoneNumber: String,
productinfo: String, name: String, email: String, udf1: String, udf2: String,
udf3: String, udf4: String, udf5: String
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const functions = require("firebase-functions");
const admin = require("firebase-admin");
admin.initializeApp();
exports.getHash = functions.https.onRequest(async (request, response) => {
const merchantKey = "oVWDEmPK";
const salt = "cdrcf1cyTj";
const txnId = request.query.txnId;
private fun startCamera() {
...
// Add this before CameraX.bindToLifecycle
// Setup image analysis pipeline that computes average pixel luminance
val analyzerConfig = ImageAnalysisConfig.Builder().apply {
// Use a worker thread for image analysis to prevent glitches
val analyzerThread = HandlerThread(
private class LuminosityAnalyzer : ImageAnalysis.Analyzer {
private var lastAnalyzedTimestamp = 0L
/**
* Helper extension function used to extract a byte array from an
* image plane buffer
*/
private fun ByteBuffer.toByteArray(): ByteArray {
rewind() // Rewind the buffer to zero
val data = ByteArray(remaining())
private fun startCamera() {
...
// Add this before CameraX.bindToLifecycle
// Create configuration object for the image capture use case
val imageCaptureConfig = ImageCaptureConfig.Builder()
.apply {
setTargetAspectRatio(Rational(1, 1))
<ImageButton
android:id="@+id/capture_button"
android:layout_width="72dp"
android:layout_height="72dp"
android:layout_margin="24dp"
app:srcCompat="@android:drawable/ic_menu_camera"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />