Wordpress form not sending file attachement to CRM - wordpress

I may have hit my limit on knowledge on this :-)
I have a wordpress form to integrate with a CRM. When submitted it sends correctly all the data from the form apart from the file attachment. This won't upload.
My code is below... The varchar ID's match the CRM special fields and work fine and so does the re-direct to thank you page.
Am I missing something here to help upload the attachment, or is it an error and just not talking to the CRM's backend?
Many thanks
<form id="HubForm" action="https://www.CRM-DOMAIN-NAME/Api/FormAdd" method="post">
<input type="hidden" name="ClientId" value="123"><input type="hidden" name="FormTypeId" value="123">
<input type="hidden" name="redirect" value="https://www.CLIENTS-DOMAIN-NAME.co.uk/applied/">
<input id="firstname" class="emrform" name="firstname" type="text" placeholder="First Name" required /><br>
<input id="lastname" class="emrform" name="lastname" type="text" placeholder="Last Name" required /><br>
<input id="email" class="emrform" name="varchar3" type="text" placeholder="Phone number" required /><br>
<input id="firstname" class="emrform" name="email" type="text" placeholder="Email" required /><br> Upload your CV<br><input id="fileUpload" class="emrform" name="fileUpload" type="file" accept=".pdf,.doc,.docx" /><br> Interested in receiving further
emails?
<br>
<input type="radio" name="varchar4" value="yes" id="varchar4" checked> YES<br>
<input type="radio" name="varchar4" value="no" id="varchar4"> no<br>
<br>
<br>
<textarea class="emrform" id="textarea" rows="5" name="varchar2" placeholder="Message details..."></textarea>
<br>
<input type="submit" class="emrbtn emrbtn-primary" value="Submit"></form>
<div id="HubFormResult">

Related

Paypal integration questions

I have some code that i wrote many years ago to integrate Paypal within my site. So a user adds multiple products to their cart and then checks out which then automatically takes the user to the paypal site.
I decided to revisit it today and created the following HTML
<form name="myForm" method="POST" action="https://www.sandbox.paypal.com/cgi-bin/webscr" >
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value="myemail-facilitator#myDomain.com"/>
<input type="hidden" name="item_name" value="Product 1"/>
<input type="hidden" name="amount" value="500.00"/>
<input type="hidden" name="quantity" value="1"/>
<input type="hidden" name="upload" value="1"/>
<input type="hidden" name="currency_code" value="GBP"/>
<input type="hidden" name="return" value="http://XX/paypal/completed.aspx"/>
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cancel_return" value="http://XX/paypal/Cancel.aspx"/>
<input type="hidden" name="shopping_url" value="http://XX/paypal/MyShop"/>
<input type="hidden" name="notify_url" value="http://XX/paypal/MyShop/checkout.aspx"/>
<input type="hidden" name="lc" value="GB"/>
<input type="hidden" name="image_url" value="http://XX/paypal/shop.gif"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="invoice" value="ZZZ1234567890"/>
<script type="text/javascript">document.myForm.submit();</script></form>
This came up with an error "Error Detected Your shopping cart is empty".
Logged into my sandbox account and no error listed to determine what ive done wrong.
Googled around which suggested to change _cart to _xclick - which resolved the issue, however when i read the documentation at
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
I dont understand why _cart didnt work? Is there a more appropriate way to do this or _xclick fine with my site setup as described above?
For multiple items i was looping the item_name and amount and adding each value, but this doesnt work the way i expected i.e. I've seen sites where they display each product, quantity and amount for each product in the cart and then total - where did i go wrong?
Finally once a transaction is complete i have set up the IPN value to send the details to my site..... Do i need the site to be using https in order for this to work or would http work?
I tried searching for these answers but some are quite dated or using 3rd part components.
Please make below changes to your HTML codes to make your form work again.
<input type="hidden" name="item_name" value="Product 1"/>
<input type="hidden" name="amount" value="500.00"/>
<input type="hidden" name="quantity" value="1"/>
↓↓
<input type="hidden" name="item_name_1" value="Product 1"/>
<input type="hidden" name="amount_1" value="500.00"/>
<input type="hidden" name="quantity_1" value="1"/>

How to hide form field while reusing same form

