Authorize.net Hosted payment form AcceptUI.js not returning last 4 digits card number and customer info in response object - authorize.net-cim

I am using CIM with hosted form with AcceptUI.js
As per documentation, response should have last 4 digits of credit card and customer first name and last name. But response missing both info.
I am using following button configuration
<button type="button"
class="AcceptUI"
data-billingAddressOptions='{"show":true, "required":false}'
data-paymentOptions='{"showCreditCard": true, "showBankAccount": false}'
data-apiLoginID="<?php echo addslashes($this->getMethod()->getConfigData('login')); ?>"
data-clientKey="<?php echo addslashes($this->getMethod()->getConfigData('client_key')); ?>"
data-acceptUIFormBtnTxt="Submit"
data-acceptUIFormHeaderTxt="Card Information"
data-responseHandler="acceptjsUIResponse">Add card.
</button>
XHR POST https://apitest.authorize.net/xml/v1/request.api
{"opaqueData":{"dataDescriptor":"COMMON.ACCEPT.INAPP.PAYMENT","dataValue":"eyJjb2RlIjoiNTBfMl8wNjAwMDUyQTdDNzUwQTc4QTkzRDAxNTRDODg5QzYwQTk3Q0JDMkZDMUUwNjBBRDM4QUMyMzcwNUI0NDZERTQzNkU0REJGRkNGQ0VDQTFGNEY1NjRDNUMzNzUzMDAxM0U3MjYwMDA3IiwidG9rZW4iOiI5NTkzNTEyMDU3ODcyMzUwNDA0NjAyIiwidiI6IjEuMSJ9"},"messages":{"resultCode":"Ok","message":[{"code":"I00001","text":"Successful."}]}}
Thanks in advance,
Waleed

Related

How in Sinatra would I check that the term the user has input into a form already exists in your database?

Making a budget app while learning to use Ruby/Sinatra/SQL. Part of it involves letting the user add new vendors that they can assign transactions to. My add transaction and add vendor functions both work, but one thing I'd like to do is be able to throw up an error if the vendor that the user is trying to add - eg 'Amazon' is already in the database, before returning to my index of vendors.
The closest that I've come to getting something working is making the name column of the vendor table UNIQUE. But if I enter a name that's already in existence in the field, I get the "PG::UniqueViolation" error.
Is there a way to tell Sinatra that you don't want this error to flag up, you just want to redirect back to the index of vendors without the repeated value.
My working submission form currently looks like:
<div id="new-transaction">
<form action="/vendors/create" method="POST">
<label for="name">New vendor name:</label>
<input type="text" name="name" id="vendorName" />
<input type="submit" value="Add new vendor" id="btn-new-vendor">
</form>
</div>
Go ahead and use that error as a response to work with in your app. You can add a begin/rescue/end block to your method:
# some code before
begin
DB.add_your_vendor_method
rescue
go_back_to_index
end
show_value_to_user
# some code after
You can make that block error specific, too. There is some nice write up on ruby error handling over at http://rubylearning.com/satishtalim/ruby_exceptions.html

SQL database front end data input form

I have a TSQL database and for the sake of simplicity I created one table called staffrecords with the fields (StaffID, FirstName, Surname, DateofBirth)
I require something where my client can enter data into and will go into the database instantly. So instead of doing insert querys or typing data into the database they can have a front end online application and submit it like that.
Can you guys advise will be the above requirements and point me in the right direction.
I'm not sure what you mean by instantly. As far as I know, the only way to get Data into an SQL Database are the two methods you described above: INSERT statements and typing it into the database directly. If you want to remove a little bit of latency on getting the data into the database on the front end, I would recommend using AJAX in order to add data to the database as the user types it into the front end interface.
E.g.,
User opens the form page: send a message to a server side script telling it to make a new row.
User enters their StaffID: AJAX this information and fill out the appropriate cell in the database using a REPLACE command.
etc., etc.
Obviously, periodically the database will have to scan for empty rows and remove them as these can result from the user visiting the page but not entering any data. A workaround to this could be only creating the row when the first field is filled out.
Hope this helps!
I developed this code to execute a sample to insert the data into the database.
<?php
$servername="localhost";
$username="root";
$password="";
$dbname="demo";
//CREATE CONNECTION
$conn=new mysqli($servername,$username,$password,$dbname);
//CHECK CONNECTION
if ($conn->connect_error)
{
die("connection failed:".$conn->connect_error);
}
//$sql="INSERT INTO student(CATEGORY_NAME) VALUES ('Grapes')";
//isset();
//Die();
if (isset($_POST["add"]))
{
$sql="INSERT INTO category(CATEGORY_ID,CATEGORY_NAME) VALUES ('','".$_POST["CATEGORY_NAME"]."')";
//echo $sql;
//die();
$result=$conn->query($sql);
if ($result===TRUE)
{
echo"NEW RECORD CREATED SUCCESSFULLY";
}
else
{
echo "ERROR:".$sql."<br>".$conn->error;
}
}
$conn->close();
?>
<!DOCTYPE html>
<html>
<head>
<title>CATEGORY</title>
</head>
<body align="center">
<div>
<form action="" method="POST">
<td align="center" bgcolor="lightblue"><b>CATEGORY:</b><input type="value" name="CATEGORY_NAME" WIDTH="1000" value=""/></td>
</br>
</br>
<button type="submit" name="add" value="add">ADD</button>
</form>
</div>
</body>
</html>

