Skip to content

Commit

Permalink
Update PayPal
Browse files Browse the repository at this point in the history
Update to PayPal V3.0.2, has added bugfixes for Pay Later
  • Loading branch information
mhcwebdesign committed Mar 23, 2024
1 parent 27d54a1 commit 2e12a82
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions upload/admin/language/en-gb/extension/payment/paypal.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
// Heading
$_['heading_title'] = '<span style="color:#1e91cf; font-weight:bold">PayPal Checkout Integration V3.0.1 (Highly Recommended)</span>';
$_['heading_title'] = '<span style="color:#1e91cf; font-weight:bold">PayPal Checkout Integration V3.0.2 (Highly Recommended)</span>';
$_['heading_title_main'] = 'PayPal Checkout Integration';

// Text
Expand Down Expand Up @@ -327,4 +327,4 @@
$_['error_permission'] = 'Warning: You do not have permission to modify payment PayPal!';
$_['error_connect'] = 'Warning: Client ID or Secret is incorrect!';
$_['error_timeout'] = 'Sorry, PayPal is currently busy. Please try again later!';
$_['error_agree'] = 'We discovered that a few countries under sanctions are featured on your website. Please click the button to deactivate them (Cuba, Iran, Syria, North Korea, Crimea, Donetsk, and Lugansk regions of Ukraine).<br /><br /><button type="button" class="button-agree btn btn-danger">Comply with PayPal regulations</button>';
$_['error_agree'] = 'We discovered that a few countries under sanctions are featured on your website. Please click the button to deactivate them (Cuba, Iran, Syria, North Korea, Crimea, Donetsk, and Lugansk regions of Ukraine).<br /><br /><button type="button" class="button-agree btn btn-danger">Comply with PayPal regulations</button>';
5 changes: 4 additions & 1 deletion upload/catalog/controller/extension/payment/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ public function getData() {
$data['secret'] = $this->config->get('payment_paypal_secret');
$data['merchant_id'] = $this->config->get('payment_paypal_merchant_id');
$data['environment'] = $this->config->get('payment_paypal_environment');
$data['googlepay_environment'] = (($data['environment'] == 'production') ? 'PRODUCTION' : 'TEST');
$data['partner_id'] = $setting['partner'][$data['environment']]['partner_id'];
$data['partner_attribution_id'] = $setting['partner'][$data['environment']]['partner_attribution_id'];
$data['vault_status'] = $setting['general']['vault_status'];
Expand Down Expand Up @@ -3965,7 +3966,9 @@ public function extension_get_extensions_after($route, $data, &$output) {

$setting = array_replace_recursive((array)$config_setting, (array)$this->config->get('payment_paypal_setting'));

if (!empty($setting['paylater_country'][$setting['general']['country_code']]) && ($setting['button']['checkout']['funding']['paylater'] != 2)) {
$currency_code = $this->session->data['currency'];

if (!empty($setting['paylater_country'][$setting['general']['country_code']]) && ($currency_code == $setting['general']['currency_code']) && ($setting['button']['checkout']['funding']['paylater'] != 2)) {
$this->config->set('payment_paypal_paylater_status', 1);

$output[] = array(
Expand Down
1 change: 1 addition & 0 deletions upload/catalog/view/javascript/paypal/paypal.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@ var PayPalAPI = (function () {
const {allowedPaymentMethods, merchantInfo, apiVersion, apiVersionMinor, countryCode} = await PayPalSDK.Googlepay().config();

const paymentsClient = new google.payments.api.PaymentsClient({
environment: paypal_data['googlepay_environment'],
paymentDataCallbacks: {
onPaymentAuthorized: function(paymentData) {
return new Promise(async function(resolve, reject) {
Expand Down
2 changes: 1 addition & 1 deletion upload/system/config/paypal.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
$_['paypal_setting'] = array(
'version' => '3.0.1',
'version' => '3.0.2',
'partner' => array(
'production' => array(
'partner_id' => 'TY2Q25KP2PX9L',
Expand Down

0 comments on commit 2e12a82

Please sign in to comment.