Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

Add a new Gateways class to handle the locale code of Paypal checkout #6

Merged
merged 1 commit into from
Jun 24, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
51 changes: 51 additions & 0 deletions src/Hyyan/WPI/Gateways.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

/**
* This file is part of the hyyan/woo-poly-integration plugin.
* (c) Hyyan Abo Fakher <tiribthea4hyyan@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Hyyan\WPI;

/**
* Gateways
*
* Handle Payment Gateways
*
* @author Nicolas Joannès <nic@cobea.be>
*/
class Gateways
{


/**
* Construct object
*/
public function __construct()
{
add_filter('woocommerce_paypal_args', array($this, 'setPaypalLocalCode'));

}


/**
* Set the PayPal checkout locale code
*
* @param array $args the current paypal request args array
*
* @return void
*/
public function setPaypalLocalCode($args)
{
$lang = pll_current_language('locale');
$args['locale.x'] = $lang;

return $args;

}


}
1 change: 1 addition & 0 deletions src/Hyyan/WPI/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ protected function registerCore()
new Reports();
new Widgets\SearchWidget();
new Widgets\LayeredNav();
new Gateways();
}

}