SocialEngine 4 - Followers/Following status display too long

I have problem at columns Followers/Following which I put on the right side of my website and also on browse members page. The problems are:
1) when user post too long status its not displayed right on firefox
2) in cause of the long text follow/unfollow are displayed someone in the middle of the status
You can see what I mean by the added images.
What I suggest for a fix (but I don't know how to do it :() is this:
just remove status in this boxes (its not really needed to see last user status there)
or
limit the status characters
Also is there a way users can "clear" their status because I think it stays there until new one is posted, which is pretty stupid. Like if you post something which is ralated to something now but makes non sense in the futre and then you dont post new status for like 10 days and someone sees it, it will look stupid.
thats the code
<div class='profile_friends_body'>
<div class='profile_friends_status'>
<span>
<?php echo $this->htmlLink($member->getHref(), $member->getTitle()) ?>
</span>
<?php echo $member->status; ?>
</div>
Thanks in advance and I think fix like that will be helpful to others too.
image2
I managed to remove it from application/modeules/User/widgets/profile-friends-followers/index.tp
also its the same in profile-friends-followers and profile-friends
in the files I found this
<div class='profile_friends_body'>
<div class='profile_friends_status'>
<span>
<?php echo $this->htmlLink($member->getHref(), $member->getTitle()) ?>
</span>
<?php echo $member->status; ?>
</div>
and when you remove status; ?> then statuses are not shown anymore on this widgets, but I wanted just to limit the displayed characters and tried to use substr but couldn't manage to do it at the first time

How can I access extra customer registration form field values via the Bigcommerce API?

In the bigcommerce control panel, you are given the option to
add extra fields to the customer registration form.
This is shown in the control panel when Editing a customer record. They
show up, in the rendered html as this kind of thing:
<div class="field formRow ">
<label for="FormField_24"><span class="FormFieldLabel">FIELD NAME</span>
...
</label>
<div class="field-group value">
<input type="hidden" value="24" class="FormFieldId">
<input type="hidden" value="1" class="FormFieldFormId">
...
<input type="text" value="FIELD VALUE" class="field-xlarge FormField"
name="FormField[1][24]" id="FormField_24" ...>
</div>
</div>
However, walking the records with the Customer API doesn't show any of these extra fields.
Is there is anything in the Bigcommerce API that will let me access these custom customer form fields?
Update:
There are some older questions about this, that I didn't spot in searching (here, and here).
Given that those questions are from January & July last year, and still have no solution, it looks like this is simply a gap in the API. Damn.

Is there any tool to automatically capture screenshots of running ad campaigns? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
Objectif would be to monitor a bunch of websites and automatically take screenshots when a specific ad tag is called (previously defined, belonging to a new campaign)
automatically take screenshots when a specific ad tag is called
I'm not really sure what you mean when you say that a specific ad tag is "called." What do you mean when you say that?
If I understand you correctly, you seem to want to capture an ad if it's displayed on a website. If that's the correct understanding then you can just save the HTML of an ad and "replay" it later. You do have to check for certain tags in the HTML in order to detect if an ad is showing.
So let's look at how things work on with Google ads. And let's say you search for the keyword "dentist": http://www.google.com/search?hl=en&q=dentist
First you have to detect that an ad exists and the most common way this is indicated on Google is with the <div id="tads"> div. If you look at the HTML, the div tag will look like this:
<div id="tads" class="c" style="margin:0 0 14px;padding-top:2px;padding-right:36px;padding-bottom:2px;padding-left:8px;min-height:0">
<h2 style="font-size:11px;font-weight:normal;margin:0 -35px 0 0;padding:1px 4px 0 0;text-align:right">
<ol style="padding:3px 0" onmouseover="return true">
<li class="taf">
// collapsed html for the purposes of this example
<li class="tam">
// collapsed html for the purposes of this example
<li class="tal">
// collapsed html for the purposes of this example
</ol>
<div id="topDnsPrefetchHints">
</div>
If you take all the HTML in the parent node, plop it in the middle of some <html></html> tags, save it to a file and you would have essentially made a copy of the ad. When you open the saved page you will see the ad (although it will not have any of the pretty formatting):
<html>
<head>
</head>
<body>
<span style="margin-right:0" id="taw"> <div></div> <div style="margin:0 0 14px;padding-top:2px;padding-right:36px;padding-bottom:2px;padding-left:8px;min-height:0" id="tads" class="c"><h2 style="font-size:11px;font-weight:normal;margin:0 -35px 0 0;padding:1px 4px 0 0;text-align:right">Ads<span> - <a onclick="google.x(this,function(){if(google.wta){google.wta.toggleLightbox(this,'0CAYQJw','0CAgQKQ',380);}});return false;" id="wtata" class="gl wtall" href="javascript:void(0)">Why these ads?</a><span style="display:none" class="wtalbc">These ads are based on your current search terms.<br><div style="padding-top:12px">Visit Google’s <a class="std gl wtaal" href="#">Ads Preferences Manager</a> to learn more or opt out.</div></span></span></h2><ol style="padding:3px 0" onmouseover="return true"><li class="taf"><div sig="1W8" cved="0CA8Qhw0wAQ" pved="0CA0QhQ0wAQ" class="vsc vsta"><h3 onmouseover="document.getElementById('topDnsPrefetchHints').innerHTML='<link rel="dns-prefetch" href="//www.1800dentist.com">';">Find a Local <b>Dentist</b> - 24/7 Online Appointment Booking.</h3><div class="vspib" aria-label="Result details" role="button" tabindex="0"><div class="vspii"><div class="vspiic"></div></div></div><div><div class="kv"><cite>www.1800<b>dentist</b>.com/Chicago<b>Dentist</b></cite></div></div><div><div style="display:none" id="poAs0p1" class="esc slp">You +1'd this publicly. <a class="fl" href="#">Undo</a></div></div><span class="ac">Call or Visit 1-800-<b>DENTIST</b>® Today! </span><div><div style="margin-bottom:0px;margin-top:4px" class="oslk osi">Find Gentle Pain-Free Dentists - Find a Dentist Online for Free</div></div></div></li><li class="tam"><div sig="nxV" cved="0CBYQhw0wAg" pved="0CBQQhQ0wAg" class="vsc vsta"><h3 onmouseover="document.getElementById('topDnsPrefetchHints').innerHTML='<link rel="dns-prefetch" href="//dentalsalon.com">';"><b>DENTIST</b> at Dental Salon - Super Convenient</h3><div class="vspib" aria-label="Result details" role="button" tabindex="0"><div class="vspii"><div class="vspiic"></div></div></div><div><div class="kv"><cite>www.dentalsalon.com/Great-Reviews</cite></div></div><div><div style="display:none" id="poAs0p2" class="esc slp">You +1'd this publicly. <a class="fl" href="#">Undo</a></div></div><span class="ac">Open 7 Days and Evenings - Affordable - 12 <b>Dentists</b> </span><div><div style="margin-bottom:0px;margin-top:0px">Suite 800, 939 W North Ave, Chicago, IL - 1 (312) 642-3370 - <a google.adping('t',2,11)"="" &&="" class="flonmousedown="google.adPing" href="http://maps.google.com/maps?hl=en&um=1&ie=UTF-8&daddr=Suite+800,+939+W+North+Ave,+Chicago,+IL&f=d&saddr=&iwstate1=dir:to&fb=1&geocode=3891923684064231596,41.910331,-87.652690&sa=X&ei=NnM5T9nSC-r20gGymeXFAg&ved=0CBMQmxA">Directions</a></div></div></div></li><li class="tal"><div sig="ohs" cved="0CCAQhw0wAw" pved="0CB4QhQ0wAw" class="vsc vsta"><h3 onmouseover="document.getElementById('topDnsPrefetchHints').innerHTML='<link rel="dns-prefetch" href="//www.BigSmileDental.com">';">Big Smile Dental - $1 Exam & X-Rays or Free Whitening</h3><div class="vspib" aria-label="Result details" role="button" tabindex="0"><div class="vspii"><div class="vspiic"></div></div></div><div><div class="kv"><cite>www.bigsmiledental.com</cite></div></div><div><div style="display:none" id="poAs0p3" class="esc slp">You +1'd this publicly. <a class="fl" href="#">Undo</a></div></div><span class="ac">As Seen on FoxNews (773)772-8400 </span><div><div style="margin-bottom:0px;margin-top:4px" class="oslk osi">Porcelain Veneers - Invisalign - Teeth Whitening - Dental Implants</div></div></div></li></ol><div id="topDnsPrefetchHints"><link href="//www.1800dentist.com" rel="dns-prefetch"></div></div> </span>
</body>
</html>
Finally, if you want the pretty formatting, then reference Google's style sheet and now you have an almost identical copy of the ad that Google is displaying.
Things to note:
Every advertiser (Google, Bing, Yahoo, etc.) has a different format, so you may have to do the above for every advertiser you want to monitor.
Even within advertisers, there may be variations on the ad depending on the browser that is displaying the ad (Google displays ads differently on iphones than they do for android phones).
Finally, since I already work for a company that provides the ad capturing service (and more), I might as well plug our solutions.
We have several examples on how the ads look once captured, including this one: