-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to work with subscriptions, recurrent payments and transactions without leaving the site's page? #9
Comments
Recently I started to develop a deep revision of this module that includes REST integration (tokenization, 1 click payment, etc) but right now it is just a WIP. I'm afraid I can't give an estimation of time to complete these features due to a lack of time. |
Hi. My client need to implement suscriptions so I did some "homemade" changes over your package. In order to thank your work, I'll like to share my discoveries and changes with you. Maybe can be useful with your enhacement task, but notice that this procedure needs also changes in local service logic to work and a daemon or manual process to generate the "automatic" calls. I've read related doc of Redsys and I found two ways: Payment by Reference and COF (Credential on file). I think the best way to do this task is to pay with reference, because the COF payment has restrictions to 12 payments and check frecuency. With reference you can send a payment whenever you need. To make this work, in the first payment that you will process as usual, you have to include the variable When the payment is done, you will receive the var "DS_MERCHANT_IDENTIFIER" with a key value you have to store anywhere related to your client account. You'll also receive "Ds_ExpiryDate" wich indicates the date until you can send payments with this reference. (need to modify response.py to add this variables). Now you should be able to send payments and Redsys recomends to do this through WebService (SOAP). The signature uses an input string wich is (UPPER case is mandatory or Webservice won't recognize the variables): In difference with "usual" form payment, You DON'T HAVE to convert to base64 the parameters string when getting de HMAC256. so... Notice I don't call to client.prepare_request(parameters) because I don't prepare parameters in this case. (but sure you can develope and automate it in order to a cleaner code) Now you can generate de "BODY" of the SOAP-XML (includes your merchant_identifier (reference) ):
Finally, the webservice needs an input just like: All this code should be part of new functions in requests.py with recieve a simple dict and returns the final string. Now you can do a request with the lib requests adding the mandatory headers;
Now you can get the response which is HTML encoded: Also the REDSYS return code... (it's an XML and you can parse the way you need.. in my homemade case):
Surely, serverside must do things in case this code is 0 (or not).. just like the function that recieves URL_OKL/URL_KO when redirect. Hope this helps! |
Just wondering if this 3 things are implemented,
Thanks!
The text was updated successfully, but these errors were encountered: