1. Chris Pritchard

    Chris Pritchard New Member PemBer Owner

    Hello Sadik,

    We are getting an error when testing the Stripe option in XF 1.5. It looks like XF is passing the name parameter but Stripe's API doesn't know what to do with it.

    The Stripe API returned the following error.
    invalid_request_error - Received unknown parameter: name


    Does the name parameter have to be defined in the Stripe dashboard?

    Thanks,
    Chris
     
  2. Sadik

    Sadik Administrator Staff Member PemBer Owner

    Hi Chris

    Yes this is a known issue. Actually Stripe has made a change in their API.

    Replace the file library/PemBer/Model/Stripe.php with the attached file Stripe.php.

    This fix is part of the next version.

    For reference for developers, in library/PemBer/Model/Stripe.php line 656 was changed from
    PHP:
     "name" => $product['title'],
    to

    PHP:

    "product" => array(
     
    "name" => $product['title'],
    ),
    Best Regards,
    - Sadik
     

    Attached Files:

  3. Chris Pritchard

    Chris Pritchard New Member PemBer Owner

    Thanks Sadik. This works great.

    Chris
     
  4. MATeam

    MATeam New Member PemBer Owner

    I'm working on setting mine up and I'm getting the following error... (note I had replaced the original stripe.php with the one in this thread.. per the instructions (i.e. put in the library.)

    end_Db_Statement_Mysqli_Exception: Mysqli statement execute error : Incorrect integer value: '' for column 'user_id' at row 1 - library/Zend/Db/Statement/Mysqli.php:214

    Stacktrace:
    #0 /.....RemovedPath/public_html/library/Zend/Db/Statement.php(317): Zend_Db_Statement_Mysqli->_execute(Array)
    #1 /.....RemovedPath/public_html/library/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
    #2 /.....RemovedPath/public_html/library/Zend/Db/Adapter/Abstract.php(574): Zend_Db_Adapter_Abstract->query('INSERT INTO `xf...', Array)
    #3 /.....RemovedPath/public_html/library/XenForo/Model/UserUpgrade.php(532): Zend_Db_Adapter_Abstract->insert('xf_user_upgrade...', Array)
    #4 /.....RemovedPath/public_html/library/PemBer/Webhook.php(161): XenForo_Model_UserUpgrade->upgradeUser(false, Array)
    #5 /.....RemovedPath/public_html/library/PemBer/Webhook.php(75): PemBer_Webhook->processWebhook()
    #6 /.....RemovedPath/public_html/stripe_callback.php(26): PemBer_Webhook->process()
    #7 {main}

    Request State:
    array(3) {
    ["url"] => string(52) "https://.....removed URL/stripe_callback.php"
    ["_GET"] => array(0) {
    }
    ["_POST"] => array(0) {
    }
    }
    Any idea what that is? Also I notice strip picked up 4 of the 6 offerings. I.e. it doesn't show all the offerings I have on the site.
     
  5. MATeam

    MATeam New Member PemBer Owner

    Ignore that error - figured it out. :)
     
    Sadik likes this.
  6. Sadik

    Sadik Administrator Staff Member PemBer Owner

    Glad to hear it's sorted.
     
  7. MATeam

    MATeam New Member PemBer Owner

    Ok so I thought this was fixed, but got this error on Saturday:

    Server Error Log
    Exception: The Stripe API returned the following error. <br /> invalid_request_error - No such customer: cus_CcEfXwacvSLfsS; a similar object exists in test mode, but a live mode key was used to make this request. <br /> Please contact the site Administrator for help. - library/XenForo/Error.php:261
    Generated By: XXXX Saturday at 12:06 PM

    Says it was generated by me on Saturday.. assume that is the logging. I.e. I didn't try to purchase anything saturday.

    PemBer Transaction log doesn't show anything.

    A few additional questions:
    1) When a user purchases this, do I only choose the secondary group (I.e. Premium Membership) or do I need to choose both Registered and Premium? I assume for Guest that are registering for the first time, it automatically puts them into Registered and I only have to choose the secondary group.. Note, I do allow free membership. Does that question make sense?
    2) Stripe is only showing my subscriptions as "products" it does not show my single payment options. Is that normal?
     
  8. MATeam

    MATeam New Member PemBer Owner

    Pressed send to quickly - question 3
    3) I'm not seeing any data from the stripe webhook. I have confirmed stripe_callback.php is in the public html root. I actually just received a note from Stripe on this. Charges are going through though.

    <<Update - this appears to be fixed.. stripe confirmed a few minutes ago. I’ll be able to confirm as I see more transactions come through>>
     
    Last edited: Apr 10, 2018
  9. Sadik

    Sadik Administrator Staff Member PemBer Owner

    Hi @MATeam I am not sure I fully understand your questions. But I will try to answer from what I figured.

    This looks like you are trying to search a test transaction through the API but the system (key used) is Live. This is probably happening because you went to purchase details page which has test transactions after you switched Stripe to Live. I cannot be 100% sure though. But I would venture and say that there is nothing to worry about here.

    Yes you should only choose the secondary membership group which you want the user to have after he makes the purchase. XenForo (unless you have changed configuration) automatically puts a user into Registered usergroup when a Guest registers, even without PemBer. What PemBer does is it puts the user into the usergroup which you select when creating the product.

    I am assuming you mean in the Stripe Dashboard. Yes. Single Payments don't need to be predefined in Stripe. It's just a normal "charge" which will show when someone purchases through Stripe. On the other hand Recurring plans need to be predefined in Stripe which PemBer does for you.

    OK. Sounds good. Let me know if you encounter any issues.

    Best Regards,
    - Sadik
     
  10. MATeam

    MATeam New Member PemBer Owner

    Good deal - that is what I was thinking so I had set it up that way.
     
    Sadik likes this.
  11. MATeam

    MATeam New Member PemBer Owner

    Ok - Regarding the rest, I’ll do some more testing to confirm. Thanks for the help.
     
  12. Sadik

    Sadik Administrator Staff Member PemBer Owner

    You are welcome. If you stumble anywhere, feel free to ask... :)
     

Share This Page