Paypal Subscription price shows zero - php

I have the following form code in my website however when I click on the Paypal subscription button the price of the subscription shows $0.00 on the paypal checkout page. Is there something wrong with my form parameters?
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="registrations-facilitator#invent2win.com">
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="a3" value="5.55"> <!--Cost-->
<input type="hidden" name="t3" value="1"> <!--Monthly subscription-->
<input type="hidden" name="p3" value="M"> <!--Monthly subscription-->
<input type="hidden" name="src" value="1"> <!--YES, make it reoccurring-->
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="item_name" value="Economy Sandbox">
<input type="hidden" name="item_number" value="$usernum" />
<input type="hidden" name="return" value="http://www.example.com/purchasecomplete&email=$email?num=$usernum" />
<input type="hidden" name="cancel_return" value="http://www.example.com/cancel" />
<input type="hidden" name="notify_url" value="http://www.example.com/purchasecomplete&email=$email?num=$usernum">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_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>

This should work for you:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="registrations-facilitator#invent2win.com">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="a3" value="5.55">
<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="no_note" value="1">
<input type="hidden" name="item_name" value="Economy Sandbox">
<input type="hidden" name="item_number" value="4" />
<input type="hidden" name="return" value="http://www.example.com/purchasecomplete&email=$email?num=$usernum" />
<input type="hidden" name="cancel_return" value="http://www.example.com/cancel" />
<input type="hidden" name="notify_url" value="http://www.example.com/purchasecomplete&email=$email?num=$usernum">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_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>

Related

How to make sure the paypal notify_url being called from paypal server?

I was working with paypal recurring payment subscription form and using sandbox account for testing
here is my form:
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick-subscriptions">
<input type="hidden" name="business" value="testacc#email.com">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Standard Pack">
<input type="hidden" id="item_number" name="item_number" value="1233434-23213">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="user_id" value="13692">
<input type="hidden" id="package_id" name="package_id" value="<?php echo $package_type; ?>">
<input type="hidden" name="a1" value="0">
<input type="hidden" name="p1" value="1">
<input type="hidden" id="t1" name="t1" value="M">
<input type="hidden" id="a3" name="a3" value="10">
<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="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input name="return" type="hidden" value="<?php echo base_url();?>package/new_payment_success" />
<input name="notify_url" type="hidden" value="<?php echo base_url();?>package/new_payment_notify" />
<input name="cancel_return" type="hidden" value="<?php echo base_url();?>package/new_payment_cancel" />
<div class="paypal-btn">
<input type="image" src="pay-with-paypal.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!" style='width: 125px'>
</div>
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
and it's working totally fine and sends a success information to notify_url url
now for security purpose im checking HTTP_USER_AGENT from $_SERVER variable but this can be modified too.
so how can i make sure that transection is done successfully before i update my database?
I think that you can verify the whole POST content by appending cmd=_notify-validate and sending it to PayPal. They will answer you with a Verified or Not verified response.
Please, check the link below for more information:
https://developer.paypal.com/docs/classic/ipn/gs_IPN/

paypal success url return null

i have simple paypal checkout form when i post it to paypal with sandbox credential when the paypments success, it gives me nothing like transaction and currency, i did print GET, but there is nothing. i am using codeigniter
below is the form code
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_click">
<input type="hidden" name="business" value="dev1#ferozitech.com">
<input type="hidden" name="item_name" value="test" class="slug">
<input type="hidden" name="item_number" value="2" class="proposalId">
<input type="hidden" name="custom" value="" class="userId">
<input type="hidden" name="amount" value="40" class="amount">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="<?php echo base_url('payment/payment_complete/') ?>">
<input type="hidden" name="cancel_return" value="<?php echo base_url('payment/payment_cancel') ?>">
<input type="image" name="submit" src="<?php echo base_url('images/checkoutpaypal.png'); ?>" alt="PayPal - The safer, easier way to pay online">
</form>
Try this code:
<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="dev1#ferozitech.com">
<input type="hidden" name="item_name" value="test" class="slug">
<input type="hidden" name="item_number" value="2" class="proposalId">
<input type="hidden" name="custom" value="" class="userId">
<input type="hidden" name="amount" value="40" class="amount">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="lc" value=""/>
<input type="hidden" name="no_note" value="1"/>
<input type="hidden" name="return" value="<?php echo base_url('payment/payment_complete/') ?>">
<input type="hidden" name="cancel_return" value="<?php echo base_url('payment/payment_cancel') ?>">
<input type="hidden" name="notify_url" value="<?php echo base_url('payment/payment_complete/') ?>" />
<input type="image" name="submit" src="<?php echo base_url('images/checkoutpaypal.png'); ?>" alt="PayPal - The safer, easier way to pay online">
</form>
Return url notify_url payment_complete function
print_r($_REQUEST);die;

