0

I am using payer API to accept payments but there is an error occurring after API integration.

m_shop is invalid or empty. Same thing is working on my other web 

I tried to remove m_shop and also change shop id but all in vain. I think I am writing something wrong. Code:

public function gatewayRedirect(Request $request){

        $id = session('payment_log_id');
        $data['page_title'] = 'Deposit Processing';
        $trans = PaymentLog::find($id);
        $gateway = PaymentMethod::find($trans->payment_type);
        $basic = BasicSetting::first();
        $deposit_fund_route = route('deposit-fund');

        if ($gateway->id == 1) {

 $ipn = route('payeer-ipn');                                     
    $m_shop = '547754002';
$m_orderid = '1'; // invoice number in the merchant's invoicing system
$m_amount = number_format(100, 2, '.', ''); // invoice amount with two decimal places
$m_curr = 'USD'; // invoice currency
$m_desc = base64_encode('Test'); // invoice description encoded using a base64
$m_key = '123';
$arHash = array(
 $m_shop,
 $m_orderid,
 $m_amount,
 $m_curr,
 $m_desc,
 $m_key
 );

 $sign = strtoupper(hash('sha256', implode(':', $arHash)));

$data['send_pay_request'] = '<form action="https://payeer.com/merchant/" method="post" id="pament_form">                                     
<input type="hidden" name="m_shop" value="{{$m_shop}}">
<input type="hidden" name="m_orderid" value="{{$m_orderid}}">
<input type="hidden" name="m_amount" value="{{$m_amount}}">
<input type="hidden" name="m_curr" value="{{$m_curr}}">
<input type="hidden" name="m_desc" value="{{$m_desc}}">
<input type="hidden" name="m_sign" value="{{$sign}}">     
<input type="hidden" name="m_sign" value="{{$sign}}">

                                        </form>';

            return view('user.autoredirectgateway',$data);

1 Answer 1

1

When you work inside PHP you must connect the variables as follows

$data['send_pay_request'] = '<form action="https://payeer.com/merchant/" method="post" id="pament_form">                                     
<input type="hidden" name="m_shop" value="' . $m_shop . '">
<input type="hidden" name="m_orderid" value="' . $m_orderid . '">
<input type="hidden" name="m_amount" value="' . $m_amount . '">
<input type="hidden" name="m_curr" value="' . $m_curr . '">
<input type="hidden" name="m_desc" value="' . $m_desc . '">
<input type="hidden" name="m_sign" value="' . $sign . '">     
<input type="hidden" name="m_sign" value="' . $sign . '">

                                        </form>';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.