I must say, I can't remember the last time I've spent so much time figuring out an API. I loathe working with PayPal. That said...
I'm developing a seemingly simple script to download transactions into shipping software. I've got the script working to pull transactions in NVP and SOAP. But when a payment is on an invoice, the items purchased aren't included in the payment transaction info. So I'm assuming what I need is in the invoicing API.
I have API credentials that work just fine with TransactionSearch. I saw that for the Invoicing API, I also need an App Id, so I created an App, twice. Apparently there are two PayPal developer sites?? So I have a REST app created at developer.paypal.com and I guess a classic app "conditionally approved" at apps.paypal.com.
I guess after venting about the ridiculously unorganized developer structure and the sad excuse for documentation... !@#$ ... I'd like to find out if anyone can get me on the right track.
All I need to be able to do is see what invoices have come in (start-end date, etc) and get the details so it can be exported to our shipping software. Transactions work just fine, I'm not sure why invoices are so different or why there's so much more involved in getting that data?
Just as a reference, here's how we're pulling in our transactions:
$client = new SoapClient( 'https://www.paypal.com/wsdl/PayPalSvc.wsdl',
array(
'location' => 'https://api-3t.paypal.com/2.0/',
'soap_version' => SOAP_1_1
));
$cred = array( 'Username' => $username,
'Password' => $password,
'Signature' => $signature
);
$Credentials = new stdClass();
$Credentials->Credentials = new SoapVar( $cred, SOAP_ENC_OBJECT, 'Credentials' );
$headers = new SoapVar( $Credentials,
SOAP_ENC_OBJECT,
'CustomSecurityHeaderType',
'urn:ebay:apis:eBLBaseComponents' );
$client->__setSoapHeaders( new SoapHeader( 'urn:ebay:api:PayPalAPI',
'RequesterCredentials',
$headers ));
$args = array(
'Version' => '94.0',
'StartDate' => '2014-03-25T00:00:00Z'
);
$TransactionSearchRequest = new stdClass();
$TransactionSearchRequest->TransactionSearchRequest = new SoapVar( $args,
SOAP_ENC_OBJECT,
'TransactionSearchRequestType',
'urn:ebay:api:PayPalAPI');
$params = new SoapVar($TransactionSearchRequest, SOAP_ENC_OBJECT, 'TransactionSearchRequest');
$result = $client->TransactionSearch($params);
print_r($result);