getting error "Your purchase couldn't be completed".in paypal .

this image which test in localhost
view.blade.php`
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" target="PPDGFrame" class="standard" id='paypal_id' accept-charset="utf-8">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="{!! $send_money->financial_account->paypal_account !!}">
<!-- -->
<input type="hidden" name="item_number_1" value="1"/>
<input type="hidden" name="item_name_1" value="Tansfer"/>
<!-- <input type="hidden" name="rm" value="2"/>
<input type="hidden" name="test_ipn" value="1" />-->
<input type="hidden" name="expType" value="instant">
<input type="hidden" name="amount_1" value="{!! $send_money->withdraw_amount !!}">
<input type="hidden" name="buyer_credit_promo_code" value="">
<input type="hidden" name="buyer_credit_product_category" value="">
<input type="hidden" name="email" value="kushwahavikas1993#gmail.com">
<!-- {!! Config::get('constants.Paypal_account') !!} -->
<input type="hidden" name="buyer_credit_user_address_change" value="">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="US">
<input type='hidden' name='cancel_return' value='http://example.com/cancel.php'>
<input type='hidden' name='return' value='http://localhost/softral/public/admin/financial/requestMoney/getDone'>
<input type="hidden" name="detail1_description" value="Softral Payment"/>
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="submit" value="Pay!"/>
</form>`
I dont undersatnd what went wrong with this code any solution will be highly appriciated.

How to get Paypal 'Add to Cart' button response?

I m trying to add a Paypal Add to cart button in my application. For that i create code from paypal sanbox. This is my form,
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="EGZD52TPWUERY">
<input type="hidden" name="lc" value="US">
<input type="hidden" name="item_name" value="Fees">
<input type="hidden" name="item_number" value="255">
<input type="hidden" name="amount" value="85.00">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="button_subtype" value="products">
<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="my-application/paypal/success">
<input type="hidden" name="tax_rate" value="0.000">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="item_id_<?php echo $res_1->id; ?>" value="<?php echo $res_1->id; ?>" />
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<input type="image" src="https://www.sandbox.paypal.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.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
The payment transaction is completed successfully and the redirect is done perfectly to my application. But the problem is i didn't get any response in that page. I tried var_dump($_POST). It retruns null. Don't know why i didn't get any response. Any help is appreciated.
Check the following link and update your paypal account.The response is in $_GET
https://developer.paypal.com/webapps/developer/docs/classic/products/payment-data-transfer/

Not getting response for paypal "add to cart" button followd by paypal checkout

My add to cart button is having this code.
<form target="paypal" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post" >
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="business" value="ajith-facilitator#pavanathara.com">
<input type="hidden" name="lc" value="UK">
<input type="hidden" name="item_name" value="<?= #$row['prod_name'] ?>">
<input type="hidden" name="item_number" value="<?= #$row['prod_id'] ?>">
<input type="hidden" name="amount" value="<?= #$row['prod_price'] ?>">
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="button_subtype" value="products">
<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="https://paypalipn.my.phpcloud.com/payment-successful.php">
<input type="hidden" name="cancel_return" value="https://paypalipn.my.phpcloud.com/payment-cancelled.php">
<input type="hidden" name="tax_rate" value="<?= #$settings[0]['pbreakup_value'] ?>">
<input type="hidden" name="shipping" value="<?= #$settings[1]['pbreakup_value'] ?>">
<input type="hidden" name="add" value="1">
<input type="hidden" name="bn" value="PP-ShopCartBF:btn_cart_LG.gif:NonHosted">
<input type="hidden" name="prod_id" value="<?= #$row['prod_id'] ?>">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_cart_LG.gif" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
But on https://paypalipn.my.phpcloud.com/payment-successful.php I am not receiving any response from paypal.

Categories