Download the PHP package undostres-com-mx/superapp_sdk without Composer
On this page you can find all versions of the php package undostres-com-mx/superapp_sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download undostres-com-mx/superapp_sdk
More information about undostres-com-mx/superapp_sdk
Files in undostres-com-mx/superapp_sdk
Package superapp_sdk
Short Description SDK for undostres superapp.
License proprietary
Informations about the package superapp_sdk
SuperApp SDK
Composer account
The composer account used was [email protected], for troubleshooting please contact.
Composer installation
Composer is needed, if missing do:
Installation
If composer.json is present and has the package in the requirement list do:
Otherwise, use the require instruction to add or create a composer.json
Update
To update this package, inside the composer.json folder do:
Usage
The use of composer requires the usage of require_once('/vendor/autoload.php');
Import the SDK using use UDT\SDK\SASDK;
Initialize the static class SASDK::init(hashKey, server);
On SASDK instance you can do:
-
encryptSDK($data) : (Input: Array of data, Output: String)
- Encrypt string with 3des algorithm.
-
decryptSDK($data, $decode) : (Input: String, Output: String or object)
- Decrypt string with 3des algorithm.
-
decryptUDT($data) : (Input: String, Output: String)
- Decrypt string with UDT algorithm.
-
validateRequestHeaders($apiKey, $apiToken) : (Input: Data on received api headers, Output: Bool)
- Check api/token to see if request is authentic.
-
formatMoney($money) : (Input: String or numeric, Output: Float with udt standards)
- Gives the standard UDT format to money, decimal separated by dot, no comma.
-
createPayment($json) : (Input: Payment JSON (See Test.php), Output: Object)
- Create an order and retrieve payment url.
-
cancelOrder($paymentId) : (Input: Payment id to cancel, Output: Object)
- Cancel a pending order on UDT.
- refundOrder($paymentId, $transactionId, $value) : (Input: Payment id, transaction id and value to refund, Output: Object)
- Refund a paid order on UDT.
Key utils
Do the following on project root folder to use the key utilities:
- Create hash key.
- Read hash key (Given by UDT).
- Read udt hash (User data encoded on url).
Local testing
To make test calls it's needed to have a ssl certificate, to do so download the certificate and update your php.ini with yout path like this:
The certificate can be downloaded here.
Do the following on project root folder to open the testing utilities:
Then you can make successful calls.
Keep in mind that to make a payment you need a return and callback api. If you don't add it to the request the payment is always going to fail.
Authors
- Carlos Miranda
- Adrian Garcia
All versions of superapp_sdk with dependencies
ext-curl Version *
ext-json Version *
ext-openssl Version *
opis/json-schema Version 1.*