• Resolved Marco1970

    (@marco1970)


    Hi all,

    I recently moved hosting my simple Vipps-based payment website from WPEngine to Webhuset, and the Vipps payment broke, with this message always appearing when I click ‘Betal med Vipps’:

    Dessverre så er Vipps-betaling ikke tilgjengelig for øyeblikket. Vennligst velg en annen metode.

    Few details:

    1) I am on production Vipps API (a.k.a “live”)
    2) The woocommerce / vipps plugin settings are exactly the same as I had on WPEngine (same client ID, keys, etc..)
    3) The Vipps error log is useless, just showing this message: “ERROR Kunne ikke opprette Vipps-betaling 500 Internal error”

    I already searched around, and several posts claim it is a firewall issue, blocking outgoing connections from 443 to Vipps API servers. But Webhuset claims there is no such firewall. So, before I go down the way of fighting with their support, few questions:

    1) Is there a way I can SSH on my Webhuset server, and issue a command and/or CURL test request to see if the outgoing connection to Vipps API is blocked?

    2) Are there any specific PHP extensions I need to enable to support Vipps? “ssh2”, “soap”, … ?

    Thanks in advance for your help.

    m

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Iver Odin Kvello

    (@iverok)

    Hello,

    The error log isn’t quite useless; in this case it means that communication with the Vipps servers was unsuccessful with a 500 error. I don’t think that error actually comes from Vipps, as that would be a major problem; so it is very much likely that external calls are blocked.

    The Vipps plugin is written to require very few dependencies; you do however need to have allow_url_fopen to be set to true in your configuration. You don’t need soap or ssh2.

    To test your outgoing connections, you would need to call https://api.vipps.no (or https://apitest.vipps.no for the test API). To initiate payments, you would need to do a “POST” to https://api.vipps.no/Ecomm/v2/payments. You should get an ‘Unauthorized’ error back.

    Thread Starter Marco1970

    (@marco1970)

    Wow, awesome help, thanks!!! I will make sure to try all you have suggested.

    Thanks

    m

    Thread Starter Marco1970

    (@marco1970)

    Hi,

    here is the response from the POST call to ‘/payments’:

    string(152) “{ “statusCode”: 401, “message”: “Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.” }”

    does this mean external call are allowed?

    TY

    m

    Plugin Author Iver Odin Kvello

    (@iverok)

    Yes, that error code is from Vipps’ servers.

    Could you check that you are not for some reason calling the test API? It is extremely uncommon to get 500 errors from Vipps (a little less common to the test api).

    Thread Starter Marco1970

    (@marco1970)

    Hi

    thanks for following up 😉

    1) I actually did a proper test against Vipps API by requesting the token (‘/accesstoken/get’) and passing all the headers with the same values as I have in the Vipps plugin config (client id, client secret, etc.), and that worked perfectly, returning me a valid token.

    So from a standalone CURL test in PHP, the connection to Vipps live API seem to work just fine.

    2) How do I check for test API calls? Do I need to monitor outgoing connections from the server?

    m

    Thread Starter Marco1970

    (@marco1970)

    Sorry, just to confirm:

    1) Vipps plugin is on live mode, NO test mode activated

    2) PHP allow_url_fopen in on

    m

    Thread Starter Marco1970

    (@marco1970)

    Hi,

    I can also confirm that the Vipps API token is properly retrieved and stored into the transient ‘_vipps_app_token’, when the ‘Betal med Vipps’ button in the checkout is clicked.

    m

    Thread Starter Marco1970

    (@marco1970)

    Ok,

    dig around, and it is the initiate payment call, which return with this:

    [{“errorGroup”:”Payment”,”errorCode”:”99″,”errorMessage”:”Internal error”,”contextId”:”5d92543e-661c-4fbe-a313-60395ec4a95e”}]

    I will investigate more.

    m

    Plugin Author Iver Odin Kvello

    (@iverok)

    That is a response from the Vipps servers, yes. So you are not blocked.

    If you are digging on that level, you can try to add a line to VippsApi.class.php line 396 to log the variable ‘$url‘. This will be either api.vipps.no or apitest.vipps.no.

    If it is api.vipps.no you should first check all your data on portal.vipps.no, and then contact Vipps directly on integration@vipps.no – you should normally never get 500 errors in an API since that means something is wrong on their side.

    If it is the test API, it can happen from time to time; but if this was the case you should be notified in the WordPress backend about the test api being active.

    Thread Starter Marco1970

    (@marco1970)

    Hi,

    thanks. Forgot to say, I already printed out $url, and it is 100% live API.

    I will contact integration@vipps.no and see what is going on 😉

    thanks for all the help

    m

    Hi

    We have received the email, and are looking into it.

    As mentioned: Although we respond with “HTTP 500 Server Erorr”, this is usually caused by a bad API call, which should have resulted in a “HTTP 400 Bad Request”. Adding validation is not as simple as one might think, so we have no quick fix, sorry.

    We have found a stacktrace, and are looking into the reason for the uncaught exception, and how to fix this.

    In general: Vipps only needs a correct request with the correct API credentials. We do not rely on hostnames, IP addresses, etc.

    Christian, Vipps

    Plugin Author Iver Odin Kvello

    (@iverok)

    Thank you. I cannot replicate this with my keys, and I can’t recall ever having gotten a 500 either, so I’m not much help.

    Hi, @marco1970

    It seems you are using an existing orderId:

    DuplicateOrderException: OrderId Tidbit60 already exists for merchantSerialNumber 571756

    We should, of course, handle this more gracefully, and will make an internal issue for this. As mentioned, fixing it is not trivial.

    Christian, Vipps

    Plugin Author Iver Odin Kvello

    (@iverok)

    Oh! I used to get an actual error message for that in the past.

    The good news is that you can easily fix this by changing your Order Prefix in the Vipps settings.

    The bad news is that you may now have several orders with the same order id, some from your old site and some from the new, probably made in the moving process. You will probably need to check order emails to straighten that out.

    Hi, @marco1970 and @iverok

    It seems we handle this differently for direct eCom integrations and for PSPs (Payment Service Providers):

    * eCom: Duplicate orderId gives a 500 error and a general error message
    * PSP: Duplicate orderId gives a 500 error and information about the duplicate id

    We will try to change both to “HTTP 400 Bad Request” and a specific error message.

    Thanks for reporting this!

    Christian, Vipps

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘Vipps for Woo and Webhuset hosting’ is closed to new replies.