How does the implementation should work?
- When the customer confirms the purchase on your website, the service must be consumed to perform the createRequest with the explained parameters.
- If the request is successful, it returns the URL to which the client should be redirected to perform payment. Otherwise it returns the reason for the rejection of the transaction.
- Redirect the browser to the URL returned on success.
- Once the transaction returns (returns to the URL specified in the createRequest consumption), you should ask about the status of the transaction by consuming the getRequestInformation.
- Depending on the response of the service, the transaction may be approved, rejected or pending further processing.
- Inform the user the status of the transaction.
- If the transaction is pending, or if the customer abandon the website and was not returned, you must have a cron job that ask for the status of the pending transactions. You must consume the service only after the expiration date that you send in the original request.