Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ethar's avatar
Level 5

payplus payament gateway

hi i use payplus as payament gateway, i generate payament link using curl library

        $curl = curl_init();
        curl_setopt_array($curl, [
            CURLOPT_URL => 'https://restapi.payplus.co.il/api/v1.0/PaymentPages/generateLink',
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => '',
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 0,
            CURLOPT_FOLLOWLOCATION => true,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => 'POST',
            CURLOPT_POSTFIELDS => '{
                "payment_page_uid": "2931c05e-3cbc3e201208",
                 "refURL_success": "https://la.com/success/",
                 "refURL_failure": "https://www.la.com/failure/",
                 "refURL_callback": "https://www.la.com/callback/",
                "customer": {
                    "customer_name":"'.$data['customer_name'].'",
                    "email":"'.$data['customer_email'].'",
                    "phone":""
                },
                 "items": '.json_encode($newItems).',
                "amount": "'.$data['total'].'",
                "more_info": "'.$orderId.'",
                "order_id": "'.$orderId.'",
                "currency_code": "'.$currency->title.'",
                "sendEmailApproval": true,
                "sendEmailFailure": false,
                "hide_identification_id": false
            }',
            CURLOPT_HTTPHEADER => [
                'Accept: application/json',
                'Content-Type: application/json',
                'Authorization: {"api_key":"c961f549143e1ab5","secret_key":"019fca13fb6"}',
            ],
        ]);
        $response = curl_exec($curl);
        curl_close($curl);
        $response = json_decode($response, true);
        return Redirect::to($response['data']['payment_page_link']);

after generate page link, i redirect user to this page using

        return Redirect::to($response['data']['payment_page_link']);

when payament successfuly its redirect to me to this route www.la.com/success

i create success function to read response , and update order_id

    public function success(Request $request)
    {
        var_dump($request);
    }

but in var dump, im not found any data in query parameter

Illuminate\Http\Request {#43 ▼ // app/Http/Controllers/Front/PaymentController.php:167
  +attributes: Symfony\Component\HttpFoundation\ParameterBag {#45 ▶}
  +request: Symfony\Component\HttpFoundation\InputBag {#44 ▶}
  +query: Symfony\Component\HttpFoundation\InputBag {#51 ▼
    #parameters: []
  }
  +server: Symfony\Component\HttpFoundation\ServerBag {#47 ▶}
  +files: Symfony\Component\HttpFoundation\FileBag {#48 ▶}
  +cookies: Symfony\Component\HttpFoundation\InputBag {#46 ▶}
  +headers: Symfony\Component\HttpFoundation\HeaderBag {#49 ▶}
  #content: null
  #languages: null
  #charsets: null
  #encodings: null
  #acceptableContentTypes: null
  #pathInfo: "/en/success"
  #requestUri: "/en/success"
  #baseUrl: ""
  #basePath: null
  #method: "GET"
  #format: null
  #session: Illuminate\Session\Store {#1712 ▶}
  #locale: null
  #defaultLocale: "en"
  -preferredFormat: null
  -isHostValid: true
  -isForwardedValid: true
  #json: null
  #convertedFiles: null
  #userResolver: Closure($guard = null) {#1638 ▶}
  #routeResolver: Closure() {#1647 ▶}
  basePath: ""
  format: "html"
}

any help how get order_id from response

0 likes
1 reply

Please or to participate in this conversation.