Wallogit.com
2017 © Pedro Peláez
PHP Wrapper for PlaceToPay integration.
PHP Wrapper for PlaceToPay API integration., (*1)
1) Make sure add composer.json file to project root directory
2) Run installation composer command composer require deedee2025/placetoplay
3) Load composer autoload file in you project as you prefer. e.g:
include_once __DIR__ . '/vendor/autoload.php';, (*2)
Before start to use the wrapper's methods, you need authenticate via API:, (*3)
PlaceToPay::authenticate( $yourLogin, $yourTransactionKey );
You can get information about a transaction after authentication using the method below:, (*4)
$transaction = PlaceToPay::getTransactionInformation($transactionID);
Also, if you've done any request before, you can get all information about the latest requests using the method below:, (*5)
$info = PlaceToPay::getStoredTransactionsInfo();
NOTE: The last method uses PHP session to get the latest request IDs made., (*6)
You can generate new transaction to PSE API using the method below:, (*7)
$request = new PSETransactionRequest( $param ); $storeIds = true; $result = PlaceToPay::createTransaction( $request, $storeIds );
Also, you can call PlaceToPay::printRequestForm( '/' ) method to print an automatic form to make the request and
replacing $params argument by $_POST to pass the form's values to the request., (*8)