Skip to content

Commit

Permalink
Applied latest changes to PayPal Checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCartpenter committed Jun 20, 2024
1 parent cb4eec0 commit 8a18c23
Show file tree
Hide file tree
Showing 11 changed files with 338 additions and 342 deletions.
32 changes: 16 additions & 16 deletions upload/admin/controller/extension/payment/paypal.php
Original file line number Diff line number Diff line change
Expand Up @@ -2452,17 +2452,17 @@ public function capturePayment() {
$transaction_status = 'partially_captured';
}

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$paypal_order_data = array();

$paypal_order_data['order_id'] = $order_id;
$paypal_order_data['transaction_id'] = $transaction_id;
$paypal_order_data['transaction_status'] = $transaction_status;

$this->model_extension_payment_paypal->editPayPalOrder($paypal_order_data);

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$data['success'] = $this->language->get('success_capture_payment');
}
Expand Down Expand Up @@ -2569,17 +2569,17 @@ public function reauthorizePayment() {
$transaction_id = $result['id'];
$transaction_status = 'created';

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$paypal_order_data = array(
'order_id' => $order_id,
'transaction_id' => $transaction_id,
'transaction_status' => $transaction_status
);

$this->model_extension_payment_paypal->editPayPalOrder($paypal_order_data);

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$data['success'] = $this->language->get('success_reauthorize_payment');
}
Expand Down Expand Up @@ -2674,16 +2674,16 @@ public function voidPayment() {
$order_status_id = $setting['order_status']['voided']['id'];
$transaction_status = 'voided';

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$paypal_order_data = array(
'order_id' => $order_id,
'transaction_status' => $transaction_status
);

$this->model_extension_payment_paypal->editPayPalOrder($paypal_order_data);

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$data['success'] = $this->language->get('success_void_payment');
}
Expand Down Expand Up @@ -2932,16 +2932,16 @@ public function refundPayment() {
$transaction_status = 'partially_refunded';
}

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$paypal_order_data = array();

$paypal_order_data['order_id'] = $order_id;
$paypal_order_data['transaction_status'] = $transaction_status;

$this->model_extension_payment_paypal->editPayPalOrder($paypal_order_data);

if ($order_status_id) {
$this->model_extension_paypal_payment_paypal->addOrderHistory($setting['general']['order_history_token'], $order_id, $order_status_id, $comment, $notify);
}

