Redsys | Simple php class with redsys soap | SOAP library
kandi X-RAY | Redsys Summary
kandi X-RAY | Redsys Summary
Simple php class with redsys soap
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Validate a code
- Create the form for the gateway
- Get the path to the environment
- Check for Redsys response
- Get the response
- Checks the response
- build the request xml
- Sets the payment amount
- Generate Merchant Signature
- Encrypts data from DDES - CBC
Redsys Key Features
Redsys Examples and Code Snippets
Community Discussions
Trending Discussions on Redsys
QUESTION
I´m traying to create a dynamic button with jquery and API Redsys. But i want to change value for default to this button and i´m traying to do this:
...ANSWER
Answered 2022-Mar-17 at 13:10You could like this:
QUESTION
I´m traying integrate Redsys API in my app. All Api it´s integrated but my question it´s that in my project i need open form redsys in modal with iframe. In my controller i have all my code to create a petition to servers and return a form:
...ANSWER
Answered 2022-Mar-17 at 12:17I solved my problem. In my app i´m using a library and i don´t knew. And this library have a mrthod to generate this form but not send it:
QUESTION
I am new to PHP, and I don't know if this can be done. I am building an online shop, and I would like to save the order in the database before sending the data to the payment gateway. As I am sending the data to an external page (payment gateway), I cannot record the buyer's data first without having to perform an extra step (page).
EDIT: I should have mentioned that I have shortened the code I have attached. Yes, there is a cart which is in SESSION and where I have all the order details. The problem is that the method I use from Redsys is redirection. I delegate the payment to their gateway by sending it some fields in an array. So when the user clicks the "Pay" button, I leave my website and go to the gateway, the payment is made there and if everything has worked, the gateway allows me to go to a URLOK or URLKO. What I try is that in the checkout form, which consists of the buyer / client data and the "sumit" button that redirects to the gateway, before going to the gateway URL, insert the order in status "PENDING", and then when it returns from the URLOK or URLKO update the status. In short, I need to perform these two steps with a single click:
- INSERT in DB
- SUBMIT data to REDSYS Gatewey
Otherwise, you would have to carry out an extra step, first making a form in which the buyer and order data are saved and second making an extra screen of the type "Check your data" and then send what is necessary to the gateway.
...ANSWER
Answered 2020-Nov-01 at 16:27Traditionally, in an online store all ordered items are collected in a virtual cart before being made into an order. Typically, you'd then assign an id to your order, which you might then use in all your customer communication.
This way, you'd have your own persistent copy of the order which you can use to keep state. If the payment fails, you can alert the user and provide a retry attempt, without them having to go through the whole process again.
However, your code makes no mention of a cart or order items, so I won't assume this is the case. If your flow needs to redirect the user to the gateway immediately upon confirming the purchase, then you should consider making the API request from PHP. From looking at the Redsys API, this is functionality that they provide. Take a look at their REST API.
UPDATE
It seems your flow requires the user to actually leave your website and visit the PSP. This is a common scenario.
If you just want to catch the confirmation action before the user leaves your site, you could issue the redirect in JavaScript, just after an XHR ('Ajax') to your server completes. If you haven't saved the $_SESSION
data before this point, this will be a good time and place to do that too.
The XHR will only call some back-end PHP that you wrote which sole job is to catch the confirmation action. Write your script to update the order in the database when you're receiving a POST request containing purchase_confirmed=1
. It might output some JSON back to your JavaScript (json_encode(['success' => TRUE])
), which in turn will trigger a form submit.
One of many possible approaches is to use jQuery for this, as demonstrated below (UNTESTED!). If you need vanilla JavaScript, then please consult You Might Not Need jQuery. Getting into the details of the Fetch API or other (possibly better) solutions is beyond the scope of your question.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Redsys
PHP requires the Visual C runtime (CRT). The Microsoft Visual C++ Redistributable for Visual Studio 2019 is suitable for all these PHP versions, see visualstudio.microsoft.com. You MUST download the x86 CRT for PHP x86 builds and the x64 CRT for PHP x64 builds. The CRT installer supports the /quiet and /norestart command-line switches, so you can also script it.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page