What may be wrong with my hidden form fields for Paypal custom cart - paypal

I have two Carts on a site I am working on. One works just fine. The other though is not, and I can't find the problem at all.
The code for the form is blow (hidden domain name and email of course):
<form id="paypalpayment" action="https://www.paypal.com/cgi-bin/webscr" method="POST">
<input type="hidden" name="order_id" value="24" />
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="business" value="pay#xxxxxxxx.com" />
<input type="hidden" name="item_name_1" value="Shopping Cart" />
<input type="hidden" name="item_number_1" value="Order-24" />
<input type="hidden" name="amount_1" value="23.49" />
<input type="hidden" name="first_name" value="My" />
<input type="hidden" name="last_name" value="Surname" />
<input type="hidden" name="address1" value="My Street">
<input type="hidden" name="address2" value="My Village">
<input type="hidden" name="city" value="My City">
<input type="hidden" name="zip" value="My Post Code">
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="tax_rate" value="20.00" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="return" value="http://www.xxxxxxxx.co.uk/shop/payments/itempaymentreceived/24" />
<input type="hidden" name="cancel_url" value="http://www.xxxxxxxx.co.uk/shop/payments/paymentcancelled" />
<input type="hidden" name="notify_url" value="http://www.xxxxxxxx.co.uk/shop/payments/itemipn/24" />
<div class="form-group">
<input type="submit" class="btn btn-wide btn-primary" value="Pay Now" id="btnSubmit" name="btnSubmit"/>
</div>
</form>
I know it a case of not seeing the wood for the trees, but any pointer would be gratefully received.
Thanks

Related

gtpay payment intergration which giving a hash key error

I have integrated below test php code to integrate gtpay payment in my site.But I am getting following error.
Response Description: Interface Integration Error
It is has key related problem given in the below gtpay integration manual.
https://ibank.gtbank.com/gtpay/IntegrationAPI/mman-tech.html
But I have tried several time to resolve this issue but not getting any solution. Please find the error.
<?php
$the_key = trim('17'.'5664879896'.'200'.'840'.'458742'.'D3D1D05AFE42AD50818167EAC73C109168A0F108F32645C8B59E897FA930DA44F9230910DAC9E20641823799A107A02068F7BC0F4CC41D2952E249552255710F');
$key = hash('sha512',$the_key,false);
?>
<form name="submit2gtpay_form" action="https://ibank.gtbank.com/GTPay/Tranx.aspx" target="_self" method="post">
<!-- <input type="hidden" name="hashkey" value="">-->
<input type="hidden" name="gtpay_mert_id" value="17" />
<input type="hidden" name="gtpay_tranx_id" value="5664879896" />
<input type="hidden" name="gtpay_tranx_amt" value="200" />
<input type="hidden" name="gtpay_tranx_curr" value="840" />
<input type="hidden" name="gtpay_cust_id" value="458742" />
<input type="hidden" name="gtpay_cust_name" value="Test Customer" />
<input type="hidden" name="gtpay_tranx_memo" value="Mobow" />
<input type="hidden" name="gtpay_no_show_gtbank" value="YES" />
<input type="hidden" name="gtpay_echo_data" value="TEST" />
<input type="hidden" name="gtpay_gway_name" value="" />
<input type="hidden" name="gtpay_hash" value="<?php echo trim($key); ?>" />
<input type="hidden" name="gtpay_tranx_noti_url" value="" />
<input type="submit" value="Pay Via GTPay" name="btnSubmit"/>
<input type="hidden" name="gtpay_echo_data" value="">
</form>
You are required to make the hash of [gtpay_mert_id,gtpay_tranx_id,gtpay_tranx_amt,gtpay_tranx_curr,gtpay_cust_id,gtpay_tranx_noti_url,hashkey] (Total 7 params).
You are making the hash key with only 6 params. You missed with the gtpay_tranx_noti_url(gtpay transaction notifying URL).
The gtpay_tranx_noti_url is a required field.
<?php
$the_key = trim('17'.'5664879896'.'200'.'840'.'458742'.'YES'.'D3D1D05AFE42AD50818167EAC73C109168A0F108F32645C8B59E897FA930DA44F9230910DAC9E20641823799A107A02068F7BC0F4CC41D2952E249552255710F');
$key = hash('sha512',$the_key,false);
?>
<form name="submit2gtpay_form" action="https://ibank.gtbank.com/GTPay/Tranx.aspx" target="_self" method="post">
<!-- <input type="hidden" name="hashkey" value="">-->
<input type="hidden" name="gtpay_mert_id" value="17" />
<input type="hidden" name="gtpay_tranx_id" value="5664879899" />
<input type="hidden" name="gtpay_tranx_amt" value="200" />
<input type="hidden" name="gtpay_tranx_curr" value="840" />
<input type="hidden" name="gtpay_cust_id" value="458742" />
<input type="hidden" name="gtpay_cust_name" value="Test Customer" />
<input type="hidden" name="gtpay_tranx_memo" value="Mobow" />
<input type="hidden" name="gtpay_no_show_gtbank" value="YES" />
<input type="hidden" name="gtpay_echo_data" value="TEST" />
<input type="hidden" name="gtpay_gway_name" value="" />
<input type="hidden" name="gtpay_hash" value="<?php echo trim($key); ?>" />
<input type="hidden" name="gtpay_tranx_noti_url" value="" />
<input type="submit" value="Pay Via GTPay" name="btnSubmit"/>
<input type="hidden" name="gtpay_echo_data" value="">
</form>
Its worked if error in gtpay_tranx_id duplicate entry...
Just change any value and reload it.

Filling out contact phone on paypal

I have a strange problem.... I'm trying to filling out all data in Paypal request but all fields works execpt contact phone. This is my code:
<form name="f" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="amount" value="7.91" /><input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="no_note" value="1" /><input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="currency_code" value="EUR" />
<input type="hidden" name="notify_url" value="http://localhost/ipn.php?idB=37" />
<input type="hidden" name="business" value="info#123.it" />
<input type="hidden" name="item_name" value="Acquisto Prodotti" />
<input type="hidden" name="item_number" value="" />
<input type="hidden" name="quantity" value="1" />
<input type="hidden" name="return" value="http://localhost/sexy/thank_you_page.php" />
<input type="hidden" name="cancel_return" value="http://localhost/" /><input type="hidden" name="first_name" value="John" />
<input type="hidden" name="last_name" value="Doe" />
<input type="hidden" name="address1" value="Viale cattaneo, 23" />
<input type="hidden" name="city" value="Roma" /><input type="hidden" name="state" value="Siracusa" /><input type="hidden" name="zip" value="91230" /><input type="hidden" name="country" value="IT" />
<input type="hidden" name="lc" value="italy" />
<input type="hidden" name="country_code" value="IT" />
<input type="hidden" name="contact_phone" value="1234567" />
<input type="hidden" name="email" value="me#me.com" />
<input type="submit" value="Click here if you are not redirected within 10 seconds" />
</form>
I read here but nothing help
https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
Someone knows how to SET Contact Phone?
Screenshot of the issue.
Use the following fields:
night_phone_a
night_phone_b
night_phone_c
These fields, in the US, shall be used to indicate the number format AAA-BBB-CCC. For other parts of the world, just put everything into night_phone_a.
And BTW, you have visited the right document page. These 3 fields are on the page.

How to create PayPal subscription form with billing address?

I am trying to create a PayPal subscription form with billing address but it doesn't work, I'm unable to figure out the problem, please have a look at this form.
<form name="_xclick" action="https://www.sandbox.paypal.com/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="business.account#test.com" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="item_name" value="Baseball Hat Monthly" />
<input type="hidden" name="item_number" value="123" />
<input type="hidden" name="a3" value="5.00" />
<input type="hidden" name="p3" value="3" />
<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="return" value="http://www.example.com/thankyou" />
<input type="hidden" name="cancel_return" value="http://www.example.com/cancel" />
<input type="hidden" name="notify_url" value="http://www.example.com/ipn" />
<input type="hidden" value="Colorado Springs" name="city" id="city">
<input type="hidden" value="US" name="country" id="country">
<input type="hidden" value="personal.account#test.com" name="email" id="email">
<input type="hidden" value="Tahir" name="first_name" id="first_name">
<input type="hidden" value="Yasin" name="last_name" id="last_name">
<input type="hidden" value="80903" name="zip" id="zip">
<input type="hidden" value="CO" name="state" id="state">
<input type="hidden" value="219 W. Colorado Avenue Suite 200" name="address1" id="address1">
<input type="hidden" value="" name="address2" id="address2">
<input type="hidden" value="1" name="address_override" id="address_override">
<input type="submit" name="submit" value="Subscribe" />
</form>
You can see address_override attribute is set to 1 but when I see the order detail in my PayPal business account, it doesn't show me the submitted address but shows following notice.
When you have "no_shipping=1" set you aren't requiring a shipping address for the transaction so that is why the address doesn't appear during the checkout process and in the transaction details.
I changed it to both "2" and "0" but the address didn't appear after I logged into a test account - like it should. If I switch the button type to be "_xclick" with "no_shipping=2" the address does appear correctly.
I'll file a ticket with the engineers to get this resolved for Subscription buttons.

