PayPal PayFlow Pro Reporting API returning 110 Invalid merchant account - paypal

I'm trying to write a script to search the PayPal PayFlow Reporting tool in ColdFusion and I'm stuck in the connection part of this. The response I'm getting back is this:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<reportingEngineResponse>
<baseResponse>
<responseCode>110</responseCode>
<responseMsg>Invalid merchant account</responseMsg>
</baseResponse>
</reportingEngineResponse>
This is the exact same password combo I'm using to process payments so I know that the vendor,username, password, partner are all correct. I'm not sure if the XML isn't right, or if I'm sending the XML in incorrectly from BlueDragon (ColdFusion).
This is what my code currently looks like, and I'm trying to pull information from my recurring profile for this account ID.
<cfparam name="payPalServerSearch" default="https://payments-reports.paypal.com/reportingengine">
<cfsavecontent variable="req"><cfoutput>
<?xml version="1.0" encoding="UTF-8"?>
<reportingEngineRequest>
<authRequest>
<user>#payPalUsername#</user>
<vendor>#payPalVendor#</vendor>
<partner>#payPalPartner#</partner>
<password>#payPalPassword#</password>
</authRequest>
<runSearchRequest>
<searchName>RecurringBillingSearch</searchName>
<reportParam>
<paramName>profile_id</paramName>
<paramValue>I-1234567890</paramValue>
</reportParam>
<pageSize>50</pageSize>
</runSearchRequest>
</reportingEngineRequest>
</cfoutput></cfsavecontent>
<cfset req = trim(req)>
<cfhttp url="#payPalServerSearch#" method="post">
<cfhttpparam type="body" value="#req#">
</cfhttp>

You are passing in the profile ID parameter value of I-1234567890 and you are running Live environment based on the URL you are posting "https://payments-reports.paypal.com/reportingengine"
Is this a valid profile ID? I get that the Invalid Merchant account might not be the issue of Profile ID being passed as parameter, but can you try to make sure if it is valid one first and try to run the API call again?

Related

What is the PayPal PDT URL to retrieve transaction details?

I'm setting up Payment Data Transfer (PDT) in PayPal.
After a purchase PayPal redirects the user to my return page and I have the tx parameter from the URL.
I also have my unique PDT token from the PayPal profile settings page.
The documentation says the next step (step 3 in the diagram) is:
Your return URL web page contains an HTML POST form that retrieves the transaction ID and sends the transaction ID and your unique PDT token to PayPal.
That's fine.
But what is the PayPal URL that I POST this data to, to retrieve the transaction details? And what form / parameter names do I use?
I've read multiple pages on the PayPal documentation site but can't find any reference to this PDT URL!?
When you enable PDT via your PayPal dashboard, PayPal sends you a confirmation email. In this email is a link to, what appears to be, hidden documentation!
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/paymentdatatransfer/
Post a FORM to PayPal that includes the transaction ID and your identity token, a string value that identifies your account to PayPal. The form looks like this:
<form method=post action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="cmd" value="_notify-synch">
<input type="hidden" name="tx" value="TransactionID">
<input type="hidden" name="at" value="YourIdentityToken">
<input type="submit" value="PDT">
</form>
In PayPal's reply to your post, the first line is SUCCESS or FAIL. A successful response looks like this, with the HTTP header omitted:
SUCCESS
first_name=Jane+Doe
last_name=Smith
payment_status=Completed
payer_email=janedoesmith%40hotmail.com
payment_gross=3.99
mc_currency=USD
custom=For+the+purchase+of+the+rare+book+Green+Eggs+%26+Ham
...
I initially discarded this email without reading it, which is why I missed the secret documentation!
I also found this stackexchange question which references a much older PayPal documentation page which says the same thing:
https://www.paypal.com/us/cgi-bin/webscr?cmd=p/xcl/rec/pdt-techview-outside
But again, the documentation page is not browsable, so you must happen to know the exact URL to find it!

PayPal user identifier