I am using the following form to save user information.
<%# taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<sf:form action="someAction"method="post" commandName="backingBean">
<sf:input type="hidden" name="userId" path="userId" />
<sf:input type="text" placeholder="Username" name="username" path="username" />
<sf:input placeholder="Password" path="password" type="password" name="password" />
<sf:input placeholder="Email" name="email" type="email" path="email" />
<input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
<button type="submit" class="btn btn-default">Submit</button>
</sf:form>
When an user want to edit their information I am sending them the same form using hidden userId. But this time I wish not show password filed in the form. How do I do that.
You could try with an <c:choose><c:when.. that tests a condition and does what you want: "not show password filed in the form"

Changing WordPress form redirect URL based on options chosen?

I am creating a simple WordPress website, similar to this one: http://viewsyoutubes.com/
I need a form inserted, that when completed, will send the visitor to the PayPal payment page (so when the form is submitted, it redirects the visitor to the payment page URL).
However, I don't know how to make it so that depending on the option they have chosen, it sends them to a different payment page (there are different prices for different products - so when a product is selected, it needs to redirect the visitor to the corresponding payment page). It needs to be something like this:
http://viewsyoutubes.com/buy-youtube-views/
When a different package is selected, it sends you to a different payment page.
This is the site at the moment, as you can see there are 20 options in the drop down list, and i need the submit URL to change corresponding to the item that was chosen.
Thanks.
medialads.tk/youtube-views-likes/
You mean something like this?
<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="Your#email.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Shopping Cart">
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<input type="hidden" name="on0" value="Sizes"><select name="os0">
<option value="Small">Small $5.00 USD</option>
<option value="Med">Med $7.00 USD</option>
<option value="Larg">Larg $10.00 USD</option>
<option value="Super Size">Super Size $15.00 USD</option>
</select>
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="option_select0" value="Small">
<input type="hidden" name="option_amount0" value="5.00">
<input type="hidden" name="option_select1" value="Med">
<input type="hidden" name="option_amount1" value="7.00">
<input type="hidden" name="option_select2" value="Larg">
<input type="hidden" name="option_amount2" value="10.00">
<input type="hidden" name="option_select3" value="Super Size">
<input type="hidden" name="option_amount3" value="15.00">
<input type="hidden" name="option_index" value="0">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_cart_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

Passing custom PayPal payment fields

So I'm trying to implement a PayPal payment field on my Wordpress site that has two custom fields where users can type in.
One, being invoice number
Two, being the price.
I found some code (untested) from another post here on stackoverflow, that is working as of 2013 (last post of the thread).
Passing price variable to PayPal with custom button
It has a text box where users can type in their custom price, and it gets passed to PayPal. I need to edit the form to allow the invoice number passing too. Does anyone have any idea how to do this? Never used PayPal API before. All help is greatly appreciated, thanks!
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="XXXXXXXX">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Payments">
<input type="hidden" name="amount" value="100.00">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="cn" value="Add special instructions to the seller:">
<input type="hidden" name="no_shipping" value="2">
<input type="hidden" name="rm" value="1">
<input type="hidden" name="return" value="http://YOURSITE.com/">
<input type="hidden" name="cancel_return" value="http://YOURSITE.com/payments.html">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
I ended up working it out.
I had to change type="hidden" for the item_name to type="text".
Very simple fix, wasn't expecting it to be this easy!

Paypal Integration Post processing information

I have created a simple button, on a click of it direct it to the paypal site for the payment.
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="abhish_1347270213_biz#gmail.com" />
<input type="Show" name="item_name" value="My painting" />
<input type="Show" name="amount" value="10.00" />
<input type="submit" value="Buy!" />
</form>
Now what I am trying to do is to redirect to my own page with the transaction successful notification.
I have read websites articles but nothing is providing me with the Solution. Need help regarding to this issue.
Use PayPal Instant Payment Notification (IPN), more information here: https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/article_pdn_intro-outside.
Here's a code sample:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="alanb#alanb.com">
<input type="hidden" name="undefined_quantity" value="1">
<input type="hidden" name="item_name" value="doodad from alanb.com">
<input type="hidden" name="item_number" value="dd01">
<input type="hidden" name="amount" value="4.99">
<input type="hidden" name="return" value="http://alanb.com/doodads/thanks.html">
<input type="hidden" name="cancel_return" value="http://alanb.com/doodads/canceled.html">
<input type="image" border="0" name="submit" src="http://images.paypal.com/images/x-click-but5.gif" alt="Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée">
</form>
The trick is done by the "return" input element ;).
Another thing that helped me a lot when setting up PayPal Integral Evolution on my website, was this PDF: https://cms.paypal.com/cms_content/FR/en_US/files/developer/IntegralEvolution.pdf. It documents all fields, possible values and how to use them.
Hope this helps,
Carl

Resources