|
Rank: Starting Member
Groups: Registered
Joined: 2/23/2006 Posts: 2 Location: ,
|
I have some PHP code attempting to perform a mass payment. The return is Success from Paypal, however, the payments never complete. They always show processing... The accounts I am sending money to exist in the sandbox, and the code executes fine. I can't get any help at the Paypal boards, can someone here please help me out. I need this to function before I can go live. Here is my code:
function perform_mass_pay($Email, $Amnt)
{
global $apiuser;
global $apipass;
$ReceiverEmail=$Email;
$Amount=$Amnt;
$username = $apiuser;
$password = $apipass;
$Note = "TEST PAYMENT";
$emailsubject = "TEST PAYMENT";
$sslcertpath = "/home/webmagik321/paypal/certificates/api_cert.pem";
$SOAPrequest = "<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope
xmlns:xsi='http://www.w3.org/1999/XMLSchema-instance'
xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'>
<SOAP-ENV:Header>
<RequesterCredentials xmlns='urn:ebay:api:PayPalAPI'
SOAP-ENV:mustUnderstand='1'>
<Credentials xmlns='urn:ebay:apis:eBLBaseComponents'>
<Username>$username</Username>
<Password>$password</Password>
<Subject/>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<MassPayReq xmlns='urn:ebay:api:PayPalAPI'>
<MassPayRequest xsi:type='ns:MassPayRequestType'>
<Version xmlns='urn:ebay:apis:eBLBaseComponents' xsi:type='xsd:string'>1.0</Version>
<EmailSubject xsi:type='xsd:string'>$emailsubject</EmailSubject>
<MassPayItem xsi:type='ns:MassPayRequestItemType'>
<ReceiverEmail xsi:type='ns:EmailAddressType'>$ReceiverEmail</ReceiverEmail>
<Amount currencyID='USD' xsl:type='cc:BasicAmountType'>$Amount</Amount>
<Note xsl:type='xsd:string'>$Note</Note>
</MassPayItem>
</MassPayRequest>
</MassPayReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"https://api.sandbox.paypal.com/2.0/");
curl_setopt($ch, CURLOPT_SSLCERT, $sslcertpath);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $SOAPrequest);
curl_exec ($ch);
if (curl_error($ch)) printf("Error %s: %s", curl_errno($ch), curl_error($ch));
curl_close ($ch);
}
Any ideas?
Thanks a bunch.
-Tyler
|