PayPal Checkout with Multiple Items with Quantuty - Unknown Error - php

I am trying send a PayPal multiple items with quantity and amount in a shopping cart. When i try to send the following i get a unknown error. i dont know why
<form name="check_out_form" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="sales#ss.com"/>
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="currency_code" value="USD"/>
<input type="hidden" name="item_number_1" value="1"/>
<input type="hidden" name="item_name_1" value="Featured: 3"/>
<input type="hidden" name="amount_1" value="9.95"/>
<input type="hidden" name="quantity_1" value="3"/>
<input type="hidden" name="item_number_2" value="2"/>
<input type="hidden" name="item_name_2" value="Standard: 2"/>
<input type="hidden" name="amount_2" value="2.95"/>
<input type="hidden" name="quantity_2" value="2"/>
<input type="hidden" name="page_style" value="Career"/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="no_shipping" value="1"/>
<input type="hidden" name="return" value="http://www.sss.com/welcome.php?id=success"/>
<input type="hidden" name="return_cancel" value="http://www.sss.com/welcome.php"/>
<input type="hidden" name="custom" value="id|1-custom|1-fea|9.95|3|29.85-std|2.95|2|5.9-total|"/>
<input type="hidden" name="notify_url" value="http://www.sss.com/ipn.php"/>
<input type="hidden" name="cbt" value="Complete Upgrade">
<input type="submit" name="button" id="button" value="Pay now"/>
</form>
I cant figure out what i am doing wrong here i get error saying
"We have detected a problem with this shopping cart. If the problem persists, please contact the merchant. At this time, we are unable to process your request. Please return to xxl and try another option."

Add a new variable called "upload", so it might look like:
...
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
...
Tried it, worked with your code in my PP-Sandbox.

Related

How to change currency in PayPal for 3rd-party shopping cart checkout?