I'm trying to find some hard identifier that don't change during PayPal account lifetime,
It seems like the REST API has its own user identifier (that can be returned from the openidconnect/userinfo resource when scope has openid)
Unfortunately, This ID is not what the Adaptive API expect when issuing a PayRequest:
sender.accountId: Account ID value (which is the same as the Payer ID value used in the Express Checkout API). The account ID value is an encrypted PayPal account ID.
This is confusing, I understand the REST API is different than the Adaptive API and using email is not sufficient because we need to store the identifier on our database for long term and user may change his email address through PayPal,
Thanks,
Asaf.
You don't need the sender ID when working with preapproved payments. The preapproval key itself relates to the sender who approved it.
Here's a sample request and response for Pay using a preapproval key that works just fine without any sender ID.
Request
<?xml version="1.0" encoding="utf-8"?>
<PayRequest xmlns="http://svcs.paypal.com/types/ap">
<requestEnvelope xmlns="">
<detailLevel>ReturnAll</detailLevel>
<errorLanguage>en_US</errorLanguage>
</requestEnvelope>
<actionType xmlns="">PAY</actionType>
<cancelUrl xmlns="">http://paypal.angelleye.com/paypal/class/1.2/Pay_Cancel.php</cancelUrl>
<clientDetails xmlns="">
<applicationId xmlns="">APP-80W284485P519543T</applicationId>
<ipAddress xmlns="">192.168.1.1</ipAddress>
</clientDetails>
<currencyCode xmlns="">USD</currencyCode>
<preapprovalKey xmlns="">PA-2AY45015CC5060422</preapprovalKey>
<receiverList xmlns="">
<receiver xmlns="">
<amount xmlns="">5.00</amount>
<email xmlns="">usb_1329725429_biz#angelleye.com</email>
</receiver>
</receiverList>
<sender>
<useCredentials xmlns=""></useCredentials>
</sender>
<account xmlns="">
<phone xmlns=""></phone>
</account>
<returnUrl xmlns="">http://paypal.angelleye.com/paypal/class/1.2/Pay_Return.php</returnUrl>
</PayRequest>
Response
<?xml version='1.0' encoding='UTF-8'?>
<ns2:PayResponse xmlns:ns2="http://svcs.paypal.com/types/ap">
<responseEnvelope>
<timestamp>2013-09-24T13:57:52.350-07:00</timestamp>
<ack>Success</ack>
<correlationId>2fa4316b879b9</correlationId>
<build>7767516</build>
</responseEnvelope>
<payKey>AP-5632737798659023M</payKey>
<paymentExecStatus>COMPLETED</paymentExecStatus>
<paymentInfoList>
<paymentInfo>
<transactionId>53664474R26308454</transactionId>
<transactionStatus>COMPLETED</transactionStatus>
<receiver>
<amount>5.00</amount>
<email>usb_1329725429_biz#angelleye.com</email>
<primary>false</primary>
<accountId>C9TAVNJFATXCS</accountId>
</receiver>
<pendingRefund>false</pendingRefund>
<senderTransactionId>3CV49919EJ546411E</senderTransactionId>
<senderTransactionStatus>COMPLETED</senderTransactionStatus>
</paymentInfo>
</paymentInfoList>
<sender>
<accountId>E7BTGVXBFSUAU</accountId>
</sender>
</ns2:PayResponse>
You can see above the response actually includes the sender ID which it knows based on the preapproval key provided in the request.

paypal Adaptive Payments error: 550001 - You do not have permission to constrain funding sources

