I'm very new to payment integration. Recently I created a test account and am trying to configure Paypal integration. When I call the API, passing the xmlformat request via coldfusion <cfhttp>, I am getting the following response message:
Paypal Response:
<XMLPayResponse xmlns="http://www.paypal.com/XMLPay">
<ResponseData>
<Vendor>UserName</Vendor>
<Partner>paypal</Partner>
<TransactionResults>
<TransactionResult>
<Result>12</Result>
<FraudPreprocessResult> <Message>Review: More than one rule was triggered for Review</Message></FraudPreprocessResult>
<Message>Declined</Message>
</TransactionResult>
</TransactionResults>
</ResponseData>
</XMLPayResponse>
My xml format is
<cfxml variable="XMLDoc">
<?xml version="1.0"?>
<XMLPayRequest version="2.0">
<RequestData>
<cfif len("UserName")><Vendor>#XMLFormat("UserName")#</Vendor></cfif>
<Partner>#XMLFormat("PayPal")#</Partner>
<Transactions>
<Transaction> <!--- Id="#TxId#" --->
<Sale>
<PayData>
<Invoice>
<CustIP>#XMLFormat("127.0.0.1")#</CustIP>
<MerchantDescription>#XMLFormat("Test description")#</MerchantDescription>
<!---<MerchantServiceNum>#XMLFormat(Attributes.Extra.ServiceNumber)#</MerchantServiceNum>--->
<Date>#DateFormat(Now(),"YYYYMMDD")#</Date>
<BillFrom/>
<BillTo>
<Name>#XmlFormat("Billing to Address")#</Name>
</BillTo>
<ShipFrom/>
<ShipTo/>
<ShippingAmt Currency="USD">#DecimalFormat(2.50)#</ShippingAmt>
<TaxAmt Currency="USD">#DecimalFormat(1.12)#</TaxAmt>
<ItemAmt Currency="USD">#DecimalFormat(10.20)#</ItemAmt>
<TotalAmt Currency="USD">#DecimalFormat(13.82)#</TotalAmt>
<CustomerHostName>#XmlFormat(CGI.SERVER_NAME)#</CustomerHostName>
<CustomerBrowser>#XmlFormat(CGI.HTTP_USER_AGENT)#</CustomerBrowser>
</Invoice>
<Tender>
<Card>
<CardNum>#XmlFormat(4242424242424242)#</CardNum>
<ExpDate>#DateFormat(CreateDate(2020, 12, 1), "YYYYMM")#</ExpDate>
<CVNum>#XmlFormat(123)#</CVNum>
<NameOnCard>#XmlFormat("VISA")#</NameOnCard>
</Card>
</Tender>
</PayData>
</Sale>
</Transaction>
</Transactions>
</RequestData>
<RequestAuth>
<UserPass>
<User>#XMLFormat("UserName")#</User>
<Password>#XMLFormat("Password")#</Password>
</UserPass>
</RequestAuth>
</XMLPayRequest>
</cfxml>
ColdFusion cfhttp request:
<cfhttp url="https://pilot-payflowpro.paypal.com" method="post" timeout="60" throwonerror="yes">
<cfhttpparam type="header" name="Content-Type" value="text/xml">
<cfhttpparam type="header" name="X-VPS-CLIENT-TIMEOUT" value="60">
<cfhttpparam type="header" name="X-VPS-VIT-OS-NAME" value="#Server.OS.Name#">
<cfhttpparam type="body" value="#ToString(xml)#">
</cfhttp>
What did I do wrong here? Can anyone offer suggestions about the configuration, how to resolve this error or some ideas on how to integrate Paypal payment?
Related
I am trying to get Tally Erp 9 Bills Receivable through post XML Request, everything is working fine except opening amount. Please guide me to get opening amount.
XML Request:
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Export Data</TALLYREQUEST>
</HEADER>
<BODY>
<EXPORTDATA>
<REQUESTDESC>
<STATICVARIABLES>
<SVEXPORTFORMAT>SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<REPORTNAME>Bills Receivable</REPORTNAME>
</REQUESTDESC>
</EXPORTDATA>
</BODY>
</ENVELOPE>
XML Response:
<ENVELOPE>
<BILLFIXED>
<BILLDATE>1-Dec-2016</BILLDATE>
<BILLREF>A-2602</BILLREF>
<BILLPARTY>ABC Company</BILLPARTY>
</BILLFIXED>
<BILLCL>-17000.00</BILLCL>
<BILLPDC></BILLPDC>
<BILLFINAL>-17000.00</BILLFINAL>
<BILLDUE>31-Dec-2016</BILLDUE>
<BILLOVERDUE>1848</BILLOVERDUE>
<BILLFIXED>
<BILLDATE>15-Dec-2016</BILLDATE>
<BILLREF>A-2726</BILLREF>
<BILLPARTY>XYZ Company</BILLPARTY>
</BILLFIXED>
<BILLCL>-74400.00</BILLCL>
<BILLPDC></BILLPDC>
<BILLFINAL>-74400.00</BILLFINAL>
<BILLDUE></BILLDUE>
<BILLOVERDUE>1834</BILLOVERDUE>
</ENVELOPE>
Expected XML Response:
<ENVELOPE>
<BILLFIXED>
<BILLDATE>1-Dec-2016</BILLDATE>
<BILLREF>A-2602</BILLREF>
<BILLPARTY>ABC Company</BILLPARTY>
</BILLFIXED>
<BILLOP>-17000.00</BILLOP>
<BILLCL>-17000.00</BILLCL>
<BILLPDC></BILLPDC>
<BILLFINAL>-17000.00</BILLFINAL>
<BILLDUE>31-Dec-2016</BILLDUE>
<BILLOVERDUE>1848</BILLOVERDUE>
<BILLFIXED>
<BILLDATE>15-Dec-2016</BILLDATE>
<BILLREF>A-2726</BILLREF>
<BILLPARTY>XYZ Company</BILLPARTY>
</BILLFIXED>
<BILLOP>-90000.00</BILLOP>
<BILLCL>-74400.00</BILLCL>
<BILLPDC></BILLPDC>
<BILLFINAL>-74400.00</BILLFINAL>
<BILLDUE></BILLDUE>
<BILLOVERDUE>1834</BILLOVERDUE>
</ENVELOPE>
How to get Tally Erp 9 Bills Receivable through post XML Request with opening amount? Is there is any option to set Show Opening Amount: Yes in XML Request?
Extend the report and Add <SET>ShowOpBillAmt:Yes </SET>
Full XML will be
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>EXPORT</TALLYREQUEST>
<TYPE>DATA</TYPE>
<ID>CustBillsreceivable</ID>
</HEADER>
<BODY>
<DESC>
<TDL>
<TDLMESSAGE>
<REPORT ISMODIFY="No" ISFIXED="No" ISINITIALIZE="No" ISOPTION="No" ISINTERNAL="No" NAME="CustBillsreceivable">
<USE>Bills Receivable </USE>
<SET>ShowOpBillAmt:Yes </SET>
</REPORT>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
I'm a very new to Coldfusion scripting. I need to validate an Email field on a form, so that the Email field accepts "...#waldorf.edu" email address from prospective applicants ONLY. All other email addresses should be an error. I have this code right now, but it doesn't validate the domain unfortunately.
<tr bgcolor="##ffffff">
<td valign="top" class="style13"><strong>Email</strong><br />
<font size="2">(Must be Waldorf faculty member. <strong>Use "waldorf.edu" email address only.)</strong></font></td>
<td valign="top"><font color="##FF0000">*</font>
<cfinput type="text" Name="email" Message="Please input a valid Waldorf Email Address, ex.: you#waldorf.edu." validate="email" required="yes" value="#appinfo.email#" size="40"> </td>
</tr>
Thank you for your help!
Controller:
<cfcomponent name="fellowsapp" output="false">
<cfscript>
function init(fw) { variables.fw = fw; }
</cfscript>
<cffunction name="validate" access="public" returntype="array" output="false">
<cfargument name="rc" type="struct" />
<cfargument name="form" type="struct" />
<cfset var errors = arrayNew(1) />
<cfset var thisError = structNew() />
<!--- Email --->
<cfif form.Email eq ''>
<cfset thisError.field = "Email" />
<cfset thisError.type = "error" />
<cfset thisError.message = "Email is required" />
<cfset arrayAppend(errors,duplicate(thisError)) />
</cfif>
If the requirement is to only allow #waldorf.edu email addresses, simply take away the option for the user to enter that part of the address. Make it obvious to the user. Something like this:
<cfinput name="email"
required="yes"
message = "Please enter an email address"
>#waldorf.edu
If you want to enhance this on the form page, you can add some javascript that strips away the #character and everything after it.
In your controller, use a regular expression to ensure that the submitted value contains only characters that are valid for #waldorf.edu email addresses.
I have an application with Login and Logout actions. After pressing Logout button, I would like to redirect to Login page and display here faces message with an information about a successful logging out. Now, I'm struggling with forwarding of faces message. This message doesn't want to display in Login dialog. Could you please give me any hint or recommend me another way? I'm using JSF 2.1 with Spring Security 4. What I have tried:
Logout method
public String doLogout() throws ServletException, IOException {
FacesContext facesContext = FacesContext.getCurrentInstance();
ExternalContext externalContext = facesContext.getExternalContext();
HttpServletRequest request = ((HttpServletRequest) externalContext.getRequest());
RequestDispatcher dispatcher = request.getRequestDispatcher("/j_spring_security_logout");
dispatcher.forward((ServletRequest) externalContext.getRequest(), (ServletResponse) externalContext.getResponse());
facesContext.addMessage("", new FacesMessage("You have been successfully logged out."));
externalContext.getFlash().setKeepMessages(true);
FacesContext.getCurrentInstance().responseComplete();
return null;
}
Login XHTML
<h:form id="loginForm" prependId="false">
<p:dialog visible="true" resizable="false" closable="false" draggable="false" position="center">
<p:messages globalOnly="true" id="msgs"/>
<h:outputLabel for="j_username" value="User" />
<p:inputText id="j_username" required="true"/>
<h:outputLabel for="j_password" value="Password" />
<p:password id="j_password" required="true"/>
<p:commandButton icon="ui-icon-check"
id="login"
action="#{loginController.doLogin}"
oncomplete="handleLoginRequest(xhr, status, args)"
update="msgs"
ajax="false"/>
</p:dialog>
</h:form>
Spring security
<http auto-config="true" >
<intercept-url pattern="/pages/**"
access="ROLE_RA"/>
<form-login login-page="/pages/userLogin.xhtml"
default-target-url="/pages/specimens/specimenOverview.xhtml" />
<logout logout-success-url="/pages/userLogin.xhtml"/>
<session-management invalid-session-url="/pages/userLogin.xhtml">
<concurrency-control max-sessions="1"/>
</session-management>
</http>
Just and parameter to logout url:
<logout logout-success-url="/pages/userLogin.xhtml?logout=true"/>
check it on login page and display your message:
<h:outputText value="Your logout message here" rendered="#{param['logout']}" />
i am unable to populate my Struts2 select drop down in my jsp page.
Note: My jsp page loads through json response.
I have a select box inside a form. But i don't t know how to populate it when my jsp page loads.
And in the same page i have a select dropdown in my Struts2 jquery grid,which i am able to populage but i don't know how to populate a drop down for my form which are out side of the grid.
Please help me regarding this issue.
my jsp page
<s:url id="selecturl" action="selectaction"/>
<s:url id="bookediturl" action="bookeditt"/>
<s:url id="bookremoteurl" action="booksetups"/>
<sjg:grid
id="bookgrid"
formIds="form2"
reloadTopics="reloadMyGrid"
caption="List of Cover Details"
dataType="json"
href="%{bookremoteurl}"
pager="true"
gridModel="gridModel"
rowList="50,100,5000"
rowNum="20"
filter="true"
filterOptions="{stringResult :false,searchOnEnter : false,enableClear : true,gridModel : true}"
rownumbers="true"
editurl="%{bookediturl}"
navigator="true"
editinline="true"
navigatorSearch="false"
autowidth="false"
width= "1550"
viewrecords="true"
navigatorRefresh="true"
navigatorDelete="true">
<sjg:gridColumn name="id" index="locationId" title="ID" formatter="integer" sortable="false" key="true"
search="false" editable="true" hidden="true" />
<sjg:gridColumn name="authLastname" index="authLastname" title="AuthorLastname" sortable="true" search="true" editrules="{required: true}"
editable="true" edittype="text" />
<sjg:gridColumn name="subjectId" title="Subject Name" editable="true" sortable="false" align="center" search="false" searchtype="select"
searchoptions="{dataUrl:'%{selecturl}'}" edittype="select" editoptions="{dataUrl:'%{selecturl}'}" />
</sjg:grid>
<div id="myDivBox" style="display:none; width :300px;position: relative;top: -30px;left: 299px;button:0px;">
<s:form action="searchkeywordss" id="form2" theme="simple" cssClass="yform">
<sj:textfield placeholder="Enter keyword to search" cssClass="txtbox" size="42" maxLength="255" name="keywordsearch"/>
<sj:select href="%{selecturl}" name="countryselect" list="%{lstsub}" listKey="id" listValue="subjectName" theme="jquery" cssStyle="margin-top:4px;"/>
<sj:a button="true" id="btnid" cssStyle="position: relative;top: 0px;left: 09px;" onClickTopics="reloadMyGrid">Find</sj:a>
</s:form>
</div>
struts.xml
<action name="booksetups" class="v.esoft.actions.bookdetails.BookdetailsAction" >
<result name="success" type="json"/>
<result name="login" type="redirect"> /index.jsp </result>
</action>
<action name="selectaction" class="v.esoft.actions.bookdetails.SelectAction">
<result name="success">/select.jsp</result>
</action>
You should only use the sj:select like below
<sj:select href="%{selecturl}" name="countryselect" list="subjectList" listKey="id" listValue="subjectName" theme="jquery" cssStyle="margin-top:4px;"/>
where selecturl returns a json response, subjectList is name of list in the json reponse which contains the options
Your selectaction should have a json response, but what you have now is an action returning a jsp so it would not work. If you cannot change it, you should create another action which returns json.
Hi have a form that call an Action properly. But when i enable the authentication forms, the action to login doesn't fire up (i test it with a breakpoint).
My Web.config is:
<authentication mode="Forms">
<forms loginUrl="Autenticacao/Index"></forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>
It's in the view Index of controller Autenticacao where i have my form:
<% Html.BeginForm("Login", "Autenticacao"); %>
<input type="text" id="autenticacaoReferencia" name="autenticacaoReferencia" /><br />
<input type="text" id="autenticacaoPassword" name="autenticacaoPassword" /><br />
<input type="submit" value="Entrar" />
<% Html.EndForm(); %>
The controller Login is sucefully called just if the authentication form is disable.
Am i using the BeginForm in a wrong way?
Edit: The Login action:
public ActionResult Login(string autenticacaoReferencia, string autenticacaoPassword, string returnUrl)
{
...
}
Thanks
Are you decorating your actions with the [Authorize] attribute?