<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up()
    {   
        Schema::create('uthhan_products', function (Blueprint $table) {
            $table->id();
            $table->string('uthhan_id');
            $table->string('coordinator_id')->nullable();
            $table->text('product_name');
            $table->double('product_rating_average');
            $table->string('artisan_cost');
            $table->integer('mrp2');
            $table->string('mrp');
            $table->string('uthhan_charge', 1000)->nullable();
            $table->string('volunteer_charge', 1000)->nullable();
            $table->string('gst', 1000)->nullable();
            $table->string('product_category');
            $table->string('sub_category');
            $table->string('sub_sub_category')->nullable();
            $table->string('category_code')->nullable();
            $table->string('shipping_cost');
            $table->string('selling_price');
            $table->string('material');
            $table->string('color');
            $table->string('color_new');
            $table->string('quantity');
            $table->string('weight');
            $table->string('weight_unit');
            $table->string('product_dimension');
            $table->string('product_dimension_unit');
            $table->string('suitable_for');
            $table->text('set_contents');
            $table->text('product_description');
            $table->string('depth');
            $table->string('capacity');
            $table->text('image_url_1')->nullable();
            $table->text('image_url_2')->nullable();
            $table->text('image_url_3')->nullable();
            $table->text('image_url_4')->nullable();
            $table->string('video_url_1');
            $table->string('packaging_length');
            $table->string('packaging_breadth');
            $table->string('packaging_height');
            $table->text('care');
            $table->string('blow_type')->nullable();
            $table->string('number_of_finger_holes')->nullable();
            $table->string('primary_material_subtype')->nullable();
            $table->string('secondary_material_subtype')->nullable();
            $table->string('water_resistance')->nullable();
            $table->string('maximum_load_capacity')->nullable();
            $table->string('type')->nullable();
            $table->string('collection')->nullable();
            $table->string('occasion')->nullable();
            $table->string('is_assembly_required')->nullable();
            $table->string('shape')->nullable();
            $table->string('compartment')->nullable();
            $table->string('size_available')->nullable();
            $table->string('closure_type')->nullable();
            $table->string('pattern')->nullable();
            $table->string('length')->nullable();
            $table->string('status')->nullable();
            $table->string('stock_status');
            $table->text('remarks')->nullable();
            $table->string('product_type', 1000);
            $table->string('weekend_baazar', 500);
            $table->string('re_seller');
            $table->string('reseller_uthhan', 100);
            $table->string('featured');
            $table->string('img_name1')->nullable();
            $table->string('img_name2')->nullable();
            $table->string('img_name3')->nullable();
            $table->string('img_name4')->nullable();
            $table->string('delivery_address');
            $table->string('single_upload_status');
            $table->string('store_code')->nullable();
            $table->string('store_quantity')->nullable();
            $table->integer('store_price')->nullable();
            $table->string('inventory_add_date');
            $table->string('Exp_Category_name', 100)->nullable();
            $table->string('edited_by', 100);
            $table->date('edited_date')->nullable();
            $table->string('approved_by', 100);
            $table->date('approved_date')->nullable();
            $table->string('rejected_by', 100);
            $table->date('rejected_date')->nullable();
            $table->string('pending_by', 100);
            $table->date('pending_date')->nullable();
            $table->string('delivery_date', 200);
            $table->dateTime('created_on');
            $table->dateTime('modified_on')->default(DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
        });
    }
    
    
    2025_04_07_145509_create_user_reg_table ............................................................................................. 28.14ms DONE
    2025_04_07_154325_create_notification_data_table .................................................................................... 19.25ms DONE
    2025_04_09_165029_create_gift_card_details_table .................................................................................... 13.36ms DONE
    2025_04_10_134510_create_artisan_signups_table ...................................................................................... 23.77ms DONE
    2025_04_10_141754_create_merchant_ids_table ............
    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('uthhan_products');
    }
};


Hi Team,

Please find the requested integration details below:

Merchant Key: a7KDBHC1

MID:6964704

Environment: Production (https://secure.payu.in/_payment)

Request Payload:          
{
  "txnid": "ORD12345",
  "amount": "102",
  "currency": "INR",
  "customer_id": "",
  "surl": "https://uthhanecom.gergstore.com/Product/success",
  "furl":"https://uthhanecom.gergstore.com/Product/failure",
   "service_provider": "payu_paisa",
}


Kindly let me know if you need any further details.

Hi Team,

As requested, please find the integration details below:

Merchant Key (mkey): a7KDBHC1

MID:6964704
Transaction ID (tid): cb84e244b2c7329fede7

Hash:
4a7dc1e2c2d0780b86134b63f8a29de1b4f1f61055de15cbba5a2c7272b0ba07be8a9b4e71f4e8f193d35a02ad4088909ac7e59ae0e571e0b5254e0405060452

Amount: ₹102

Product Info (pinfo): 2295

Customer Name: Radhika Sangam

Customer Email: radhikassangam@gmail.com

Customer Phone: 8095036899

Environment: Production (https://secure.payu.in/_payment)
 "surl": "https://uthhanecom.gergstore.com/Product/success",
  "furl":"https://uthhanecom.gergstore.com/Product/failure",
Let me know if you need any further information or assistance.









Hi Team,

Merchant Key (mkey): a7KDBHC1

MID:6964704
Transaction ID (tid): 3289f6a3012380365f35

Hash:
 9dc21c1ff1ded38c713d112a4ac1d95fc5c2ec1b8cbd2d281f0d6a499aabb196cfd977379e6101cfc410df5f9bd65291e5de72244686182fb8aa0d662d208ac8
   
Amount: ₹162

Product Info (pinfo): 2300

Customer Name: Radhika Sangam

Customer Email: radhikassangam@gmail.com

Customer Phone: 8095036899

Environment: Production (https://secure.payu.in/_payment)
 "surl": "https://uthhanecom.gergstore.com/Product/success",
  "furl":"https://uthhanecom.gergstore.com/Product/failure"


  After creating new transaction was getting the error code as
  Error code:Error: 2732405_6822dae3da779_6822dae3daae3

And also did not get log messages in either  surl,furl,curl

Let me know if you need any further information or assistance.



<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<title>PayU Checkout</title>
</head>

<body onload="submitPayuForm()">
<!-- for production : https://secure.payu.in/_payment -->
<form action='https://test.payu.in/_payment' method='post'>

<input type="hidden" name="key" value="' . $MERCHANT_KEY . '" />
<input type="hidden" name="txnid" value="' . $txnid . '" />
<input type="hidden" name="productinfo" value="' . $productinfo . '" />
<input type="hidden" name="amount" value="' . $grand_total_new . '" />
<input type="hidden" name="email" value="' . $email . '" />
<input type="hidden" name="firstname" value="' . $fname . '" />
<input type="hidden" name="lastname" value="' . $fetch_details_of_customer['last_name'] . '" />
<input type="hidden" name="surl" value="https://test.payu.in/admin/test_response" />
<input type="hidden" name="furl" value="https://test.payu.in/admin/test_response" / >
<input type="hidden" name="phone" value="' . $fetch_details_of_customer['mobile'] . '" />
<input type="hidden" name="hash" value="' . $hash . '" />
<input type="submit" value="Make Payment"> </form>
</body>

<!--  $MERCHANT_KEY . '|' . $txnid . '|' . $grand_total_new . '|' . $productinfo . '|' . $fname . '|' . $email . '|||||||||||' . $SALT-->
 $hashstring = $MERCHANT_KEY . '|' . $txnid . '|' . $grand_total_new . '|' . $productinfo . '|' . $fname . '|' . $email . '|' . $udf1 . '|' . $udf2 . '|' . $udf3 . '|' . $udf4 . '|' . $udf5 . '||||||' . $SALT;
  
</html>
 <body onload="submitPayuForm()">
        <form id="msform" method="post" name="payuForm" action="https://secure.payu.in/_payment">
            <input name="key" type="hidden" value="' . $MERCHANT_KEY . '" />
            <input name="txnid" type="hidden" value="' . $txnid . '" />
                <input type="hidden" name="hash" value="' . $hash . '" />
             <input name="amount" type="hidden" value="' . $grand_total_new . '" />
             <input name="productinfo" type="hidden" value="' . $productinfo . '" />
            <input name="firstname" type="hidden" value="' . $fname . '" />
            <input name="email" type="hidden" value="' . $email . '" />
            <input name="phone" type="hidden" value="' . $fetch_details_of_customer['mobile'] . '" />
            <input type="hidden" name="service_provider" value="payu_paisa" />
            <input name="surl" type="hidden" value="' . base_url('Product/success') . '" />
            <input name="furl" type="hidden" value="' . base_url('Product/failure') . '" />
            <input name="curl" type="hidden" value="' . base_url('Product/cancel') . '" />
        </form>
    </body>B3ZbbSB3ZbbS

      // <form id="msform" method="post" name="payuForm" action="https://secure.payu.in/_payment">
        //     <input name="key" type="hidden" value="' . $MERCHANT_KEY . '" />
        //     <input name="txnid" type="hidden" value="' . $txnid . '" />
        //         <input type="hidden" name="hash" value="' . $hash . '" />
        //      <input name="amount" type="hidden" value="' . $grand_total_new . '" />
        //      <input name="productinfo" type="hidden" value="' . $productinfo . '" />
        //     <input name="firstname" type="hidden" value="' . $fname . '" />
        //     <input name="email" type="hidden" value="' . $email . '" />
        //     <input name="phone" type="hidden" value="' . $fetch_details_of_customer['mobile'] . '" />
        //     <input type="hidden" name="service_provider" value="payu_paisa" />
        //     <input name="surl" type="hidden" value="' . base_url('Product/success') . '" />
        //     <input name="furl" type="hidden" value="' . base_url('Product/failure') . '" />
        //     <input name="curl" type="hidden" value="' . base_url('Product/cancel') . '" />
        // </form>
ERROR - 2025-05-13 16:28:41 --> PayU Payment Init =>
 {"MERCHANT_KEY":"gtKFFx",
    "txnid":"9ce1d6e3327ffd5dce3d",
    "amount":"122.00",
    "productinfo":"orderno_2330",
    "fname":"Radhika  Sangam ",
    "email":"radhikassangam@gmail.com",
    "phone":"8095036899","lname":"Sangam ",
    "hash":"3e06c0661b6ed7c2e20b66c2ed9987e9e00581de8160f1df8e3b8cbe0ee4978f0cbaaee731b256d0b07b36e569abb0781083e5f2cd5dfbc9d22bf10818a36531","hash_string":"gtKFFx|9ce1d6e3327ffd5dce3d|122.00|orderno_2330|Radhika  Sangam |radhikassangam@gmail.com|||||||||||4R38IvwiV57FwVpsgOvTXBdLE4tHUXFW","surl":"https:\/\/test.payu.in\/admin\/test_response","furl":"https:\/\/test.payu.in\/admin\/test_response","Baazar":null}
{"MERCHANT_KEY":"a7KDBHC1",
    "txnid":"edd150c5ff4997aa8056",
    "amount":"122.00",
    "productinfo":"orderno_2329","fname":"Radhika  Sangam ",
    "email":"radhikassangam@gmail.com","phone":"8095036899",
    "lname":"Sangam ",
    "hash":"72867ddbbe7f6703165a3a8c85bd1a735e7954acfcb95390884706e9f989a41961222d5040c2b97c3d4ec76951a2aa480a3ac26d6b8fa1033cd5130189336cac",
    "hash_string":"a7KDBHC1|edd150c5ff4997aa8056|122.00|orderno_2329|Radhika  Sangam |radhikassangam@gmail.com|||||||||||XMApBe74eJ","surl":"https:\/\/test.payu.in\/admin\/test_response","furl":"https:\/\/test.payu.in\/admin\/test_response","Baazar":null}









    
Hi Team,

Here are the details of our configuration with code,error log with data. We have tried these data in test environment its working properly and going to
https://test.payu.in/_payment this test url but when we are working in production environment(https://secure.payu.in/_payment) its failing.Transaction failed due to incorrectly calculated hash parameter.
so we attached the payload/Data.

Merchant Key (mkey): a7KDBHC1

Environment: Production (https://secure.payu.in/_payment)
 "surl": "https://uthhanecom.gergstore.com/Product/success",
  "furl":"https://uthhanecom.gergstore.com/Product/failure"

 payload:{
HASH STRING: a7KDBHC1|707b6cd85745cd3dc4a5|1058.00|orderno_2371|akul singh|priyanshpandey0@gmail.com|||||||||||XMApBe74eJ
ERROR - 2025-05-13 18:42:11 --> HASH: 9a3e6312ccb0202b0edd9f16e326c1e4c9f1455e9b4fecd2babc5f75c63410398ea488592184a9412f6c68e2e7166d69e954d687a54a9087df806db7b9c67002
ERROR - 2025-05-13 18:42:11 --> KEY: a7KDBHC1
ERROR - 2025-05-13 18:42:11 --> SALT: XMApBe74eJ
ERROR - 2025-05-13 18:42:11 --> Firstname: akul singh
ERROR - 2025-05-13 18:42:11 --> Email: priyanshpandey0@gmail.com
ERROR - 2025-05-13 18:42:11 --> Productinfo: orderno_2371
ERROR - 2025-05-13 18:42:11 --> Amount: 1058.00
ERROR - 2025-05-13 18:42:11 --> PayU Payment Init => {"MERCHANT_KEY":"a7KDBHC1","salt":"XMApBe74eJ","txnid":"707b6cd85745cd3dc4a5","amount":"1058.00","productinfo":"orderno_2371","fname":"akul","email":"priyanshpandey0@gmail.com","phone":"9471272921","lname":"singh","hash":"9a3e6312ccb0202b0edd9f16e326c1e4c9f1455e9b4fecd2babc5f75c63410398ea488592184a9412f6c68e2e7166d69e954d687a54a9087df806db7b9c67002","hash_string":"a7KDBHC1|707b6cd85745cd3dc4a5|1058.00|orderno_2371|akul singh|priyanshpandey0@gmail.com|||||||||||XMApBe74eJ","surl":"https:\/\/uthhanecom.gergstore.com\/Product1\/orderPlacedPayU1\/payment\/success","furl":"https:\/\/uthhanecom.gergstore.com\/Product1\/orderPlacedPayU1\/payment\/failure","Baazar":null}
 }

Error:{
    SORRY!
We were unable to process your payment
Error Reason
Transaction failed due to incorrectly calculated hash parameter.

Corrective Action
Please ensure that the hash used in transaction request is calculated using the correct formula.
} 

Actuall form submission HTML code:{
    $MERCHANT_KEY = "a7KDBHC1";
                $SALT = "XMApBe74eJ";
                
                $productinfo = "orderno_" . $order_result;
                $amount = number_format($grand_total_new, 2, '.', ''); // format properly!
                $firstname = trim($fname);
                $email = trim($email);
                
                // UDFs - Required even if empty
                $udf1 = $udf2 = $udf3 = $udf4 = $udf5 = $udf6 = $udf7 = $udf8 = $udf9 = $udf10 = '';
                
                $hash_string = "$MERCHANT_KEY|$txnid|$amount|$productinfo|$firstname|$email|$udf1|$udf2|$udf3|$udf4|$udf5|$udf6|$udf7|$udf8|$udf9|$udf10|$SALT";
                
                $hash = strtolower(hash('sha512', $hash_string));
                
                // Optional: log this for debugging
                log_message('error', 'HASH STRING: ' . $hash_string);
                log_message('error', 'HASH: ' . $hash);
                log_message('error', 'KEY: ' . $MERCHANT_KEY);
                log_message('error', 'SALT: ' . $SALT);
                log_message('error', 'Firstname: ' . $firstname);
                log_message('error', 'Email: ' . $email);
                log_message('error', 'Productinfo: ' . $productinfo);
                log_message('error', 'Amount: ' . $amount);

            
                $Baazar = $this->input->post('Baazar');
                // print_r($Baazar);die;
                $data = array(
                    'mkey' => $MERCHANT_KEY,
                    'salt' => $SALT,
                    'tid' => $txnid,
                    'hash' => $hash,
                    'amount' => $grand_total_new,
                    'pinfo' => $productinfo,
                    'name' => $fetch_details_of_customer['first_name'],
                    'mailid' => $email,
                    'phoneno' => $fetch_details_of_customer['mobile'],
                    'Baazar' => $Baazar
                );
                log_message('error', 'PayU Payment Init => ' . json_encode([
                    'MERCHANT_KEY' => $MERCHANT_KEY,
                    'salt' => $SALT,
                    'txnid' => $txnid,
                    'amount' => $grand_total_new,
                    'productinfo' => $productinfo,
                    'fname' => $fetch_details_of_customer['first_name'],
                    'email' => $email,
                    'phone' => $fetch_details_of_customer['mobile'],
                    'lname' => $fetch_details_of_customer['last_name'],
                    'hash' => $hash,
                    'hash_string' => $hash_string,
                    'surl' => 'https://uthhanecom.gergstore.com/Product1/orderPlacedPayU1/payment/success',
                    'furl' => 'https://uthhanecom.gergstore.com/Product1/orderPlacedPayU1/payment/failure',
                    'Baazar' => $Baazar
                ]));

            echo '<!DOCTYPE html>
            <html lang="en">
            <head>
                <meta charset="UTF-8">
                <title>PayU Checkout</title>
                <script type="text/javascript">
                    function submitPayuForm() {
                        document.forms["payuForm"].submit();
                    }
                </script>
            </head>
  <body onload="submitPayuForm()">
                <form name="payuForm" action="https://secure.payu.in/_payment" method="post">
                    <input type="hidden" name="key" value="' . $MERCHANT_KEY . '" />
                    <input type="hidden" name="salt" value="' . $SALT . '" />
                    <input type="hidden" name="txnid" value="' . $txnid . '" />
                    <input type="hidden" name="productinfo" value="' . $productinfo . '" />
                    <input type="hidden" name="amount" value="' . $grand_total_new . '" />
                    <input type="hidden" name="email" value="' . $email . '" />
                    <input type="hidden" name="firstname" value="' . $fetch_details_of_customer['first_name'] . '" />
                    <input type="hidden" name="lastname" value="'. $fetch_details_of_customer['last_name'].'" />
                    <input type="hidden" name="surl" value="https://uthhanecom.gergstore.com/Product1/orderPlacedPayU1/payment/success" />
                    <input type="hidden" name="furl" value="https://uthhanecom.gergstore.com/Product1/orderPlacedPayU1/payment/failure" />
                    <input type="hidden" name="phone" value="' . $fetch_details_of_customer['mobile'] . '" />
                    <input type="hidden" name="hash" value="' . $hash . '" />
                    
                    <!-- Even if empty, add udf1 - udf10 -->
                    <input type="hidden" name="udf1" value="" />
                    <input type="hidden" name="udf2" value="" />
                    <input type="hidden" name="udf3" value="" />
                    <input type="hidden" name="udf4" value="" />
                    <input type="hidden" name="udf5" value="" />
                    <input type="hidden" name="udf6" value="" />
                    <input type="hidden" name="udf7" value="" />
                    <input type="hidden" name="udf8" value="" />
                    <input type="hidden" name="udf9" value="" />
                    <input type="hidden" name="udf10" value="" />
            
                    <input type="submit" value="Make Payment"> 
                </form>
            </body>
            </html>';
}

Let me know if you need any further information or assistance.



use Illuminate\Http\Request;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Session;
use App\Mail\ResellerPasswordResetMail;
use App\Models\MainCatList;
use App\Models\EcomSeoMetaTag;

public function checkEmailReseller(Request $request)
{
    if ($request->isMethod('post')) {
        // Validate email input
        $request->validate([
            'email' => 'required|email',
        ], [
            'email.required' => 'Your registered email ID is required.',
            'email.email' => 'Please provide a valid email address.',
        ]);

        $email = trim($request->input('email'));

        // Validate email existence in database
       $validateEmail = (new Authenticate_Model)->validateEmailReseller($email);
        if ($validateEmail) {
            $user_id = $validateEmail->cust_id;
            $hash_string = Hash::make(time() . $user_id . $email);
            $hash_expiry = now()->addDay();

            // Save hash key and expiry in database
            $validateEmail->update([
                'user_hash_key' => $hash_string,
                'user_hash_expiry' => $hash_expiry,
            ]);

            // Generate reset link
            $resetLink = route('Authenticate.setPasswordReseller', ['hash' => $hash_string]);
            $message = '<h3>Your reset password link is below:</h3>' . $resetLink;
            $subject = "Password Reset Link";

            // Send email
            try {
                Mail::to($email)->send(new ResellerPasswordResetMail($subject, $message));
                Session::flash('success', 'Reset Password Link sent to your email ID.');
            } catch (\Exception $e) {
                return redirect()->route('Authenticate.resetPasswordReseller')
                    ->with('error', 'Email sending error: ' . $e->getMessage());
            }

            return redirect()->route('Authenticate.resetPasswordReseller');
        } else {
            return redirect()->route('Authenticate.resetPasswordReseller')
                ->with('error', 'You have entered the wrong email ID. Try again with your registered email ID!');
        }
    } 

    // Load the page with required data
    $fetch_mainCat = MainCatList::all();
    $fetch_main_cat = MainCatList::fetch_main_cat();
    $fetch_login_seo = EcomSeoMetaTag::fetch_login_seo();

    return view('reseller.reset_EmailcheckReseller', compact('fetch_mainCat', 'fetch_main_cat', 'fetch_login_seo'));
}