What's causing the failure in the execution of the "Verify version" step?

Upon reviewing the 3DSecure GlobalPay documentation, my team decided to integrate it using JSON, incorporating our own client-side implementation. This decision was made because we already have another integration with a different 3DS verification service in production. The current integration is being developed using Vue.JS and Laravel.

In the GlobalPay documentation, they provide a sample request as follows:

curl https://api.sandbox.globalpay-ecommerce.com/3ds2/protocol-versions
-H "Content-type: application/json"
-H "X-GP-VERSION: 2.2.0"
-H "Authorization: securehash 0204a841510d67a46fbd305a60253d7bade32c6e"
-X POST
-d '{
   "request_timestamp": "2019-07-30T08:41:07.590604",
   "merchant_id": "MerchantId",
   "account_id": "internet",
   "number": "4263970000005262",
   "scheme": "VISA",
   "method_notification_url": "https://www.example.com/dsNotificationUrl"
}'

We have created a method within a Vue.JS component to send a POST request to this version checking endpoint. The code snippet for this can be observed below:

methods: {
    verifyTds(price) {
        this.setTdsAuth(price);
    },
    setTdsAuth() {
        // Implementation details here...
    },
    // Other methods...
}

In generating the securehash for the Authorization header, we follow a specific procedure in PHP backend which involves creating a hash based on various parameters and timestamps.

The attempt to establish connection results in an ERR_CONNECTION_RESET error and when tested in Postman, it returns a 415 HTTP response (Unsupported Media Type). We are currently in the process of verifying our credentials but are seeking advice on other potential points that should be inspected.

Answer №1

Upon contacting GlobalPay, they recommended utilizing their PHP SDK as the best choice for our technology stack. We have since implemented it and successfully verified the version checking process.

Answer №2

If you encounter issues with the JSON, it may be related to authorization. The authorization includes a scheme called "securehash" and a parameter which is the sha1hashed value. Authorization can be configured separately from other headers.

Here is a sample code snippet that demonstrates how to send a JSON request using System.Net.Http in C#:

    public static string SendJsonHttpClientRequest(string jsonobject, string url, string authorization)
    {
        var client = new HttpClient();
        client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("securehash", authorization);

        var request = new HttpRequestMessage
        {
            Method = HttpMethod.Post,
            RequestUri = new Uri(url),
            
            Headers =
            {
                {"X-GP-VERSION", "2.2.0" },


            },
            Content = new StringContent(jsonobject, Encoding.UTF8, "application/json")

        };
        

        var result = client.SendAsync(request).Result;
        var content = result.Content.ReadAsStringAsync().Result;

        return content;
    }

Additionally, ensure that the account or sub-account being used is configured with 3dSecure 2, and there are different test cards for Message Version 2.1 and 2.2.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Techniques for Sending Data to Child Components in Vue.js

As a newcomer to Vue.js, I am attempting to pass a value to a child component within the framework. The HTML structure is as follows: <div id="example"> <my-component v-bind:data="parentData"></my-component> </div> To achieve ...

Modifying URLs with backbone.js

When it comes to my Backbone module, I typically access it via the URL: http://localhost/src/index.html#test_module However, there is another module that I need to view which can be accessed using the URL: http://localhost/src/index.html#test_module ...

What are the steps to manipulate the data within an EJS file after passing an array through Node.js as an object?

I'm currently developing a simple calendar application using Node.js and ejs. I am working on passing an array of months through express to my ejs file, with the goal of being able to cycle through each month by clicking the next button. How can I imp ...

What is the process for converting a URL or HTML document to a PDF using the html2pdf JavaScript library?

I am working on creating a button that utilizes the html2pdf library to convert an HTML page into a PDF. Instead of selecting an element with query selector or getElementById, I would like to pass a URL because the page I want to convert is not the same as ...

What is the process for selecting the default option in a drop-down menu?

Is there a way to set the default value in a drop-down list using material-ui? I attempted to use displayEmpty="true", but it did not work. I want the first option, A, to be pre-selected so that it is visible to the user in the UI without them having to m ...

