How should a value of the super global $ _POST be entered into a class.
I have tried many ways, but to no avail. This value will be treated within the class.
How should a value of the super global $ _POST be entered into a class.
I have tried many ways, but to no avail. This value will be treated within the class.
Rescue the parameter received by the post method
$transaction_code = $_POST['transaction_code'];
Once this is done, go to the class method parameter:
PagSeguroTransactionSearchService::searchByCode($credentials, $transaction_code);
Complete example
<?php
$transaction_code = $_POST['transaction_code'];
PagSeguroTransactionSearchService::searchByCode($credentials,$transaction_code);