I am getting this error when using the live API credentials for Adaptive Payment.
reading across intrwebs and documentation it has to do something with the account permissions, but to be fair i don't know which one. receivers, api holders, or apps
I have created the APP, got the key and it has status of "Approved Automatically"
The request that I am using is "basic parallel payment" (from one recipient to another, or rather from buyer to seller)
The account that provides an API key is business verified account and it is same account under the app has been created.
The account that was set to receive money is also verified business account (linked bank cheque account)
bellow is pay request that i am sending
<PayRequest xmlns="http://svcs.paypal.com/types/ap">
<requestEnvelope xmlns="">
<detailLevel>ReturnAll</detailLevel>
<errorLanguage>en_US</errorLanguage></requestEnvelope>
<actionType xmlns="">CREATE</actionType>
<cancelUrl xmlns="">[redacted]</cancelUrl>
<clientDetails xmlns=""><applicationId xmlns="">[redacted]</applicationId>
<customerId xmlns="">[redacted]</customerId>
<customerType xmlns="">buyer</customerType>
<ipAddress xmlns="">XXX.xxx.xxx.xxx</ipAddress>
<partnerName xmlns="">[redacted]</partnerName></clientDetails>
<currencyCode xmlns="">AUD</currencyCode>
<fundingConstraint xmlns="">
<allowedFundingType xmlns="">
<fundingTypeInfo xmlns="">
<fundingType xmlns="">ECHECK</fundingType></fundingTypeInfo>
<fundingTypeInfo xmlns="">
<fundingType xmlns="">BALANCE</fundingType></fundingTypeInfo>
<fundingTypeInfo xmlns=""><fundingType xmlns="">CREDITCARD</fundingType>
</fundingTypeInfo>
</allowedFundingType>
</fundingConstraint>
<ipnNotificationUrl xmlns="">[redacted]</ipnNotificationUrl>
<receiverList xmlns=""><receiver xmlns=""><amount xmlns="">2.00</amount>
<email xmlns="">recivers#pyapal.verifedaccount.com</email>
<paymentType xmlns="">GOODS</paymentType></receiver></receiverList>
<sender><useCredentials xmlns=""></useCredentials></sender>
<account xmlns=""><phone xmlns=""></phone></account>
<returnUrl xmlns="">[redacted]</PayRequest>
Edit: worth to note maybe is that url that I am testing the live payments its a staging url (not production)
fixed.
The fundingConstraint was causing permission errors.
<fundingConstraint>
<fundingTypeInfo xmlns="">
<fundingType xmlns="">ECHECK</fundingType>
</fundingTypeInfo>
<fundingTypeInfo xmlns="">
<fundingType xmlns="">BALANCE</fundingType>
</fundingTypeInfo>
<fundingTypeInfo xmlns="">
<fundingType xmlns="">CREDITCARD</fundingType>
</fundingTypeInfo>
</fundingConstraint>
from the doco, Page 11 (bolded out for emphasis)
https://www.x.com/sites/default/files/2102_pp_adaptivepayments.pdf
fundingConstraint New field: ap:FundingConstraint Specifies a list of
allowed funding types for the payment. This list can be in any order.
If this field is omitted, the payment can be funded by any funding
type that is supported by Adaptive Payments. NOTE: This feature is
available for applications with special permission level.
I was under impression that this was required by default (to make a simple payment) hence i was using it, but turns out it works fine and without it (so its kind of optional).A bit strange as I thought it should be other way around (special permission fro ANY type, no restriction for specified types)
Also worth to note, when you create application don't be fooled by approval status ot check boxes under "Confirm funding sources you support". They (ECHECK, CREDIT CARD, BALANCE) were checked all by default, but it seems that regardless you would need a special permission as specified in APP creation process just bellow checkboxed items "Changing default payment sources will require additional Review time and specific PayPal Approval."
In other words, the app was not under 'conditional approval' which this note suggest.

You do not have permissions to make this API call using SOAP for DoDirectPaymentReq

