All what you need is learning how PayPal uses and recreate account mail on sandbox.paypal.com
in other word https://developer.paypal.com/
. For creating testing (sandbox) account with virtual money you need for main account on sandbox register on a developer.paypal.com.
After processing you should configure properly of data on PayPal account and step on guides of sandbox developer. For example how is checking out of buyers uses (look code ECSetExpressCheckout).
First look of guide PayPal (this is general):
Looking for paypal payments tutorial
This is main site how manipulate with PayPal:
https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/library_code
You want manipulate for success payment (look at ECSetExpressCheckout, MOSTLY COMMON FOR TRANSACTIONS):
Source code here: https://cms.paypal.com/cms_content/CA/en_US/files/developer/nvp_ECSetExpressCheckout_php.txt
Focus on code:
$paymentAmount = urlencode('30'); // 30 USD if you set on sandbox default
$currencyID = urlencode('USD'); // or other currency code ('GBP', 'EUR', 'JPY', 'CAD', 'AUD')
$paymentType = urlencode('Order');
$returnURL = urlencode("my_return_url"); // YOUR URL IF SUCCESS
$cancelURL = urlencode('my_cancel_url'); // YOUR URL IF FAILED
If you need check a transaction after payment grab via TRANSACTION_ID with GetTransactionDetails function: https://cms.paypal.com/cms_content/CA/en_US/files/developer/nvp_GetTransactionDetails_php.txt