WordPress PayPal Merchant Cart Integration without Plugin
X

Congrats, You are Subscribed to Receive Updates.

WordPress PayPal Merchant Cart Integration without Plugin


WordPress PayPal Merchant Cart Integration without Plugin. There are number of codes and plugins available to create your cart  and get paid through Paypal. Let’s see the small piece of code to create in your WordPress. First understand, you need to create developer testing accounts.

For that, just login your original Paypal and open this page,   PayPal Developer Accounts.  and here it will create two default accounts with your pre email which you used for the your mail Paypal. Now, the first one is Seller account and another one is buyer account. with that, you can create your store. Lets move back to our coding.

paypal-kvcodes

Just try add the html form on your WordPress create with items.  you might be used cart to select multiple items on the cart and process the payment . so just process the form to provide the necessary details into it. Here i just added subscription example to read premium articles by paying money for articles.

<form id="gateway_form" method="POST" name="gateway_form" action="https://www.sandbox.paypal.com/cgi-bin/webscr">
	<input type="hidden" name="rm" value="1"/>
	<input type="hidden" name="cmd" value="_cart"/>
	<input type="hidden" name="charset" value="utf-8"/>
	<input type="hidden" name="business" value="kvvaradha@kvcodes.com"/>
	<input type="hidden" name="currency_code" value="GBP"/>
	<input type="hidden" name="notify_url" value="<?php echo IPN_Listener_url; ?>"/>
	<input type="hidden" name="item_name_1" value="One Month Pack" />
	<input type="hidden" name="item_number_1" value="KV2341" />
	<input type="hidden" name="amount_1" value="12.45" />
	<input type="hidden" name="quantity_1" value="1"/>
	<input type="hidden" name="return" value="<?php echo MY_SUCCESS_PAGE; ?>"/>
	<input type="hidden" name="upload" value="1"/>
	<input type="hidden" name="mrb" value="3FWGC6LFTMTUG"/>
	<input type="submit" class="btn btn-lg btn-block " value=" Submit" >
</form>

  For testing, just copy paste the above code on your notepad and save it with .html prefix, than open it on browser and click the “Submit ” button, you can see the cart with it.  Here you need to remember the variables, which are important.

You to provide the IPN Listener URL to validate your cart order after customer payment, its indirect details will send by paypal to us to verify the transactions.

the Return URL, which is necessary to redirect the customer after successful payment.

 Also, you can pass multiple custom fields with PayPal IPN, Read here for more informations

commenter

About Varadharaj V

The founder of Kvcodes, Varadharaj V is an ERP Analyst and a Web developer specializing in WordPress(WP), WP Theme development, WP Plugin development, Frontaccounting(FA), Sales, Purchases, Inventory, Ledgers, Payroll & HRM, CRM, FA Core Customization, OpenCart Theme Development, PHP, HTML, CSS, jQuery, Bootstrap development and content SEO.

Comment Below

Your email address will not be published. Required fields are marked *

*

Current ye@r *

Menu

Sidebar

Subscribe E-mail Updates

Congrats, You are Subscribed to Receive Updates.

Advertisement

Category Posts