I'm going a little batty with this one. I remember having a ridiculous time the last time I tried to get this to work, and then they changed it! I tried to import my old user but it says the password isn't right.
Below is the soap I'm posting to https://api-3t.sandbox.paypal.com/2.0/ This all worked before, and it still is working in the production environment, but whenever I try to run this in the sandbox I get
LONGMESSAGE=You do not have permissions to make this API call
ERRORCODE=10002
It seems like I remember this having to do with Paypal PaymentsPro not being enabled. I've tried creating multiple business accounts and removing and re-instantiating my credentials. Nothing seems to work and I can't find anywhere to enable it in the https://www.sandbox.paypal.com/ site. THe credit card is the fake generated card from a sandbox personal user, but I also tried it with the credit card of the business account and it made no difference.
Can anyone give me some clues? This is frustrating beyond belief.
<?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>business user from paypal sandbox</Username>
<Password>password from classic text api credentials</Password>
<Signature>api from new paypal sandbox business user</Signature>
<Subject>email of new paypal sandbox business user</Subject>
</Credentials>
</RequesterCredentials>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<DoDirectPaymentReq xmlns="urn:ebay:api:PayPalAPI">
<DoDirectPaymentRequest xmlns="urn:ebay:api:PayPalAPI">
<Version xmlns="urn:ebay:apis:eBLBaseComponents">1.0</Version>
<DoDirectPaymentRequestDetails xmlns="urn:ebay:apis:eBLBaseComponents">
<PaymentAction>Sale</PaymentAction>
<PaymentDetails>
<OrderTotal currencyID="USD">50.00</OrderTotal>
<ItemTotal currencyID="USD">50.00</ItemTotal>
<ShippingTotal currencyID="USD">0.00</ShippingTotal>
<HandlingTotal currencyID="USD">0.00</HandlingTotal>
<TaxTotal currencyID="USD">0.00</TaxTotal>
<OrderDescription>LOCAL - </OrderDescription>
<Custom>LOCAL - </Custom>
<InvoiceID>LOCAL - 1417</InvoiceID>
<PaymentItem>
<Name>Donation</Name>
<Number>28</Number>
<Quantity>1</Quantity>
<SalesTax currencyID="USD">0</SalesTax>
<Amount currencyID="USD">50.00</Amount>
</PaymentItem> </PaymentDetails>
<CreditCard>
<CreditCardType>Visa</CreditCardType>
<CreditCardNumber>4892645783103844</CreditCardNumber>
<ExpMonth>4</ExpMonth>
<ExpYear>2018</ExpYear>
<CardOwner>
<Payer>john_test#testuser.org</Payer>
<PayerID></PayerID>
<PayerStatus>1</PayerStatus>
<PayerName>
<FirstName>Test</FirstName>
<LastName>User</LastName>
</PayerName>
<PayerCountry>US</PayerCountry>
<PayerBusiness></PayerBusiness>
<Address><Name>Test User</Name>
<Street1>5555 W 55th St</Street1>
<Street2></Street2>
<CityName>Somewhere</CityName>
<StateOrProvince>IL</StateOrProvince>
<Country>US</Country>
<Phone>555-555-5555</Phone>
<PostalCode>55555</PostalCode>
</Address>
</CardOwner>
<CVV2>123</CVV2>
</CreditCard>
<IPAddress>my ip address</IPAddress>
<MerchantSessionId>z78m9bsliz7b7f7</MerchantSessionId>
</DoDirectPaymentRequestDetails>
</DoDirectPaymentRequest>
</DoDirectPaymentReq>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Do the values of "Username" and "Subject" match almost exactly? ( '_api1.' in place of '#' ) ?
If they differ and this is intended, what you may have to do is log into the sandbox account as 'Subject' and grant 3rd party API permissions to the Username.
If they don't differ, try omitting Subject. If that doesn't change the response, can you please post the values?
HERE IS A LINK MAY IT HELP YOU TO SOLVE THIS ISSUE
http://help.tictail.com/customer/portal/articles/1063813-paypal-error-%22you-do-not-have-permissions-to-make-this-api-call%22

PayPal IPN empty array

I have development site on localhost, Sandbox set IPN return url to external IP, in form set return and notify url to localhost/...
After submission and succesfull payment script is going back to my notify url but $_POST array is empty
Please help.
You should add a new input field,//it will turn on paypal return method to "POST"
<input type="text" name="rm" value="2">
('rm','2'); //return method is POST
rm = how you need the data submitted from PayPal to your IPN script (1=get, 2=post)
OK I've managed to find an issue, now Paypal sents response behind the script so i have to log it into the file and see what happened or send it to the email.