9

I've been using PayPals IPN to receive and process payments, storing the transactionId as a reference.

The time has come to be able to refund payments through the system I'm developing and here lies the struggle.

When using entering a transactionId into the payKey field on the GetPaymentDetails.php sample in an updated PHP SDK, with correct authentication details and application id, I get:

Error ID: 580022
Domain: PLATFORM
Severity: Error
Category: Application
Message: Invalid request parameter: payKey with value [REMOVED (transactionId)]
Parameter: Array

This is understandable, as it is expecting a payKey. Now, I can change the $pdRequest->payKey = $payKey; to $pdRequest->transactionId = $payKey; as per the specification. This should now send the transactionId as a transactionId and work, but I get this in response:

Error ID: 520002
Domain: PLATFORM
Severity: Error
Category: Application
Message: Internal Error

Ok, so something is broken. I suspect they do not allow transactionId to be used as a reference now and haven't updated their documentation (typical). The reason I suspect this is that the original SDK I used included a field for transactionId, as well as trackingId and another identifier. But now the updated SDK only asks for the payKey.

Now I'm stuck. I've collected thousands of live transactionIds. Do you know how I can get a payKey for each transaction, or fix the original problem.

Thanks

More Info:

Here are the HTTP headers sent:

X-PAYPAL-SECURITY-SIGNATURE: [removed]
X-PAYPAL-SECURITY-USERID: [removed]
X-PAYPAL-SECURITY-PASSWORD: [removed]
X-PAYPAL-APPLICATION-ID: [removed]
X-PAYPAL-REQUEST-SOURCE: PHP_SOAP_SDK_V1.4
X-PAYPAL-DEVICE-IPADDRESS: 127.0.0.1
X-PAYPAL-MESSAGE-PROTOCOL: SOAP11
X-PAYPAL-REQUEST-SOURCE: PHP_SOAP_SDK_V1.4

And here is the content

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"     xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
 <soap:Body><PaymentDetailsRequest>
    <requestEnvelope>
        <errorLanguage>en_US</errorLanguage>
    </requestEnvelope>
    <transactionId>[removed]</transactionId>
</PaymentDetailsRequest></soap:Body>
</soap:Envelope>

To

https://svcs.paypal.com/AdaptivePayments/PaymentDetails

3 Answers3

2

i have one suggestion:

i suppose you have all the transaction IDs saved in your DB,

loop for all the records, get the transaction ids, get the paykey by transaction id and update the relevant orders,

then you can have the transaction and paykey values, together for a single record.

Muhammad
  • 3,169
  • 5
  • 41
  • 70
1

There is a resource already available in paypal official website. Here is link of the documention https://cms.paypal.com/mx/cgi-bin/?cmd=_render-content&content_ID=developer/e_howto_api_APPaymentDetails

It states that you can pass payKey or transactionID.And both are returned in response so you can get payKey & transactionID.

And if you have any problem in using api, you can find the paypal API getting started tutorial here http://coding.smashingmagazine.com/2011/09/05/getting-started-with-the-paypal-api/

1

Use the existing tracking id in using PaymentDetails API Operation. The payKey and other information about the payment are returned as response.

Floricel
  • 791
  • 2
  • 9
  • 20