multiple items in paypal

Trying to send multiple items to a paypal cart and having problems:
This (single item) works fine:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="xxx" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount" value="20.00" />
<input type="hidden" name="item_name" value="1st Item" />
<input type="image" src="addcart.gif" name="submit" alt="cart add" />
</form>
This (multiple items, seems to be suggested solution) fires an error on the cart page that reads "PayPal cannot process this transaction because of a problem with the seller's website. Please contact the seller directly to resolve this problem.":
<
form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="xxx" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount_1" value="20.00" />
<input type="hidden" name="item_name_1" value="1st Item" />
<input type="hidden" name="amount_2" value="20.00" />
<input type="hidden" name="item_name_2" value="2nd Item" />
<input type="image" src="addcart.gif" name="submit" alt="cart add" />
</form>
Two forms (below) work fine, but I am trying to get the submission done with one form and one click.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="xxx" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount" value="20.00" />
<input type="hidden" name="item_name" value="1st Item" />
<input type="image" src="addcart.gif" name="submit" alt="cart add" />
</form>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
<input type="hidden" name="business" value="xxx" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount" value="20.00" />
<input type="hidden" name="item_name" value="2nd Item" />
<input type="image" src="addcart.gif" name="submit" alt="cart add" />
</form>
If I use the following, it works fine, but it doesn't go to the cart page, rather a "Choose your way to pay" page
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
<input type="hidden" name="business" value="xxx" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="amount_1" value="20.00" />
<input type="hidden" name="item_name_1" value="1st Item" />
<input type="hidden" name="amount_2" value="20.00" />
<input type="hidden" name="item_name_2" value="2nd Item" />
<input type="image" src="addcart.gif" name="submit" alt="cart add" />
</form>
Any suggestions?
You would not be able to add multiple items to the cart at once, when using the add to cart button which is indicated by the following two lines of code.
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="add" value="1" />
You have to use the cart upload command, to be able to upload mutlipe items as once.
<input type="hidden" name="cmd" value="_cart" />
<input type="hidden" name="upload" value="1" />
The reason that it does not take you to cart page, is this method is what you would be using if you were using a 3rd party cart, or a customized cart. If you are wanting to show the buyers what is in their cart, you would need to do this on your webiste prior to passing the data over to PayPal. On your website, they would add, remove or adjust the quantity and then when they are ready to checkout is when you would redirect the buyer over to PayPal to pay.

Paypal subscription free trial isn't working

I'm using the following form, but the customer is charged immediately and doesn't get the 5 day trial. I have no idea why. I tried this with the sandbox and on the "regular" paypal site. What do I miss here?
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="xxx#xxx.com" id="id_business"/>
<input type="hidden" name="item_name" value="xxx" id="id_item_name"/>
<input type="hidden" name="item_number" value="1" id="id_item_number"/>
<input type="hidden" name="a1" value="0" id="id_a1" />
<input type="hidden" name="p1" value="5" id="id_p1" />
<input type="hidden" name="t1" value="D" id="id_t1" />
<input type="hidden" name="a3" value="14.95" id="id_a3" />
<input type="hidden" name="p3" value="1" id="id_p3" />
<input type="hidden" name="t3" value="M" id="id_t3" />
<input type="hidden" name="src" value="1" id="id_src" />
<input type="hidden" name="sra" value="1" id="id_sra" />
<input type="hidden" name="no_note"value="1" id="id_no_note"/>
<input type="hidden" name="modify" value="1" id="id_modify" />
<input type="hidden" name="lc" value="US" id="id_lc" />
<input type="hidden" name="notify_url" value="http://xxx/payment/paypal-ipn/" id="id_notify_url" />
<input type="hidden" name="cancel_return" value="http://xxx/payment/canceled/" id="id_cancel_return" />
<input type="hidden" name="return" value="http://xxx/payment/thank_you/" id="id_return_url" />
<input type="hidden" name="custom" value="user=joe;db=1" id="id_custom" />
<input type="hidden" name="cmd" value="_xclick-subscriptions" id="id_cmd" />
<input type="hidden" name="charset" value="utf-8" id="id_charset" />
<input type="hidden" name="currency_code" value="EUR" id="id_currency_code" />
<input type="hidden" name="no_shipping" value="1" id="id_no_shipping" />
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="Buy it Now" /></form>
Looks like you need to set modify to 0.
At least now it is working for me again.