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

An uncaught exception has occurred: An error was encountered indicating that the specified path is not valid for either posix or windows systems, and it appears that there is no 'join' method defined in the

I am currently working with nextjs version 13.5.6 using the app router and app directory. This issue arises during the compilation of the route app/(home)/page.js. The folder and file structure within the app folder is as follows: app/ -(home)/page.js -ser ...

The rule "react/jsx-sort-props" does not have a valid configuration

I've been attempting to organize props names alphabetically using the eslint-plugin-react plugin but I keep encountering this error: [Error ] .eslintrc.json: Configuration for rule "react/jsx-sort-props" is invalid: Value {"callbacksLast":true,"shorth ...

Tips on preventing repeated data fetching logic in Next.js App Routes

I'm currently developing a project with Next.js 13's latest App Routes feature and I'm trying to figure out how to prevent repeating data fetching logic in my metadata generation function and the actual page component. /[slug]/page.tsx expo ...

Activate the zoom feature in jquery mobile

I am looking to implement the standard zooming effect in jquery mobile for my iOS iPhone app using jqm 1.3.2. After attempting the following: <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, user-s ...

ng-repeat isn't displaying the data

I have always been comfortable using the ng-repeat in Angular, but this time I seem to be facing a problem. I am trying to populate my DOM with data from a JSON file, but for some reason, the fields are not displaying as expected. Is there something wrong ...

What is the process for uninstalling Vue CLI 2 from my system?

I am looking to start a new vue project using @vue/cli . It seems that the vue/cli has been updated to version 3. The documentation I found is located at and I am currently running ubuntu 17.10, attempting to uninstall vue-cli using npm uninstall vue-cl ...

Is it possible to adjust the size of a p5.js canvas within a bootstrap Div container?

I am attempting to incorporate a p5js canvas into a bootstrap grid structure. My goal is to have each div within the grid contain its own unique p5js canvas, which should adjust in size when the browser is resized. Below is my bootstrap grid setup, showca ...

What could be the reason for the malfunctioning of the header() function in PHP

Currently, I'm utilizing AJAX to facilitate user registration for a service. Here's the code snippet for the submit button: <input type="button" id="register" name="register" class="btn btn-success" onclick="registration();" value="Register"/ ...

How can you direct a user to a specific page only when certain conditions are met?

Currently using React in my single page application. I have a good grasp on how Routes function and how to create a PrivateRoute. The issue arises when I need to verify the user's identity before granting access to a PrivateRoute. My attempt at imple ...

What is the best way to fill a Vue.js data variable with JSON retrieved from a function?

I have a project that incorporates jQuery, and within the codebase are numerous functions designed to return JSON data. I am currently attempting to populate a data variable with test data, but unfortunately, when I iterate through the data, nothing is bei ...

Passing state updates between child components by utilizing the useReducer hook and dispatching actions

Check out this interactive example on CodeSandbox with the code provided and highlighted linting issues: https://codesandbox.io/s/react-repl-bw2h1 Here is a simple demonstration of my current project setup. In a container component, there is an important ...

Select the default option and what occurs in the event of an HTTP connection

I am currently facing an issue with two aspects. Firstly, I am struggling to set a default option in my Select element. Despite using ng-model, it only displays a blank option at the moment: <select class="form-control" ng-model="pageSize"> ...

Resolving parent routes in Angular 2

I am encountering an issue with my code. The 'new' route is a child route for the 'users' route. The 'users' route has a resolver, and everything works fine up to this point. However, after successfully creating a new user, ...

Placing information within a nested array with multiple levels of nesting

I'll try to keep this concise, Here is the structure of the schema... import mongoose from 'mongoose' const QuestionSchema = mongoose.Schema({ questionTitle: { type: String, required: " title"}, questionBody: { type: Stri ...

Is there a way to link code and unit testing directly to npm test?

Is there a method to conduct unit testing in real-time on my server without having to create temporary files? I am looking for a way to supply both the code to be tested and the corresponding unit test to npm test. The information provided in the npm test ...

Is it advisable to disregard mutation handlers in Vuex and consistently modify the store data directly?

When opting to directly mutate store data without using mutation handlers, you may find yourself writing significantly less code compared to following official guidelines that require computed properties and store mutations for nested state properties. In ...

Error: Node.js exceeds maximum call stack size while inspecting an objectlogging or debugging

After defining a class as shown below, I encountered an error stating RangeError: Maximum call stack size exceeded when attempting to review the properties of the Object. var Individual = (function () { function Individual(name, age) { this.na ...

What are the signs that indicate a potential code breakage following an upgrade of the JavaScript library in use?

Imagine you have incorporated multiple JavaScript libraries into your website. Your code interacts with various APIs, but occasionally, after an update, one of the APIs changes and causes your code to break without any prior notice. What steps can you tak ...

Exploring Jasmine and Karma for testing Angular 5 HTTP requests and responses

I am brand new to the concept of Test-Driven Development (TDD) and I am currently in the process of debugging a complex Angular 5 application for the company I work for. The application is functioning without any issues, but now I need to incorporate test ...

Tips on showcasing a set number of elements from an array in React

How can I modify my code to display only a specific number of items from the 'portfolioComponents' array, starting at a designated index ('startArrayHere') and incrementing or decrementing that index based on user interaction? I've ...