-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0743d04
commit db8063c
Showing
317 changed files
with
77,457 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
language: generic | ||
|
||
before_deploy: | ||
- if ! [ "$BEFORE_DEPLOY_RUN" ]; then | ||
export BEFORE_DEPLOY_RUN=1; | ||
mkdir build; | ||
mkdir build/src; | ||
rsync -r --exclude 'build' --exclude '.git' --exclude '.travis.yml' --exclude 'README.md' . build/src; | ||
export MODULE_NAME=$(find build/src -maxdepth 1 -type f -name '*.php' -a -not -name '*autoloader.php' -printf "%f" | sed 's/\.[^.]*$//'); | ||
mkdir build/$MODULE_NAME; | ||
rsync -r build/src/ build/$MODULE_NAME/; | ||
cd build; | ||
zip -r $TRAVIS_BUILD_DIR/$MODULE_NAME.zip $MODULE_NAME; | ||
cd ..; | ||
fi | ||
|
||
deploy: | ||
- provider: releases | ||
api_key: $GITHUB_API_KEY | ||
file: "$MODULE_NAME.zip" | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
repo: pfpayments/prestashop-1.7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,24 @@ | ||
# prestashop-1.7 | ||
PostFinance Checkout integration for PrestaShop 1.7 | ||
[![Build Status](https://travis-ci.org/pfpayments/prestashop-1.7.svg?branch=master)](https://travis-ci.org/pfpayments/prestashop-1.7) | ||
|
||
# PrestaShop 1.7 PostFinance Checkout Integration | ||
This repository contains the PrestaShop PostFinance Checkout payment module that enables the shop to process payments with [PostFinance Checkout](https://www.postfinance.ch). | ||
|
||
##### To use this extension, a [PostFinance Checkout](https://www.postfinance.ch) account is required. | ||
|
||
## Requirements | ||
|
||
* [PrestaShop](https://www.prestashop.com/) 1.7.x | ||
* [PHP](http://php.net/) 5.6 or later | ||
* [Mailhook](https://github.com/wallee-payment/prestashop-mailhook/releases) to modify PrestaShop email behavior. | ||
|
||
## Documentation | ||
|
||
* [English](https://plugin-documentation.postfinance-checkout.ch/pfpayments/prestashop-1.7/1.0.7/docs/en/documentation.html) | ||
|
||
## License | ||
|
||
Please see the [license file](https://github.com/pfpayments/prestashop-1.7/blob/1.0.7/LICENSE) for more information. | ||
|
||
## Other PrestaShop Versions | ||
|
||
Find the module for different PrestaShop versions [here](../../../prestashop). |
65 changes: 65 additions & 0 deletions
65
controllers/admin/AdminPostFinanceCheckoutDocumentsController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?php | ||
if (! defined('_PS_VERSION_')) { | ||
exit(); | ||
} | ||
|
||
/** | ||
* PostFinance Checkout Prestashop | ||
* | ||
* This Prestashop module enables to process payments with PostFinance Checkout (https://www.postfinance.ch). | ||
* | ||
* @author customweb GmbH (http://www.customweb.com/) | ||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache Software License (ASL 2.0) | ||
*/ | ||
|
||
class AdminPostFinanceCheckoutDocumentsController extends ModuleAdminController | ||
{ | ||
|
||
public function postProcess() | ||
{ | ||
parent::postProcess(); | ||
// We want to be sure that displaying PDF is the last thing this controller will do | ||
exit(); | ||
} | ||
|
||
public function initProcess() | ||
{ | ||
parent::initProcess(); | ||
$access = Profile::getProfileAccess($this->context->employee->id_profile, | ||
(int) Tab::getIdFromClassName('AdminOrders')); | ||
if ($access['view'] === '1' && ($action = Tools::getValue('action'))) { | ||
$this->action = $action; | ||
} else { | ||
die(Tools::displayError($this->module->l('You do not have permission to view this.'))); | ||
} | ||
} | ||
|
||
public function processPostFinanceCheckoutInvoice() | ||
{ | ||
if (Tools::isSubmit('id_order')) { | ||
try { | ||
$order = new Order(Tools::getValue('id_order')); | ||
PostFinanceCheckout_DownloadHelper::downloadInvoice($order); | ||
} catch (Exception $e) { | ||
die(Tools::displayError($this->module->l('Could not fetch the document.'))); | ||
} | ||
} else { | ||
die(Tools::displayError($this->module->l('The order Id is missing.'))); | ||
} | ||
} | ||
|
||
public function processPostFinanceCheckoutPackingSlip() | ||
{ | ||
if (Tools::isSubmit('id_order')) { | ||
try { | ||
$order = new Order(Tools::getValue('id_order')); | ||
PostFinanceCheckout_DownloadHelper::downloadPackingSlip($order); | ||
} catch (Exception $e) { | ||
die(Tools::displayError($this->module->l('Could not fetch the document.'))); | ||
} | ||
} else { | ||
die(Tools::displayError($this->module->l('The order Id is missing.'))); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.