<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gj |</title>
	<atom:link href="https://blog.gaiterjones.com/category/magento/paypal/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.gaiterjones.com/category/magento/paypal/</link>
	<description>gaiterjones</description>
	<lastBuildDate>Sat, 13 Feb 2016 08:33:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.4.3</generator>
	<item>
		<title>Magento PayPal Plus Integration</title>
		<link>https://blog.gaiterjones.com/magento-paypal-plus-integration/</link>
					<comments>https://blog.gaiterjones.com/magento-paypal-plus-integration/#comments</comments>
		
		<dc:creator><![CDATA[PAJ]]></dc:creator>
		<pubDate>Fri, 12 Feb 2016 18:09:02 +0000</pubDate>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[PayPal]]></category>
		<guid isPermaLink="false">http://blog.gaiterjones.com/?p=1439</guid>

					<description><![CDATA[If you are an online retailer in Germany using PayPal chances are you have or will be getting a call from PayPal encouraging you to migrate your PayPal payment methods...<a class="more-link" href="https://blog.gaiterjones.com/magento-paypal-plus-integration/" title="Continue reading">Continue reading</a>]]></description>
										<content:encoded><![CDATA[<p>If you are an online retailer in Germany using PayPal chances are you have or will be getting a call from PayPal encouraging you to migrate your PayPal payment methods to PayPal Plus.</p>
<h2>What is PayPal Plus?</h2>
<p>PayPal introduced PayPal Plus in February 2015 as an all in one payment solution for <strong>online retailers in Germany</strong>. It differs from the normal Magento PayPal methods &#8211; standard and express in a few ways.</p>
<ul>
<li>it uses PayPal’s RESTful API</li>
<li>payment methods are embedded in a checkout &#8220;payment wall&#8221; using an iFrame</li>
<li>multiple payment options are available
<ul>
<li>credit card, direct debit  (Lastschrift), invoice payment (Kaufaufrechnung)</li>
</ul>
</li>
<li>a paypal account is not required to pay</li>
</ul>
<h3>Why is PayPal Plus only available in Germany</h3>
<p>The Germans are very careful when it comes to online data protection, especially where money is concerned. I would guess that the requirement for other payment methods in Germany such as Lastschrift (direct debit) which is a very popular way of paying for all sorts of things in Germany has prompted Paypal to develop a solution tailored specifically toward German consumer requirements.</p>
<h2>How to implement PayPal Plus</h2>
<h3>Magento module</h3>
<p>PayPal will send you an open source PayPal Plus module developed by <a href="http://www.i-ways.net/">iWays</a>. The module will run on Magento CE 1.7 or greater using the default checkout. It also supports some other one page checkout modules.</p>
<p>Module installation is pretty straight forward &#8211; I didn&#8217;t find a GitHub version so created my own as I prefer to manage my module installations with modman.</p>
<p>After installation refresh your caches and a new payment method is created, configure PayPal Plus from system &gt; config &gt; sales &gt; payment methods &gt; paypalplus settings.</p>
<p>The Merchant Country for your store must be set to Germany, PayPal Plus is (at the time of writing) only available in Germany, <em>the module settings will not be displayed if your Merchant Country is not set to Germany</em>.</p>
<p>Configure your PayPal app client and client secret and turn on the sandbox mode for testing.</p>
<p>Note &#8211; if you have OPCACHE enabled and the opcache.save_comments option disabled you Magento will throw an exception with a &#8220;class should have a proper return type&#8221; error. Enable save_comments and reload Apache to continue.</p>
<h2>REST API</h2>
<p>In REST the classic API signature is replaced with <strong>client_ID</strong> and <strong>client secret</strong>. These need to be generated by creating a <a href="https://developer.paypal.com/" target="_blank">PayPal app</a>. To create a PayPal app log in to the PayPal Developer portal with your PayPal account and navigate to the My REST apps page. Click Create App to begin the application-creation process. The app will automatically be in sandbox mode.</p>
<h1>testing</h1>
<p>With valid sandbox API credentials and the module enabled you will see your payment methods have been replaced by the PayPalPlus payment methods templates (<em>base/default/template/paypalplus</em>). The template embeds the PayPal Plus payment wall iFrame into your checkout page including the 4 standard payment methods.</p>
<p>Note &#8211; if you have already extended and customised the base payment method template it has now also been extended by the iWays modules templates. You will need to extend the iWays templates and modify them with your customisations.</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter wp-image-1434 size-large" src="https://blog.gaiterjones.com/wp-content/uploads/2016/02/paypalplus-payment-iframe-de-620x310.jpg" alt="" width="550" height="275" srcset="https://blog.gaiterjones.com/wp-content/uploads/2016/02/paypalplus-payment-iframe-de-620x310.jpg 620w, https://blog.gaiterjones.com/wp-content/uploads/2016/02/paypalplus-payment-iframe-de-440x220.jpg 440w, https://blog.gaiterjones.com/wp-content/uploads/2016/02/paypalplus-payment-iframe-de-550x275.jpg 550w, https://blog.gaiterjones.com/wp-content/uploads/2016/02/paypalplus-payment-iframe-de.jpg 700w" sizes="(max-width: 550px) 100vw, 550px" /></p>
<p>The default payment wall is white as shown above, at the time of writing there are no options available to change the style. colours etc of the payment wall.</p>
<p>The module quite cleverly detects your existing PayPal payment methods &#8211; express, standard etc. And knows to replace them with PayPal plus. Your other payment methods will appear below the PayPal Plus options nicely styled to match the payment wall. You should leave all your existing PayPal payment options enabled, should there be any problems with PayPal Plus your shop will automatically fall back to your normal payment methods.</p>
<p>You can also integrate your other payment methods directly into the payment wall by enabling them in the  &#8220;allow third party modules&#8221; module settings.</p>
<p>In sandbox mode you can now test out all the payment options. To test Kauf auf Rechnung (Invoice) you need to set the &#8220;Show PuI in Sandbox&#8221; option to Yes in the module development settings options. PuI is Payment Upon Invoice &#8211; a rather literal translation of the German Kauf auf Rechnung.</p>
<h1>Kauf auf Rechnung</h1>
<p>PayPal Plus lets customers order and pay by invoice. The merchant receives the payment directly from Paypal like any other PayPal transaction. The goods can be shipped as soon as the merchant is paid by PayPal and the customer has up to 30 days to pay the invoice, paying the outstanding amount directly to PayPal.</p>
<p>Many online retailers shy away from offering this kind of payment option due to the problems arising from unpaid invoices and chasing debtors for payment but with PayPal taking over this responsibility there is no reason (apart from the PayPal transaction fees) to not offer it.</p>
<p>One problem with this option is making sure that the customer knows to pay the outstanding invoice amount to Paypal and not the Merchant. You will notice when you test payments that the module shows all payment methods on order confirmations as &#8220;PayPal, Lastschrift, Kreditkarte, Kauf auf Rechnung&#8221;.</p>
<p>At the time of writing there is actually no way to distinguish between PayPal Plus Paypal, Kreditkarte or Lastschrift payments. You can however identify invoice Kauf auf Rechnung payments.</p>
<p>If you look at a payment made with Kauf auf Rechnung you will see the order has a ppp_pui_instruction_type object set to &#8220;PAY_UPON_INVOICE&#8221;, this lets you check for invoice payments using something like</p>
<pre class="brush: php; title: ; notranslate">
	if($_order-&gt;getPayment()-&gt;getData('ppp_pui_instruction_type')=='PAY_UPON_INVOICE')
	{
		$_isPUI=true;
	}
</pre>
<p>This is useful because Paypal recommends you make sure the customer is aware that the payment must be made to PayPal. By identifying an invoice payment we can customise the information shown to the customer when they pay using Kauf auf Rechnung.</p>
<p>For example we can customise the new order email to show Kauf auf Rechnung as the payment method, and add the recommended PayPal invoice payment text to the payment information.</p>
<figure id="attachment_1436" aria-describedby="caption-attachment-1436" style="width: 362px" class="wp-caption aligncenter"><img decoding="async" class="size-full wp-image-1436" src="https://blog.gaiterjones.com/wp-content/uploads/2016/02/kauf-auf-rechnung-sales-email.jpg" alt="Kauf auf Rechnung sales email" width="362" height="414" /><figcaption id="caption-attachment-1436" class="wp-caption-text">Kauf auf Rechnung sales email</figcaption></figure>
<p>&nbsp;</p>
<p>Similarly we can add the same information to the checkout success page.</p>
<p>To customise your email templates you need to add a new handler to your layout.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;layout version=&quot;0.1.0&quot;&gt;
	&lt;!-- sales payment info handler --&gt;
	&lt;my_sales_email_payment_info&gt;
		&lt;block type=&quot;core/template&quot; name=&quot;addPaymentInfo&quot; template=&quot;my/sales/email/payment/info.phtml&quot; /&gt;
	&lt;/my_sales_email_payment_info&gt;
&lt;/layout&gt;
</pre>
<p>in your sales/email/payment/info.phtml template add the logic and information you want to display in the sales email.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

$_order = $this-&gt;getOrder();
$_isPUI=false;

	
	if($_order-&gt;getPayment()-&gt;getData('ppp_pui_instruction_type')=='PAY_UPON_INVOICE')
	{
		$_isPUI=true;
	}
	

?&gt;
&lt;?php if($_isPUI):?&gt;
		&lt;p&gt;YOUR CUSTOM TEXT&lt;/p&gt;
&lt;?php endif;?&gt;
</pre>
<p>You can now call this handler from anywhere in your sales email templates using</p>
<pre class="brush: php; title: ; notranslate">
{{layout handle=&quot;my_sales_email_payment_info&quot; order=$order}}
</pre>
<p>to display the information from your template. We can do exactly the same for the checkout success page, you just need to retrieve the order object first.</p>
<pre class="brush: php; title: ; notranslate">
$_order = Mage::getModel('sales/order')-&gt;load(Mage::getSingleton('checkout/session')-&gt;getLastOrderId());
</pre>
<h1>Conclusions</h1>
<p>Considering Paypal used to belong to eBay, and eBay now owns Magento it&#8217;s likely that PayPal plus will become part of the Magento core code at some point in the future. The iWays module is well written and works well &#8211; it will need some customisation to fit into your own specific requirements especially if you have already customised your payment method templates. Time will tell how invoice payments work&#8230;</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.gaiterjones.com/magento-paypal-plus-integration/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
