split full name into first and last name for Rest data - paypal

A www form provides my cgi script with a full name for the credit card information. The PayPal Rest API wants a first_name and last_name. If there are more than two 'words' in the full name, then what is the way to submit the information? I want to avoid declined cc payments.
Say, given
full_name="Mr. I M Testy".
Should I submit
first_name="Mr. I M",
last_name="Testy"
Or what?
Where is the guidance on the Paypal rest documentation?

The solution that seems to work best, in the sandbox, is to split the words given for card holder name into last name and everything else.
ex. "John Jacob Jingleheimer Schmidt" would be split into
last_name: 'Schmidt'
first_name: 'John Jacob Jingleheimer'
And that is how I would submit it. If the cardholder goes by one name that is the last name and I submit no first_name parameter at all.

You can either add them to the end of the first name as you are doing or before last name. There is no convention that is enforced via REST APIs. So as long as you are consistent on your end about how you handle names, the APIs should not stand in your way.

Related

Return a value based on a function in placeholder in oracle Apex

Sorry if this is a "stupid" question, but I am new to Apex.
I made 2 processes on the create button: one is to insert into the department table and the other one to send an email with some info, among them the department too.
I made an email template and I want to display the department name, not the id which is inserted into the table. So I thought, that maybe I can do that with a function, like in the picture attached(get_department_by_id - returns the name of a department).
[example][1]
[1]: https://i.stack.imgur.com/bjBag.png
The help function in the builder usually gives enough info. Here is the help for "Placeholder values"
So only Application, Page Items and System Variables are allowed.
Note: There are multiple places in APEX where you can pass a number of arguments (links, branches, etc) but nowhere the use of functions is allowed.
This is how it worked for me.
I created a computation, with the computation of type "Expression" with source get_department_by_id(:P7_ID_DEPARTMENT) and Condition Type "Request = Expresion 1" with source the name of the button(ex.create).
Thank you Koen Lostrie for the guidance!

Facebook API - Custom Audience from contact data

does any one has experience with using Custom Audience API in order to create audience for contact data of people outside of U.S.?
Part of the API which i refer to is: https://developers.facebook.com/docs/marketing-api/reference/custom-audience/users/
As you can see, documentation lacks of explanation in what format should be data for COUNTRY field provided. Also I don't know how to format data for ST field if the country is outside of US. Should I use some region name or just leave it blank?
I uploaded 1000 users and nobody has been recognized so I suppose that I just did not format data properly.
Sample request: payload={"schema":["FN","LN","CT","ST","COUNTRY"],"is_raw":true,"data":[["adam","nowak","wroclaw","","poland"]]}&access_token=____&format=json
As you can see I left state field blank, and provided country in English translation and lower caps. It is possible that valid value is e.g. PL a not "poland". Also any information about what should be filled in state field would help me a lot.
Thanks in advance.

REST: If the procedure is a DB UPDATE command, should your API call strictly be PUT?

Consider the following invoice table with two entries, id 1 and 2:
id, item, date_paid
1, 'apple', ''
2, 'banana', ''
When a payment is made date_paid column needs to be updated.
What is a proper REST verb for this?
POST invoices/1/payments
or
PUT invoices/1/payments
I feel like POST is proper since I am "adding" a payment detail but then again internally I'm actually "updating" a DB row so PUT seems applicable also.
If I understand your example, you have an invoice that was created in your Invoice table at some point in the past. You're now updating said invoice to reflect that a payment was made. That's definitely an update and PUT is the correct verb. Presumably you might also have a Payment table with the actual payment details (amount, payer, etc.). If so, then that's where you would be adding a new payment record. That call would be a POST.

Use unique user number in Google Forms

I want to send my clients in my database an e-mail with a request to fill in a Google form to research their needs for our service in the future.
Every client has an unique ID already (for example EX0258, EA1405, EZ2815). I need a way how I can add this unique number in the spreadsheet that they will fill in. Of course, I can ask them to provide them by themselves, but this can cause mistakes in the information.
What I am looking for is a unique URL for each user that provides the Google Form Spreadsheet with that unqiue user ID. I hope you understand my question and that you can help me out with it.
If you have the id ready to go from your db you can do it via Google Forms, but it seems the process cannot be automated (see https://support.google.com/docs/answer/160000?hl=en)
If you are open to a 3rd party solution, you could do this with Cloud Snippets via cloudward.com. You could just include the id as a parameter like this:
your_domain_here.com/page_name.html?unique_id=ABCD1234
The code would look something like this:
<# start form for google spreadsheet "Your Spreadsheet Name";#>
<input type="text" <# your_column_name #> value="<#[url.unique_id]#>">
<input type="text" <# your_column_name2 #>>
<# end form #>
The unique ID in the snippet above would be ABCD1234

grabbing parent records in sugarcrm

what I have done? and what I need?
I have created two module 1.invoice 2. payment there is one to many relationship between invoice and payment
it means one invoice have many payment.
for calculating payment I have used a logic hook in payment module.
now I want invoice_id in payment module to retrive data.
for that I use
$invoice = new invoi_invoice();
$invi = $invoice->get_linked_beans('invoi_invoice_t_hotel_payment_1','invoi_invoice');
var_dump($invi);
it return
array(0){
}
and also I used
$invoice = new invoi_invoice();
$id=$invoice->retrieve($bean->invoi_invoice_t_hotel_payment_1invoi_invoice_ida);
but this also does not give me id of invoice.
i have read lots of blog and tutorial all are grabing parent record same like me.
but I don1t get id till now.
any help please..
I got the solution
for simply getting the parent id use
var_dump($_REQUEST);
then you got parent id like this:-
$parent_id=$_REQUEST["return_id"];