dousi2553 2016-02-03 09:56 采纳率: 0%
浏览 15

如何在核心php中集成api

I had the payment integration with paywithcapure. They send the sample code for test i used that code its 404 error.

    $xml_data2 = 'merchantid=somevalue&token=somevalue&bvn=somevalue';
    $URL = "http://flutterwavestaging.com:8080/FlutterwaveRecurringPayments/services/flwcardrecurring/VerifyBvn";
    $ch = curl_init($URL);
    //curl_setopt($ch, CURLOPT_MUTE, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content type - application/x-www-urlencoded'));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data2);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $output = curl_exec($ch);
  • 写回答

1条回答 默认 最新

  • dongliao9233 2016-02-03 10:00
    关注

    First make sure that url is working fine.Paste your url in browser and see the result.If it's not working then contact them for correct url and if its working fine then try this code :

    $xml_data2 = 'merchantid=somevalue&token=somevalue&bvn=somevalue';
        $URL = "http://flutterwavestaging.com:8080/FlutterwaveRecurringPayments/services/flwcardrecurring/VerifyBvn";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $URL); // you've missed this one.
        //curl_setopt($ch, CURLOPT_MUTE, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POST, 1);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content type - application/x-www-urlencoded'));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data2);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $output = curl_exec($ch);
    
    评论

报告相同问题?