Skip to content

Commit

Permalink
0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Aug 23, 2017
1 parent 0760a23 commit 6d28d46
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 6 deletions.
41 changes: 38 additions & 3 deletions Charge.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,41 @@ protected function k_Signature() {return 'SHASIGN';}
*/
protected function pCharge() {
$ba = $this->addressB(); /** @var OA $oa */
$s = $this->s(); /** @var Settings $s */
return [
/**
* 2017-08-22
* «Integrate with PostFinance e-Commerce» → «7. Transaction feedback» →
* «7.2. Redirection depending on transaction result»:
*
* «There are four URLs which our system can redirect the customer to after a transaction,
* depending on the result.
* These are "ACCEPTURL", "EXCEPTIONURL", "CANCELURL" and "DECLINEURL".
* The URLs can be configured or submitted as follows:
* <...>
* Submission of the URLs in the hidden fields of the order form:
* <input type="hidden" name="ACCEPTURL" value="">
* <input type="hidden" name="DECLINEURL" value="">
* <input type="hidden" name="EXCEPTIONURL" value="">
* <input type="hidden" name="CANCELURL" value="">
*
* `ACCEPTURL`
* URL of the web page to display to the customer when the payment has been authorised (status 5),
* stored (status 4), accepted (status 9) or is waiting to be accepted (pending status 41, 51 or 91).
*
* `CANCELURL`
* URL of the web page to display to the customer when he cancels the payment (status 1).
* If this field is empty, the customer will be redirected to the DECLINEURL instead.
*
* `DECLINEURL`
* URL of the web page to show the customer when the acquirer declines the authorisation (status 2 or 93)
* more than the maximum permissible number of times.
*
* `EXCEPTIONURL`
* URL of the web page to display to the customer when the payment result is uncertain (status 52 or 92).
* If this field is empty, the customer will be redirected to the ACCEPTURL instead.»
* https://e-payment-postfinance.v-psp.com/en/en/guides/integration%20guides/e-commerce/transaction-feedback#basicredirection
*/
'ACCEPTURL' => $this->customerReturnRemote()
/**
* 2017-08-19
* *) Integrate with PostFinance e-Commerce:
Expand All @@ -135,7 +168,7 @@ protected function pCharge() {
* https://mage2.pro/t/4351
* https://mage2.pro/t/4352
*/
'CN' => $this->customerName()
,'CN' => $this->customerName()
/**
* 2017-08-19
* *) Integrate with PostFinance e-Commerce: «Customer street name and number». Optional.
Expand Down Expand Up @@ -257,6 +290,8 @@ protected function pCharge() {
* If this field is empty, the customer will be redirected to the ACCEPTURL instead.»
* https://e-payment-postfinance.v-psp.com/en/en/guides/integration%20guides/e-commerce/transaction-feedback#basicredirection
*/
] + array_fill_keys(['ACCEPTURL', 'CANCELURL', 'DECLINEURL', 'EXCEPTIONURL'], $this->customerReturnRemote());
] + array_fill_keys(['CANCELURL', 'DECLINEURL', 'EXCEPTIONURL'],
$this->customerReturnRemoteWithFailure()
);
}
}
15 changes: 15 additions & 0 deletions Controller/CustomerReturn/Index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
namespace Dfe\PostFinance\Controller\CustomerReturn;
use Df\Payment\Operation;
// 2017-08-23
/** @final Unable to use the PHP «final» keyword here because of the M2 code generation. */
class Index extends \Df\Payment\CustomerReturn {
/**
* 2017-08-23
* @override
* @see \Df\Payment\CustomerReturn::isSuccess()
* @used-by \Df\Payment\CustomerReturn::execute()
* @return string
*/
final protected function isSuccess() {return !df_request(Operation::FAILURE);}
}
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mage2pro/postfinance"
,"version": "0.1.3"
,"version": "0.1.4"
,"description": "The «PostFinance» payment extension for Magento 2."
,"type": "magento2-module"
,"homepage": "https://mage2.pro/c/extensions/postfinance"
Expand All @@ -11,7 +11,7 @@
"homepage": "https://mage2.pro/users/dmitry_fedyuk",
"role": "Developer"
}]
,"require": {"mage2pro/core": ">=2.10.37"}
,"require": {"mage2pro/core": ">=2.10.38"}
,"autoload": {"files": ["registration.php"], "psr-4": {"Dfe\\PostFinance\\": ""}}
,"keywords": [
"API"
Expand Down
1 change: 0 additions & 1 deletion etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xsi:noNamespaceSchemaLocation='urn:magento:framework:ObjectManager/etc/config.xsd'
>
<virtualType name='Dfe\PostFinance\Controller\CustomerReturn\Index' type='Df\Payment\CustomerReturn'/>
<virtualType name='Dfe\PostFinance\Controller\Index\Index' type='Df\Payment\W\Action'/>
</config>

0 comments on commit 6d28d46

Please sign in to comment.