$data['success'] = $this->language->get('success_refund_payment');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
<div class="section-content">
<ul class="nav nav-pills">
{% for applepay_button in setting['applepay_button'] %}
<li class="nav-pill {% if loop.first %}active{% endif %}"><a href="#pill_{{ applepay_button['page_code'] }}" class="pill" data-toggle="tab">{{ attribute(_context, applepay_button['page_name']) }}</a></li>
<li class="nav-pill {% if loop.first %} active {% endif %}"><a href="#pill_{{ applepay_button['page_code'] }}" class="pill" data-toggle="tab">{{ attribute(_context, applepay_button['page_name']) }}</a></li>
{% endfor %}
</ul>
<hr class="hr" />
<div class="tab-content">
{% for applepay_button in setting['applepay_button'] %}
<div id="pill_{{ applepay_button['page_code'] }}" class="tab-pane {% if loop.first %}active{% endif %}">
<div id="pill_{{ applepay_button['page_code'] }}" class="tab-pane {% if loop.first %} active {% endif %}">
<div class="row">
<div class="col col-lg-6">
{% if (applepay_button['page_code'] == 'checkout') %}
Expand Down Expand Up @@ -161,7 +161,7 @@
<div class="form-group-status">
<label class="control-label" for="input_applepay_button_{{ applepay_button['page_code'] }}_status"><span data-toggle="tooltip" title="{{ help_applepay_button_status }}">{{ entry_status }}</span></label>
<input type="hidden" name="payment_paypal_setting[applepay_button][{{ applepay_button['page_code'] }}][status]" value="0" />
<input type="checkbox" name="payment_paypal_setting[applepay_button][{{ applepay_button['page_code'] }}][status]" value="1" class="switch" {% if applepay_button['status'] %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_setting[applepay_button][{{ applepay_button['page_code'] }}][status]" value="1" class="switch" {% if applepay_button['status'] %} checked="checked" {% endif %} />
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions upload/admin/view/template/extension/payment/paypal/auth.twig
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
</div>
</div>
</div>
<div class="automatic-authorization {% if (authorization_type == 'manual') %}hidden{% endif %}">
<div class="automatic-authorization {% if (authorization_type == 'manual') %} hidden {% endif %}">
<a href="{{ configure_url[environment]['ppcp'] }}" target="_blank" class="btn btn-primary button-connect-ppcp" data-paypal-button="PPLtBlue" data-paypal-onboard-complete="onBoardedCallback">{{ button_connect }}</a>
<div class="checkout-express">{{ text_checkout_express }}</div>
</div>
<div class="manual-authorization {% if (authorization_type == 'automatic') %}hidden{% endif %}">
<div class="manual-authorization {% if (authorization_type == 'automatic') %} hidden {% endif %}">
<div class="form-group text-left">
<label class="control-label" for="input_merchant_id">{{ entry_merchant_id }}</label>
<input type="text" name="payment_paypal_merchant_id" value="" id="input_merchant_id" class="form-control" />
Expand Down
12 changes: 6 additions & 6 deletions upload/admin/view/template/extension/payment/paypal/button.twig
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
<div class="section-content">
<ul class="nav nav-pills">
{% for button in setting['button'] %}
<li class="nav-pill {% if loop.first %}active{% endif %}"><a href="#pill_{{ button['page_code'] }}" class="pill" data-toggle="tab">{{ attribute(_context, button['page_name']) }}</a></li>
<li class="nav-pill {% if loop.first %} active {% endif %}"><a href="#pill_{{ button['page_code'] }}" class="pill" data-toggle="tab">{{ attribute(_context, button['page_name']) }}</a></li>
{% endfor %}
</ul>
<hr class="hr" />
<div class="tab-content">
{% for button in setting['button'] %}
<div id="pill_{{ button['page_code'] }}" class="tab-pane {% if loop.first %}active{% endif %}">
<div id="pill_{{ button['page_code'] }}" class="tab-pane {% if loop.first %} active {% endif %}">
<div class="row">
<div class="col col-lg-6">
{% if (button['page_code'] == 'checkout') %}
Expand Down Expand Up @@ -161,7 +161,7 @@
<div class="form-group-status">
<label class="control-label" for="input_button_{{ button['page_code'] }}_status"><span data-toggle="tooltip" title="{{ help_button_status }}">{{ entry_status }}</span></label>
<input type="hidden" name="payment_paypal_setting[button][{{ button['page_code'] }}][status]" value="0" />
<input type="checkbox" name="payment_paypal_setting[button][{{ button['page_code'] }}][status]" value="1" class="switch" {% if button['status'] %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_setting[button][{{ button['page_code'] }}][status]" value="1" class="switch" {% if button['status'] %} checked="checked" {% endif %} />
</div>
</div>
</div>
Expand Down Expand Up @@ -265,9 +265,9 @@
<div class="form-group">
<label class="control-label" for="input_button_{{ button['page_code'] }}_funding_{{ button_funding['code'] }}">{{ attribute(_context, button_funding['name']) }}</label>
<select name="payment_paypal_setting[button][{{ button['page_code'] }}][funding][{{ button_funding['code'] }}]" id="input_button_{{ button['page_code'] }}_funding_{{ button_funding['code'] }}" class="form-control control-paypal-button" funding_code="{{ button_funding['code'] }}">
<option value="0" {% if (button['funding'][button_funding['code']] == 0) %}selected="selected"{% endif %}>{{ text_auto }}</option>
<option value="1" {% if (button['funding'][button_funding['code']] == 1) %}selected="selected"{% endif %}>{{ text_enabled }}</option>
<option value="2" {% if (button['funding'][button_funding['code']] == 2) %}selected="selected"{% endif %}>{{ text_disabled }}</option>
<option value="0" {% if (button['funding'][button_funding['code']] == 0) %} selected="selected" {% endif %}>{{ text_auto }}</option>
<option value="1" {% if (button['funding'][button_funding['code']] == 1) %} selected="selected" {% endif %}>{{ text_enabled }}</option>
<option value="2" {% if (button['funding'][button_funding['code']] == 2) %} selected="selected" {% endif %}>{{ text_disabled }}</option>
</select>
</div>
{% endfor %}
Expand Down
6 changes: 3 additions & 3 deletions upload/admin/view/template/extension/payment/paypal/card.twig
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div class="form-group-status">
<label class="control-label" for="input_card_status"><span data-toggle="tooltip" title="{{ help_card_status }}">{{ entry_status }}</span></label>
<input type="hidden" name="payment_paypal_setting[card][status]" value="0" />
<input type="checkbox" name="payment_paypal_setting[card][status]" value="1" class="switch" {% if setting['card']['status'] %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_setting[card][status]" value="1" class="switch" {% if setting['card']['status'] %} checked="checked" {% endif %} />
</div>
</div>
</div>
Expand Down Expand Up @@ -150,8 +150,8 @@
<div class="form-group">
<label class="control-label" for="input_card_secure_scenario_{{ card_secure_scenario['code'] }}">{{ attribute(_context, card_secure_scenario['name']) }}</label>
<select name="payment_paypal_setting[card][secure_scenario][{{ card_secure_scenario['code'] }}]" id="input_card_secure_scenario_{{ card_secure_scenario['code'] }}" class="form-control">
<option value="1" {% if setting['card']['secure_scenario'][card_secure_scenario['code']] %}selected="selected"{% endif %}>{{ text_accept }}{% if card_secure_scenario['recommended'] %} {{ text_recommended }}{% endif %}</option>
<option value="0" {% if not setting['card']['secure_scenario'][card_secure_scenario['code']] %}selected="selected"{% endif %}>{{ text_decline }}{% if not card_secure_scenario['recommended'] %} {{ text_recommended }}{% endif %}</option>
<option value="1" {% if setting['card']['secure_scenario'][card_secure_scenario['code']] %} selected="selected" {% endif %}>{{ text_accept }}{% if card_secure_scenario['recommended'] %} {{ text_recommended }}{% endif %}</option>
<option value="0" {% if not setting['card']['secure_scenario'][card_secure_scenario['code']] %} selected="selected" {% endif %}>{{ text_decline }}{% if not card_secure_scenario['recommended'] %} {{ text_recommended }}{% endif %}</option>
</select>
</div>
{% endfor %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<div class="form-group">
<div id="input_contact_merchant">
<input type="hidden" name="payment_paypal_setting[contact][00N2E00000II4xP]" value="0" />
<input type="checkbox" name="payment_paypal_setting[contact][00N2E00000II4xP]" value="1" class="form-check-input" {% if setting['contact']['00N2E00000II4xP'] %}checked="checked"{% endif %} /><label class="control-label">{{ entry_contact_merchant }}</label>
<input type="checkbox" name="payment_paypal_setting[contact][00N2E00000II4xP]" value="1" class="form-check-input" {% if setting['contact']['00N2E00000II4xP'] %} checked="checked" {% endif %} /><label class="control-label">{{ entry_contact_merchant }}</label>
</div>
</div>
<div class="form-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<div class="form-group-status">
<label class="control-label" for="input_status">{{ entry_status }}</label>
<input type="hidden" name="payment_paypal_status" value="0" />
<input type="checkbox" name="payment_paypal_status" value="1" class="switch" {% if status %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_status" value="1" class="switch" {% if status %} checked="checked" {% endif %} />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,14 @@
<label class="control-label" for="input_status">{{ entry_status }}</label>
<div id="input_status">
<input type="hidden" name="payment_paypal_status" value="0" />
<input type="checkbox" name="payment_paypal_status" value="1" class="switch" {% if status %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_status" value="1" class="switch" {% if status %} checked="checked" {% endif %} />
</div>
</div>
<div class="form-group">
<label class="control-label" for="input_vault_status"><span data-toggle="tooltip" title="{{ help_vault_status }}">{{ entry_vault_status }}</span></label>
<div id="input_vault_status">
<input type="hidden" name="payment_paypal_setting[general][vault_status]" value="0" />
<input type="checkbox" name="payment_paypal_setting[general][vault_status]" value="1" class="switch" {% if setting['general']['vault_status'] %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_setting[general][vault_status]" value="1" class="switch" {% if setting['general']['vault_status'] %} checked="checked" {% endif %} />
</div>
</div>
</div>
Expand All @@ -70,7 +70,7 @@
<label class="control-label" for="input_general_debug">{{ entry_debug }}</label>
<div id="input_general_debug">
<input type="hidden" name="payment_paypal_setting[general][debug]" value="0" />
<input type="checkbox" name="payment_paypal_setting[general][debug]" value="1" class="switch" {% if setting['general']['debug'] %}checked="checked"{% endif %} />
<input type="checkbox" name="payment_paypal_setting[general][debug]" value="1" class="switch" {% if setting['general']['debug'] %} checked="checked" {% endif %} />
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
<div class="section-content">
<ul class="nav nav-pills">
{% for googlepay_button in setting['googlepay_button'] %}
<li class="nav-pill {% if loop.first %}active{% endif %}"><a href="#pill_{{ googlepay_button['page_code'] }}" class="pill" data-toggle="tab">{{ attribute(_context, googlepay_button['page_name']) }}</a></li>
<li class="nav-pill"><a href="#pill_{{ googlepay_button['page_code'] }}" class="pill {% if loop.first %} active {% endif %}" data-bs-toggle="tab">{{ attribute(_context, googlepay_button['page_name']) }}</a></li>
{% endfor %}
</ul>
<hr class="hr" />
<div class="tab-content">
{% for googlepay_button in setting['googlepay_button'] %}
<div id="pill_{{ googlepay_button['page_code'] }}" class="tab-pane {% if loop.first %}active{% endif %}">
<div id="pill_{{ googlepay_button['page_code'] }}" class="tab-pane {% if loop.first %} active {% endif %}">
<div class="row">
<div class="col col-lg-6">
{% if (googlepay_button['page_code'] == 'checkout') %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,15 +43,15 @@
<ul class="nav nav-pills">
{% for message in setting['message'] %}
{% if (message['page_code'] != 'checkout') %}
<li class="nav-pill {% if (message['page_code'] == 'cart') %}active{% endif %}"><a href="#pill_{{ message['page_code'] }}" class="pill" data-toggle="tab">{{ attribute(_context, message['page_name']) }}</a></li>
<li class="nav-pill"><a href="#pill_{{ message['page_code'] }}" class="pill {% if (message['page_code'] == 'cart') %} active {% endif %}" data-bs-toggle="tab">{{ attribute(_context, message['page_name']) }}</a></li>
{% endif %}
{% endfor %}
</ul>
<hr class="hr" />
<div class="tab-content">
{% for message in setting['message'] %}
{% if (message['page_code'] != 'checkout') %}
<div id="pill_{{ message['page_code'] }}" class="tab-pane {% if (message['page_code'] == 'cart') %}active{% endif %}">
<div id="pill_{{ message['page_code'] }}" class="tab-pane {% if (message['page_code'] == 'cart') %} active {% endif %}">
<div class="section-message-setting">
<div class="row">
<div class="col col-md-6">
Expand Down
Loading

0 comments on commit 8a18c23

Please sign in to comment.