Skip to content
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

As a user I would like to be able to process a payment #4

Closed
FredSoares opened this issue Sep 7, 2021 · 0 comments · Fixed by #14
Closed

As a user I would like to be able to process a payment #4

FredSoares opened this issue Sep 7, 2021 · 0 comments · Fixed by #14
Assignees
Milestone

Comments

@FredSoares
Copy link
Contributor

FredSoares commented Sep 7, 2021

Description

Once a user has configured the module with their credentials (#6 ) they should be able to process payments.

  • Create a function that should generate the payment form. This function should be generated Fingerprint to ensure that the data has not been altered upon submission, thus providing better security for payment processing. To find out how to do this, see the official documentation. And after that should generate and return the HTML form to process payments.
/**
 * GENERATE PAYMENT REQUEST FORM
 * @param {String} referenceId - Required - This is the payment reference. In this case, we need to know which payment was processed when the SISP returns the payment response.
 * @param {Number} total - Required - This is the amount SISP should process the payment.
 * @param {String} webhookUrl - Required - This is the URL the user should be contacted by SISP for payment response.
 * @returns {Document} response - HTML Form to process payments 
 */
generatePaymentRequestForm(referenceId, total, webhookUrl)

Note:

Testing Requirements

  • Ensure all criteria outlined in this ticket is tested.

Documentation/README

Function to generate Payment Request Form.

Function signature.

generatePaymentRequestForm(referenceId, total, webhookUrl);

Function parameters.

String referenceId - Required - This is the payment reference that allow us to know which payment was processed when the SISP returns the payment response.
Number total - Required - This is the amount SISP should process the payment.
String webhookUrl - Required - This is the URL the user should be contacted by SISP for payment response.

Note - webhookUrl should be created by the user as requested by SISP in their official documentation and the SISP will use it to make a request to send us a payment response.

Function return types.

return HTMLDocument - HTML form to process payments 

Usage example.

  1. Import SISP in your file that you want to process payment
 const sisp = require('sisp');
  1. Configure SISP payments with your credentials
const posID = 900512;
const posAutCode = "123456789ssA";

const sisp = new Sisp({ posID, posAutCode });
  1. Generate the HTML Form to process payment
// Example
const referenceId = '123abc';
const total = 1200;
const webhookUrl ='https://chuva.io/payment-response'
const htmlForm = await sisp.generatePaymentRequestForm(referenceId, total, webhookUrl);
@FredSoares FredSoares changed the title Create Payment service As a user I would like to be able to configure the project with my SISP credentials Sep 8, 2021
@FredSoares FredSoares changed the title As a user I would like to be able to configure the project with my SISP credentials As a user I would like to be able to configure the project with my SISP credentials and process payment Sep 8, 2021
@FredSoares FredSoares reopened this Sep 8, 2021
@FredSoares FredSoares changed the title As a user I would like to be able to configure the project with my SISP credentials and process payment As a user I would like to be able to process payment with SISP credentials Sep 8, 2021
@nnascim nnascim added this to the Backlog milestone Sep 9, 2021
@nnascim nnascim changed the title As a user I would like to be able to process payment with SISP credentials As a user I would like to be able to process a payment Sep 9, 2021
@nnascim nnascim modified the milestones: Backlog, MVP Sep 9, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 13, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 15, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 16, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 16, 2021
FredSoares added a commit to FredSoares/sisp_payments_js that referenced this issue Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants