Testing Paypal errors, Always Transaction Response code always 36 - paypal

I'm trying to test a few failure conditions using the test version of our pay-pal api. Specifically a recuring payment with an initial payment. Therefor I'm using the recurring payment adding an additional transaction. When testing for success (amounts less than $1000 for both recuring and initial transaction) everything works as expexted. According to the paypal documentation using amounts over $1000 should result in a response code that is the amount over $1000. regarless ov the amount I use the response code is 36.
I've also tried amounts over $2000 which should result in a response code of 12. However I still get 36.
The only details changing between the call that works as expected and those that don't is the amount.
Update
Upon further investigation, the recurring transaction response is 12, as expected. However the transaction response, which I'm assuming is what I need for the additional transaction is still 36. This is what I need to be testing against.
I've also tried different test card numbers as supplied by pay-apl.
On a side note... I realise this is not a programing question per-se, but I've been bounced here by pay-pal as their "Forum"!!!
Further Information
I am using the .net api(SDK) as provided by paypal

Related

paypal IPN - how to know when money has moved?

I'm using a basic HTML form to call PayPal (webscr) and I am successfully getting IPN callbacks.
There is plenty of documentation about the contents of each individual variable that can be returned in an IPN. There is something important missing, or else I have missed it:
What paypal transaction types and payment statuses reflect actual changes in my account balance? For example, a "Completed" status certainly does, and a "Pending" status certainly does not.
However, there appear to be five or six relevant transaction types and eleven different payment statuses possible. Other than trying all 55 or 66 combinations in the IPN simulator, is there any document that clearly shows for which ones I should accumulate the mc_gross amount?
Or to put it another way, some IPN messages are just "in case I need to know", and some mean "money has changed hands; adjust your accounts accordingly". It's not clear to me which combinations of transaction type and payment status indicate the latter.
Thanks and Best Regards,

How to link related transactions obtained by TransactionSearch and GetTransactionDetails?

TL;DR- How do I know if I really did get paid, via the PayPal NVP API?
Longer version
I'm writing code to automagically process and classify transactions from our PP business account. I have code that calls NVP methods TransactionSearch and GetTransactionDetails and fills a few database tables with the results that are returned. This happens every day for the previous 24 hours' worth of transactions. So far, so good.
I began from the assumption that the same information available via manual CSV export via the PayPal web interface would be available via the API, but I'm now discovering that either this is not the case, or there is another API call I should be making to get the rest of the information I need.
In particular, GetTransactionDetails doesn't seem to return the equivalent of CSV field "Reference Txn ID" and, in a few cases, I can't see how to connect related transactions.
So, my question is how can I obtain the reference transaction ID, or how do I otherwise connect these associated transactions?
Example 1
This is (probably) the most common sort of situation where the reference transaction ID is needed.
Depending on the buyer's funding source, you may either see a purchase complete instantly or, if the transaction must be cleared, complete across three separate transactions:
The original payment, detail of which gives buyer's name, email, address, invoice number, item ID, gross, fee and net amounts etc.
followed immediately by a debit of the net amount
followed, in a few days, by a credit of the net amount.
It is crucial to match the three transactions because you don't know whether the payment will succeed or be declined (and therefore whether you've actually got the money) unless you do.
In the data I have available to me at the moment, there is only one such example of this situation, and calls to GetTransactionDetails for the settlement transactions fail completely ("The transaction could not be loaded") — possibly because, in that one instance, I know that the payment was made with a credit card by somebody who doesn't have a PayPal account.
This might be an anomaly, or it might be the common case. I have seen this triplet of transactions quite frequently in other PayPal accounts, but not this one, so I can't be sure.
Example 2
A payment in a foreign currency will typically generate three transactions, rather like in Example 1:
The original payment (eg in €), the detail of which gives the sender's name and email address etc;
this is then followed by an immediate debit of the (probably net) amount in €
and then an immediate credit in USD.
From the point of view of the NVP API, GetTransactionDetails usually returns values labelled SETTLEAMT and SETTLEAMTCURRENCYCODE for the original payment. No further processing is required.
However, a recent such transaction (for reasons that even PayPal could not adequately explain) did not auto-convert, and the GetTransactionDetails call lacks the settlement values even after the conversion was performed manually.
The transactions are all there — but I cannot see any programmatic way to associate them because an attempt to call GetTransactionDetails on currency conversion transactions returns the error "You can not get the details for this type of transaction".
—
Any advice or experience relating to automatic processing of PayPal transactions? Is there any way to duplicate, programmatically, the same data included in the CSV export?
If necessary, I'd be happy to process the CSV export if there were some way to generate it programmatically, but I don't even know of a way to do that (short of a Selenium-driven solution full of pitfalls).
GetTransactionDetails will include a PARENTTRANSACTIONID if there is a related transaction. For example, a refund transaction would have a parent transaction ID.

Ipn simulator Echeck completion response for not sending 'subscr_id' for recurring payments

I have created response for recurring payments using ipnsimulator. ipnsimulator send transaction details without subscr_id. How can I get subscr_id for recurring payments using ipnsimulator?
Unfortunately, the IPN Simulator is not yet setup to include subscriptions or recurring payments. You'll need to find a sample of what IPN's look like for a given transaction (which you can find with Google, of course) and then you can create your own simulator. Samples are provided at http://developer.paypal.com in the docs, but they're kind of buried so Google really is faster.
You can build your own simulator by creating a basic HTML form with the action set to your IPN URL. Include hidden fields in the form with names/values that you would expect to get from an actual PayPal IPN based on samples you find. Then you can load this in a browser and submit it manually to trigger the simulated IPN. This can help with troubleshooting script problems, too, because you can see the result on screen.
Keep in mind that when testing this way the IPN data is not coming from PayPal's server. Therefore, the verification will come back as INVALID. Just make sure you remember that if you're building logic around VERIFIED or INVALID IPN results, and adjust accordingly.

PayPal Converting Sale transaction to Recurring Billing Profile results in Duplicate error

Using payflow .net dll I am trying to create a Recurring Billing Profile without forcing my clients to take on the PCI compliance burden of handling credit card data so here's what I'm currently doing...
get secure token
create sale transaction (record results)
Convert it to Recurring Billing Profile (starting in the future)
This all works however when PayPal tries to create a transaction using the RBP it gets Result Code 30, Duplicate, error 10536 - ...duplicate invoice id... I'm not setting an invoice id anywhere in my code. When in step 2 I create an authorization instead of a sale it works (although the trans type in the IPN ends up being "cart"???). So I assume this is a problem with converting a sale to a RBP. If that is not allowed then step 3 should stop me but it doesn't. So is there a way around this problem?
NOTE: When using Express Checkout with the paypalcoresdk and paypalmerchantsdk dlls I am able to create a sale transaction AND a RBP using the same token and it all works and the IPN tran type ends up being recurring_payment which is correct.
NOTE 2: The best solution would be for PayPal to allow me to create an RBP using a secure token. I have not been able to make that work.
NOTE 3: The reason I'm not using an Authorization transaction is because this would result in the client having loads of Auth transaction in PayPal that they could Capture at anytime resulting in duplicate payments.
To get rid of this error , Login to your Paypal account , go to Profile --> My selling Tools --> Block Payments . Here you will see something like " Block the payments with same invoice id " , put it to "No" and save the settings . It should be fine afterwards .
Regarding NOTE 3
I have found that I can set up an Authorization transaction with an amount of 0. Then in the transaction history it will have a status of Completed and no Capture button. Then when converting this to a Recurring Billing Profile PayPal allows you to set a different amount. I don't know if this imposes a limitation on the amount but my test of $500 worked.
Hope that helps someone

PayPal Sandbox Negative Testing of PartialSuccess

Does the PayPal Sandbox API Negative Testing allow you to produce a "PartialSuccess" result?
I am attempting to reproduce in the PayPal Sandbox a situation in production that is causing problems. The situation is that we have orders with items from multiple sellers, which results in multiple payments. Sometimes when we call DoExpressCheckoutPayment some of those payments fail (generally with error code 13113), while others succeed. The Ack from DoExpressCheckoutPayment == "PartialSuccess" in this case.
It appears there are problems in our logic to deal with this situation. Therefore, I want to troubleshoot this in the sandbox, and I have turned on Negative Testing.
However, the Sandbox is not behaving as expected. If I create an order with two items from different sellers, the first item seems to control the whole transaction.
If item #1 has a price which corresponds to an error code (e.g. $131.13), then the transaction comes back as Ack == "Failure" even if item #2 does not cause any error.
If I switch the order of the items, so the non-error item is #1 and the error item is #2, the whole transaction goes through with Ack == "Success" with no error triggered at all.
I can't find any documentation about the combination of Negative Testing and PartialSuccess. Am I doing something wrong, or does PayPal Sandbox just not support testing this situation?