I am using this PayPal payment method in my project and I facing one issue in currency.
I have followed this link steps(https://www.paypal.com/cgi-bin/webscr?cmd=p/pdn/howto_checkout-outside#methodone) and integrated PayPal, all things working fine but the currency showing wrong on the checkout page but when going to the next page it is showing properly.
I want to change the currency text from USD to EUR on the checkout page. how it is possible.
Can any help with it?
here is code
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="frmTransaction" id="frmTransaction">
<input type="hidden" name="business" value="Email">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="">
<input type="hidden" name="shipping" value="0"/>
<input type="hidden" name="item_number" value="">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="notify_url" value="">
</form>
1, Add EUR currency to your Paypal account using this link
like this screenshot
OR
Go to > Account Settings > BUSINESS PROFILE > Money, banks and cards > Currency management
2, Remove these two elements from your form
<input type="hidden" name="rm" value="2">
<input type="hidden" name="upload" value="1">
your final form code like below
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" name="frmTransaction" id="frmTransaction">
<input type="hidden" name="business" value="web91.siddharth#gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="shipping" value="1"/>
<input type="hidden" name="item_number" value="">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="cancel_return" value="">
<input type="hidden" name="return" value="">
<input type="hidden" name="notify_url" value="">
<input type="submit" value="Pay Now">
</form>

Paypal Recurring Subscription cart auto cancellation happening always

Hi I am using paypal recurring subscription for my one opencart website
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="test#eyelook.com">
<input type="hidden" name="item_name_1" value="1 • DAY ACUVUE DEFINE with Lacreon">
<input type="hidden" name="item_number_1" value="1DAY-DEFINE-30">
<input type="hidden" name="amount_1" value="50.00">
<input type="hidden" name="quantity_1" value="1">
<input type="hidden" name="weight_1" value="50">
<input type="hidden" name="on0_1" value="RIGHT EYE">
<input type="hidden" name="os0_1" value=" ">
<input type="hidden" name="on1_1" value="Colour">
<input type="hidden" name="os1_1" value="Accent Style BLACK">
<input type="hidden" name="on2_1" value="Base Curve">
<input type="hidden" name="os2_1" value="8.5">
<input type="hidden" name="on3_1" value="Power">
<input type="hidden" name="os3_1" value="-0.00">
<input type="hidden" name="on4_1" value="Diameter">
<input type="hidden" name="os4_1" value="14.2">
<input type="hidden" name="on5_1" value="Subscription">
<input type="hidden" name="os5_1" value="Every 2 Months">
<input type="hidden" name="item_name_2" value="Shipping, Handling, Discounts & Taxes">
<input type="hidden" name="item_number_2" value="">
<input type="hidden" name="amount_2" value="3.00">
<input type="hidden" name="quantity_2" value="1">
<input type="hidden" name="weight_2" value="0">
<input type="hidden" name="currency_code" value="SGD">
<input type="hidden" name="first_name" value="Test Niyaz">
<input type="hidden" name="last_name" value="Hussain">
<input type="hidden" name="address1" value=" sdsdsds">
<input type="hidden" name="address2" value="">
<input type="hidden" name="city" value="dsdsd">
<input type="hidden" name="zip" value="121323">
<input type="hidden" name="country" value="NE">
<input type="hidden" name="address_override" value="0">
<input type="hidden" name="email" value="niyak2#gmail.com">
<input type="hidden" name="invoice" value="12898 - Test Niyaz Hussain">
<input type="hidden" name="lc" value="en">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="charset" value="utf-8">
<input type="hidden" name="return" value="http://eyelookgood.com/index.php?route=checkout/success">
<input type="hidden" name="notify_url" value="http://eyelookgood.com/index.php?route=payment/pp_standard/callback">
<input type="hidden" name="cancel_return" value="http://eyelookgood.com/index.php?route=checkout/checkout">
<input type="hidden" name="paymentaction" value="sale">
<input type="hidden" name="custom" value="12898">
<input type="hidden" name="bn" value="OpenCart_2.0_WPS">
<input type="button" onclick="checkSubscription();" value="Confirm Order" class="btn btn-primary">
</form>
I have contacted the paypal guys. They said it's a setting issue. May I know what is the error in the above code? Please help me out for this issue please?
You must use in your html form parameters "p3" and "t3".
p3: Specify an integer value in the allowable range for the units of duration that you specify with t3.
t3: Regular subscription units of duration.
Allowable values are:D – for days; allowable range for p3 is 1 to 90W – for weeks; allowable range for p3 is 1 to 52M – for months; allowable range for p3 is 1 to 24Y – for years; allowable range for p3 is 1 to 5
Also the cmd parameter must be _xclick-subscriptions instead _cart
Follow this example:
<form method="post" name="formName" id="submitThisForm" action="https://www.paypal.com/cgi-bin/webscr" >
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="your#papypamail.com" />
<input type="hidden" name="item_name" value="Your Membership" />
<input type="hidden" name="a3" value="0.01">
<input type="hidden" name="p3" value="1">
<input type="hidden" name="t3" value="M">
<input type="hidden" name="src" value="1">
<input type="hidden" name="sra" value="1">
<input type="hidden" name="item_number" value="2" />
<input type="hidden" name="custom" value="SECURITYCODE" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="return" value="page going after payment" />
<input type="hidden" name="cancel_return" value="" />
<input type="hidden" name="cbt" value="ITEM DESCRIPTION" />
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="notify_url" value="your_listener_file.php" />
The allowable range for parameter "p3" is 1 to 24.
In your case must set
<input type="hidden" name="p3" value="1">
AND
<input type="hidden" name="t3" value="M">
It is appear you are not created a subscription button because the value="_s-xclick" is missing. For subscription button you shopuld specified below variable in your button code ;
<input type="hidden" name="cmd" value="_s-xclick">
You can have a reference here.

Paypal IPN unable to change currency type from USD to GBP

Here's the form...
<form method="post" name="paypal_form" action="https://www.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="email_address"/>
<input type="hidden" name="return" value="URL"/>
<input type="hidden" name="cancel_return" value="URL"/>
<input type="hidden" name="notify_url" value="URL"/>
<input type="hidden" name="item_name" value="item_name"/>
<input type="hidden" name="amount" value="30.00"/>
<input type="hidden" name="mc_currency" value="GBP"/>
<input type="submit" value="Pay online now.">
</form>
Problem is it's always in USD, despite the mc_currency value and I've tried a whole bunch of permutations to no effect. Ideas?
Use currency_code
<input type="hidden" name="currency_code" value="GBP">

Paypal Integration with PHP

I am using this code to create my subscription for PayPal.
But it is not recognizing any of my input fields. Would you be able to shed some light on why not?
<form method="POST" name="gateway_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cmd" value="_xclick"/>
<input type="hidden" name="business" value="EMAIL"/>
<input type="hidden" name="currency_code" value="CAD"/>
<input type="hidden" name="return" value="http://www.URL.com/payment/paypal_success.php"/>
<input type="hidden" name="cancel_return" value="http://www.URL.com/payment/paypal_failure.php"/>
<input type="hidden" name="notify_url" value="http://www.URL.com/payment/paypal_ipn.php"/>
<input type="hidden" name="item_name" value="Monthly Subscription"/>
<input type="hidden" name="discount_amount" value="0.00"/>
<input type="hidden" name="a3" value="49.00"/>
<input type="hidden" name="t3" value="M"/>
<input type="hidden" name="p3" value="30"/>
<input type="hidden" name="src" value="1"/>
<input type="hidden" name="sra" value="1"/>
<input type="hidden" name="srt" value="1"/>
<input type="submit" value="Click Here"></p>
</form>
You need to tell PayPal who is submitting the request by submitting the required URL parameters user, pwd, version, and (recommended but optional) signature, along with the other parameters you're sending in the POST request. See API Overview.
Take a look at this link:
Subscriptions and Recurring Payments Variables
https://www.paypal.com/cgi-bin/webscr?cmd=p/acc/ipn-subscriptions-outside
Also, I suggest you use a hosted button. It makes the whole process very easy.
Well both you guys were right, but the issue that came about was because on my 3rd line there
<input type="hidden" name="cmd" value="_xclick"/>
needs to become
<input type="hidden" name="cmd" value="_xclick-subscriptions"/>
Thanks for your help!

submitting multiple items to paypal cart at once with php

I have some items for sale that have 2 and 3 levels of customization. Once set the user adds them to my onsite cart. Problem is, how can i send each item to paypal on checkout? The only code ive found for dynamic buttons supports only a single item.
<form method="post" action="https://www.paypal.com/cgi-bin/webscr" target="paypal">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="add" value="1">
<input type="hidden" name="business" value="EMAIL">
<input type="hidden" name="item_name" value="Item #1">
<input type="hidden" name="item_number" value="123456">
<input type="hidden" name="amount" value="7.00">
<input type="hidden" name="shipping" value="0">
<input type="hidden" name="shipping2" value="0">
<input type="hidden" name="handling" value="0">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://www.yoursite.com/thankyou.htm">
<input type="hidden" name="undefined_quantity" value="1">
<input type="image" src="http://images.paypal.com/en_US/i/btn/x-click-but22.gif" border="0" name="submit" width="87" height="23" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
I tried adding
<input type="hidden" name="item_name_2" value="Item #1">
<input type="hidden" name="item_number_2" value="123456">
<input type="hidden" name="amount_2" value="7.00">
But no positive result.
Any ideas?
Here is the solution
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="email#email.com">
<input type="hidden" name="item_name_1" value="Item #1">
<input type="hidden" name="amount_1" value="1.00">
<input type="hidden" name="item_name_2" value="Item #2">
<input type="hidden" name="amount_2" value="2.00">
<input type="submit" value="PayPal">
</form>
Why don't you send the total amount your client has to pay to PayPal?

Categories