Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php instamojo如何在HP中传递自定义字段_Php_Mysql_Instamojo - Fatal编程技术网

Php instamojo如何在HP中传递自定义字段

Php instamojo如何在HP中传递自定义字段,php,mysql,instamojo,Php,Mysql,Instamojo,我正在尝试在我的网站上集成instamojo支付网关 $product_name = "Buy Wine"; $price = $sub_total; $name = $_POST['f_name'].' '.$_POST['l_name']; $phone = $_POST['phone']; $email = $_POST['email']; include 'src/instamojo.php'; $api = new Insta

我正在尝试在我的网站上集成instamojo支付网关

    $product_name = "Buy Wine";
    $price = $sub_total;
    $name = $_POST['f_name'].' '.$_POST['l_name'];
    $phone = $_POST['phone'];
    $email = $_POST['email'];

    include 'src/instamojo.php';

    $api = new Instamojo\Instamojo('api_key', 'auth_token','https://test.instamojo.com/api/1.1/');


    try {
        $response = $api->paymentRequestCreate(array(
            "purpose" => $product_name,
            "amount" => $price,
            "buyer_name" => $name,
            "phone" => $phone,
            "send_email" => true,
            "send_sms" => true,
            "email" => $email,
            'allow_repeated_payments' => false,
            "redirect_url" => "http://trezeefoods.com/thankyou.php",
            "webhook" => "http://trezeefoods.com/webhook.php"
            ));
        //print_r($response);

        $pay_ulr = $response['longurl'];

        //Redirect($response['longurl'],302); //Go to Payment page

        header("Location: $pay_ulr");
        exit();

    }
    catch (Exception $e) {
        print('Error: ' . $e->getMessage());
    }     

在这里,我试图在成功页面上传递产品id作为响应,如

"order_id" => 1234,

但我无法在成功页面上收到此消息

您可以通过url参数将其传递到重定向url谢谢selvan。我将在这方面的工作和更新you@JotheesP它有效吗?你可以用url参数将它传递到重定向url谢谢selvan。我将在这方面的工作和更新you@JotheesP它有效吗?