How can I verify a Paypal account registered under a business name using GetVerifiedStatus? - paypal

I am successfully using Paypal's Adaptive Accounts API's GetVerifiedStatus endpoint to verify our users' Paypal accounts by first name, last name, and email address. However, a significant fraction of them use Paypal business accounts which don't have a first and last name associated (or else they did provide one and have forgotten it.)
Is there a special way to e.g. enter business name in the "first name" field? Or do all accounts have a first/last name associated and our users need to look that up? Thanks!
Update to clarify: I'm aware that setting matchCriteria to NONE in the request theoretically allows one to perform an email-only search. However, Paypal enables this on a case by case basis, and we haven't been granted NONE status, thus must use NAME which per the docs requires first and last.

I've been playing around with this and found a way to make the call without having to set the option to matchCriteria=NONE. If you make the call by placing the business name twice, both in the first name and last name field, you should be able to get a successful reply from the API.

Looking at the API and playing around with the API explorer, you've got two options.
Set matchCriteria to NONE
In this case sending the first name and last name to the API is optional and the validation will only use the email address.
Set matchCriteria to NAME
In this case sending the first name and last name to the API are required and the validation will use the email address, the first name and last name fields.
You can verify the setting by using the playground, e.g. using test#example.com and any random names.
In your case I would provide the email address, first name and last name as input fields and set matchCriteria to NONE and send the request to the API.

Related

customer/charities endpoint not returning email field

The api documentation for the charities endpoint specifies that one of the fields returned in the response is the "email" field. https://developer.paypal.com/api/limited-release/charity-search/v1/#definition-charity_response
However, when calling the API, I am not seeing this field getting returned. I know that this field exists, because I can filter results based on the email field by using https://api.paypal.com/v1/customer/charities?email=blah#gmail.com. This will correctly filter results for charities that I know the emails of.
To hit this API at all you need a username and password. I'm thinking maybe the username/password I have does not have sufficient permissions to view this field? Or perhaps something else is going on?

Dialog Flow ( Api.ai ) Conversation in chatbot

I am having a welcome intent and it allows user to select three different actions. Ex: Welcome! you can print your firstname, you can print your lastname or you can print your zipcode. If User select or enter last name then it should call the last name intent. So we are providing multiple options at welcome intent itself and user can choose any one of them.
Based on the action selected by user, the conversation should occur.
Please help me how to achieve this.
You are giving the user the option of proceeding by providing their first name, their last name or their zip code.
To capture their response, you will need to create three intents:
Capture First Name
Capture Last Name
Capture Zip Code
For each intent, you would provide a series of example phrases showing how the user might express each thing. For example, "Capture First Name" might contain examples like:
"My first name is Dan"
"Dan"
"Dan is my first name"
I'd recommend providing around 10 examples for each intent.
Dialogflow provides a system entity for zip codes, so it will be able to automatically extract the zip code from the "Capture Zip Code" intent.
However, to make the first and last name intents work, you'll need to create entities to represent the first and last names of all your users. Assuming you know these values ahead of time, you should first create each entity and then write a script to populate it from your datastore using the Dialogflow API's /entities endpoint.
Once you've created and populated these entities, add some examples that make use of them to your intents. Ensure that you highlight and annotate any entity values that are not automatically identified.
When your intents are complete, you can use Dialogflow's fulfillment to send the information they capture to your back-end.
Normally when the welcome intent triggered it will send a request to your backend through webhook,from backend you can send responses as templates or buttons and user can choose one of them ,if you are using backend here
Else in welcome intent response,use a response like you can print firstname ,you can print second name and configure intents for those and use contexts for proper flow.
In the second intent,keep one entity containing some values for first name and use a output context like frstname_output_context
In the another intent,keep one entity containing some values for last name as entity and use a output context like lsttname_output_context
Hope it clarifies using webhook and without webhook.

where find clientid from console

I need to send some mails my users.
I will send it from console, so I have not any user's cookies.
And to track opening mails I insert img in letter body like this:
<img src="https://www.google-analytics.com/collect?v=1&tid={{UA}}&cid={{CID}}&uid={{UID}}..." alt="" />
How can I replace {{CID}} ?
Where should I find it?
Thanks
If you want this hit to be connected to an existing user from your website you would need to record the client id when a user signs up for your emails, maintain a database that maps the recorded id to the e-mail address and the actual substitution would depend on your mail script. Since in this case the clientid is created in your users browser the only possible source would be the cookie.
If you just want to record a hit (without connecting it to existing users) then, as DalmTo pointed out, just use a random unique id.
If you do not have a client id, but have a way to identify the user on your website then you could also try the UserId feature and session unification. In this case you would use a random client id and append your known user id as parameter.
You should refer to the measurement protocol documentation
Protocol Version v v=1 The protocol version. The value should be 1.
Tracking ID tid tid=UA-123456-1 The ID that distinguishes to which Google Analytics property to send data.
Client ID cid cid=xxxxx An ID unique to a particular user.
Hit Type t t=pageview The type of interaction collected for a particular user.
this may also help Email Tracking - Measurement Protocol
How can I replace {{CID}} ? Where should I find it?
It should be a unique number identifying this user, its basically used for session control. Random Guid works.

PayPal - DoExpressCheckoutPayment - Validation issue

For Every PaypPal interaction we Do:
1.SetExpressCheckoutReq
2.GetExpressCheckoutDetailsReq
3.DoExpressCheckOutPaymentReq
I do create a billing agreement first and only on scheduled/subsequent orders we use this billing agreement for reference transaction.
Our Issue is:
With a new PayPal account (testpaypal#abc.com) DoExpressCheckoutPaymentReq failed for CITY = SuttonsBay, with the address validation error “10736” (Shipping Address Invalid City State Postal Code) for a user (USER A). And this was corrected in the subsequent request as Suttons bay.
But the same PayPal account(testpaypal#abc.com ) used for the second time with a different user (USER B) on the site, DoExpressCheckoutPaymentReq call succeeds for the wrong CITY = SuttonsBay and allows us to complete the order.
It is to be noted that on all scheduled order of the user, we use the DoReferenceTransactionReq, which has strict validation and this fails every time, esp. for the second scenario described above.
I would like to know why there are inconsistencies in Shipping address validation for DoExpressCheckoutPayment. It is because of this difference that our scheduled orders fails (as described in scenario 2 that allows incorrect address)
Do we any way to have strict Validation in DoExpressChecOutPayment - which solves our purpose?

Do Salesforce VF email templates require related object to be persisted?

When a new lead comes in, I want to use a before trigger and a Visualforce email template that contains lead field values to send an email using the SingleEmailMessage class. The email is being generated, but all of the lead fields are null even though (known via System.Debug) they do have values going into the call.
Since I'm passing the still-unsaved lead Id via the mail.setWhatId(lead.Id) method, I'm beginning to think that the mail class is using the Id value and trying to do a database look-up rather than as a reference to the still unsaved lead in memory.
Does anyone know if that's the case? My class works flawlessly when the lead already exists.
If it is the case that the Apex mail class does a DB read, any pattern suggestions for the case where one needs to send and email and update a lead field value before the lead is saved? I can't use the Workflow email notification because the email is being addressed to customers, and there's some additional Apex code that sorts out what address to fetch from existing Account records based on some Lead fields--hence I think the need for using VF email templates in the first place.
setWhatId (and pretty much any method that takes an ID value as an argument) definitely does expect the row to be persisted already. To get around this, you should be able to just do your field update in the before trigger, and add an after trigger to send the email.