Skip to content

Commit

Permalink
Merge pull request #65 from 202-ecommerce/develop
Browse files Browse the repository at this point in the history
5.2.0 > master
  • Loading branch information
clotairer authored Oct 9, 2020
2 parents 9bb9ee9 + e5c3c64 commit fbdad0e
Show file tree
Hide file tree
Showing 8 changed files with 188 additions and 118 deletions.
2 changes: 1 addition & 1 deletion 202/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<property name="src-dir" value="${basedir}" />
<property name="TARGETNAME" value="paypal" />
<property name="TARGETBRANCH" value="${env.GIT_BRANCH}" />
<property name="TARGETVERSION" value="5.2.0" />
<property name="TARGETVERSION" value="5.2.1" />
<property name="PHPVERSION" value="5.6" />
<property name="PSVERSION" value="1.7.5.x" />

Expand Down
2 changes: 1 addition & 1 deletion classes/API/Request/PaypalOrderCreateRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ protected function getAddress()

if ($address->id_state) {
$state = new \State($address->id_state);
$addressArray['address_line_1'] = $state->iso_code;
$addressArray['admin_area_1'] = $state->iso_code;
}

return $addressArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public function initForm()
'hint' => $this->l('A label that overrides the business name in the PayPal account on the PayPal pages. If logo is set, then brand name won\'t be shown.', get_class($this)),
);

if ($this->method == 'MB') {
if (in_array($isoCountryDefault, $this->module->countriesApiCartUnavailable) == false || $this->method == 'MB') {
$this->fields_form['form']['form']['input'][] = array(
'type' => 'switch',
'label' => $this->l('Accept credit and debit card payment'),
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminPayPalHelpController.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function initContent()
$tpl_vars = array(
'need_rounding' => $need_rounding,
'psCheckoutBtnText' => $this->getCheckoutBtnText(),
'showPsCheckout' => in_array($countryDefault->iso_code, $this->module->psCheckoutCountry)
'showPsCheckout' => in_array($countryDefault->iso_code, $this->module->countriesApiCartUnavailable)
);

$this->context->smarty->assign($tpl_vars);
Expand Down
6 changes: 4 additions & 2 deletions controllers/front/pppPatch.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ class PaypalPppPatchModuleFrontController extends PaypalAbstarctModuleFrontContr
public function postProcess()
{
$method_ppp = AbstractMethodPaypal::load('PPP');
$method_ppp->setPaymentId(Tools::getValue('idPayment'));
$idPayment = Tools::getValue('idPayment') ? Tools::getValue('idPayment') : Context::getContext()->cookie->paypal_plus_payment;
$method_ppp->setPaymentId($idPayment);

if (Context::getContext()->cookie->paypal_plus_payment) {
if ($idPayment) {
try {
$resultPath = $method_ppp->doOrderPatch();

if ($resultPath->isSuccess()) {
$this->jsonValues = array('success' => $resultPath->isSuccess());
Context::getContext()->cookie->__unset('paypal_plus_payment');
} else {
$this->errors['error_msg'] = $resultPath->getError()->getMessage();
$this->jsonValues = array('success' => false, 'redirect_link' => Context::getContext()->link->getModuleLink($this->name, 'error', $this->errors));
Expand Down
Loading

0 comments on commit fbdad0e

Please sign in to comment.