Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Nick Sagona
    @nicksagona
    b/c the Pop\Http\Client\Curl object just passes the option/value pair onto the curl_setopt function
    Akinyele Olubodun
    @akinyeleolubodun
    curl_setopt_array($curl, array(
      CURLOPT_URL => "https://url/charge",
      CURLOPT_RETURNTRANSFER => true,
      CURLOPT_SSL_VERIFYHOST =>0,
        CURLOPT_SSL_VERIFYPEER=>0,
      CURLOPT_ENCODING => "",
      CURLOPT_MAXREDIRS => 10,
      CURLOPT_TIMEOUT => 30,
      CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
      CURLOPT_CUSTOMREQUEST => "POST",
      CURLOPT_POSTFIELDS => json_encode(
              array(
                  "amount"=>"3000",
                  "customer_phone"=>"08068xxxx417",
                  "customer_name"=>"Akinssssss",
                  "customer_email"=>"",
                  "wallet_provider"=>"MTN",
                  "merchant_name"=>"test"
                  )),
      CURLOPT_HTTPHEADER => array(
        "cache-control: no-cache",
        "content-type: application/json",
        "MP-Master-Key: cd3910f",
        "MP-Private-Key: live_priunqazGY",
        "MP-Token: 6fffb23b6a4f123aae45",
      ),
    ));
    Nick Sagona
    @nicksagona
    yea you need to use setOptions() from Pop\Http\Client\Curl
    so that it invokes the curl_setopt_array function
    Akinyele Olubodun
    @akinyeleolubodun
    I think I did, let me try that now and get back
    Nick Sagona
    @nicksagona
    wait
    the parameter in the constructor gets passed to setOptions() anyway
    which in turn gets passed to curl_setopt_array()
    Akinyele Olubodun
    @akinyeleolubodun
    Exactly
    I have been debugging for many hours now
    Nick Sagona
    @nicksagona
    ok your header formatting looks a little off too
    there's no space after the colon and the capitalization isn't the same as the script that works... could be that maybe?
    and you don't have quote around your values
    ?
    Akinyele Olubodun
    @akinyeleolubodun
    I have tried everything
    Nick Sagona
    @nicksagona
    mp-master-key:cd391579-8347-e019144dcf0f,mp-private-key:live_private_fOqn7hRfjY1uY,mp-token:623aae45
    Akinyele Olubodun
    @akinyeleolubodun
    Hummm maybe that matters
    Let me change it and get back now
    Nick Sagona
    @nicksagona
    have you tried exactly like them?
    I would you'd have to do it exactly like them:
    CURLOPT_HTTPHEADER => array(
    "MP-Master-Key: cd391579-8347-e019144dcf0f",
    "MP-Private-Key: live_private_fOqn7hRfjY1uY",
    "MP-Token: 623aae45"
    )
    quotes, capitalization, spaces and commas just like that
    Akinyele Olubodun
    @akinyeleolubodun
    That is what I am trying to do now
    Akinyele Olubodun
    @akinyeleolubodun
    Getting the same error
    $curl = new Curl($api_details->url, [CURLOPT_HTTPHEADER => ["mp-master-key: cd3919144dcf0f", "mp-private-key: live_pRfjY1unqazGY", "mp-token: 623aae45"]]);
    Nick Sagona
    @nicksagona
    What's the error?
    Akinyele Olubodun
    @akinyeleolubodun
    I was meant to get "{"response_code":"1001","response_text":"Logon to your MPower account and set your integration mode to live"}"
    But I have been getting "{"response_code":"2001","response_text":"Exception, An Error Occured on the server."}"
    Nick Sagona
    @nicksagona
    are you checking the response in the curl object? looking inside there at the return headers and body and all?
    b/c it really seems like the issue is with the headers and the communication with the server (and not the pop curl object)
    Akinyele Olubodun
    @akinyeleolubodun
    This is how I am getting the response print_r($curl->getBody());
    Yeah I was able to track the issue to the header
    When I call $curl->getHeaders() nothing is returned
    Nick Sagona
    @nicksagona
    if you set CURLOPT_RETURNTRANSFER to true you should be able to look at the return response headers too for clues
    set CURLOPT_RETURNTRANSFER to true?
    Akinyele Olubodun
    @akinyeleolubodun
    It is set at default
    I mean I see other header info apart from the new one I set
    Nick Sagona
    @nicksagona
    ok well I'm about to head home from work here.
    I'll have to catch you later on
    Akinyele Olubodun
    @akinyeleolubodun
    okay
    Nick Sagona
    @nicksagona
    ttyl
    Stas
    @SedovSG
    @nicksagona Nick, Hello. We can help develop the project through Github or something?
    Nick Sagona
    @nicksagona
    Sure... contribution/collaboration is def welcome. And through GH would be the best way. You can submit issues or PRs to the different repos located under https://github.com/popphp/
    Currently a number of them are undergoing a refactor for a next version release.
    For example pop-db's functionality is being expanded to include support of 1:1 and 1: many relationships and DB migrations
    Stas
    @SedovSG
    Well
    Stas
    @SedovSG
    Hello. Perhaps the question would be weird, but still. I would like to use a framework in your project using composer. But I added several methods to class Db\Adapter\Pdo. And now, to connect PopPHP via composer I need to send those changes to the server (remote push) How can I be?
    Nick Sagona
    @nicksagona
    Well if you're asking about merging your work into the main repo, it would have to be reviewed and approved first. Typically, that's done by you submitting a pull request of your work so it can be reviewed.
    Stas
    @SedovSG
    So what to do now? How to claim?
    Nick Sagona
    @nicksagona
    Hey everyone - I'm moving the chat room for Pop over to a new location on Gitter. Please join me over there https://gitter.im/pop-php-framework/Lobby