Is there a way to retrieve posts by year and month using nextjs and contentful?

Currently, I am in the process of setting up a blog using Next.js and Contentful CMS. The structure of my folders is set as follows: pages/blog/[year]/[month]/[slug].js Each year and month folder contains its own index.js file. Currently, my focus is on ...

Development of client and server using socket.io in node.js

I am trying to set up a basic demo using socket.io from http://socket.io The server (app.js) is functioning properly. However, I am encountering issues with the client side: <script src="/socket.io/socket.io.js"></script> <script ...

Filter products by price using Ajax in Shopify with Liquid code

I am looking to implement a custom product price filtering feature for my collection without relying on an app. Unlike the traditional price filter option, I want users to be able to input any combination of numbers, such as between $4 and $20 or $7 and $3 ...

Triggering a gTag Event on the Fly using Google Tag Manager

I implemented a script that triggers a dynamic gTag.js AdWords conversion based on various user interactions on my webpage. Everything was working smoothly until I switched to Google Tag Manager. Now, the code snippet: gtag('event', 'convers ...

Several DIVs with the same class can have varying CSS values

I am looking to modify the left-margin value of various separate DIVs using JavaScript. The challenge is: I only want to use a single className, and I want the margin to increase by 100px for each instance of the class. This way, instead of all the DIVs ...

Is there a JavaScript toolkit specifically designed for animating mobile devices?

Currently in search of a JavaScript Library that is similar to impress.js, allowing me to create dynamic animations on text content that are compatible with iOS/Android. Although Hype by Tumult seems promising, I am not interested in an editor but rather ...

Is there a way to securely embed YouTube videos in my web application without exposing the direct video links?

I'm hoping to integrate YouTube videos into my web application, but I need a way to prevent users from accessing the direct video links while they are using the app. Does anyone have any suggestions on how this can be accomplished? I am unsure of how ...

Execute JavaScript function after completion of CSS animation using jQuery

I'm working on an accordion feature that uses CSS animation to expand the clicked item. The expansion is triggered by li:target. However, I'm facing an issue where when clicking on an item, the scroll position doesn't align correctly with t ...

What is the best way to convert a 2D PHP array into a JavaScript array?

I have encountered a problem with a PHP array setup as follows: $output = array(array(1,1,1,1),array(2,2,2,2),array(3,3,3,3)); When I encoded the array to JSON, I received this output: $output = {"1":[1,1,1,1],"2":[2,2,2,2],"3":[3,3,3,3]} My goal is to ...

Error: Unable to access the 'category_affiliation' property of null

After implementing a login function using redux state, I encountered an issue upon logging in. The error message TypeError: Cannot read properties of null (reading 'category_affiliation') is being displayed in my Sidebar.jsx file. It seems like t ...

Encountered a Error: [$injector:modulerr] while integrating Angular JS with the mysterious Planet 9

I encountered an error after implementing AngularJS in Planet 9. Planet 9 is a tool built on top of SAP UI5, offering drag and drop functionality as well as the ability to include HTML, CSS, and JavaScript. I needed to use ng-repeat for an application, so ...

Tips for updating marker information upon clicking in React-leaflet

I am working on a React-leaflet map that displays markers on the left side, while on the right side, there is a list of point names. I want the behavior to be such that when a marker is clicked, the corresponding point name moves to the top of the list. Th ...

Submitting a form with AJAX and additional fields can be accomplished by including the extra fields in

Imagine a scenario where I am working with a basic form like the one below <%= form_for(@category) do |f| %> <% if @category.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@category.errors.count, "erro ...

Discovering WebElements nested within other WebElements using WebdriverJS

Looking at this HTML structure <div> <div> <p class="my-element"></p> </div> <div> <div> <div> <p class="the-text"> I want to retrieve this text</p> </div> </div> <div> ...

Tips for running a function at regular intervals in NodeJS

I've experimented with the setInterval() method before. While it seemed ideal, the problem I encountered was that it didn't start the first call immediately; instead, it waited for X seconds before producing the desired value. Is there an alterna ...