------------------------------------
<a href="javascript:void(0)" onclick="myFunction()" class="btn btn-success btn-outline-rounded green">Pay With Paypal</a>
-------------------------------------------------------------------------------------------------------------------------
Paypal page html
-------------------
Live url
-----------------
@*<form id="hiddenform" action="https://www.paypal.com/cgi-bin/webscr">*@
-------------------------------------
sandbox url
--------------------
<form id="hiddenform" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
----------------------------
HTML FORM
-------------------
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="amount" value="@Convert.ToDecimal(Session["Total"])"> Put Amount
<input type="hidden" name="currency_code" value="GBP">currency
<input type="hidden" name="item_name" value="Product">
<input type="hidden" name="business" value="xxxxxxx@gmail.com">client paypal id
<input type="hidden" name="return" value="http://localhost:64642/AddPost/PaySuccess">success url
<input type="hidden" name="cancel_return" value="http://localhost:64642/Paypal/Cancle">cancel_return url
</form>
-----------------------javascript code for call the button-----------------------------
<script>
function myFunction() {
document.getElementById("hiddenform").submit();
}
</script>
Total value pass from controller
No comments:
Post a Comment