Skip to content

Commit

Permalink
Merge pull request #9 from wallee-payment/ss-order
Browse files Browse the repository at this point in the history
Pending Orders
  • Loading branch information
schurter-cw authored Mar 21, 2019
2 parents da5a37e + 82c7098 commit b9e0eaa
Show file tree
Hide file tree
Showing 27 changed files with 1,334 additions and 118 deletions.
16 changes: 16 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,22 @@
"options": {
"defaultValue": "11.3"
}
},
"confirmation_invoice": {
"type": "checkBox",
"required": false,
"label": "Config.confirmationInvoiceLabel",
"options": {
"defaultValue": true
}
},
"confirmation_packing_slip": {
"type": "checkBox",
"required": false,
"label": "Config.confirmationPackingSlipLabel",
"options": {
"defaultValue": true
}
}
}
},
Expand Down
9 changes: 9 additions & 0 deletions meta/documents/changelog_de.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release Notes for wallee

## v2.0.0 (2019-03-21)

### Added
- Allow customers to change payment method if a payment fails.
- Allow customers to download invoice document and packing slip from order confirmation page.

### Fixed
- Create order before redirecting customer to payment page.

## v1.0.23 (2019-03-01)

### Fixed
Expand Down
9 changes: 9 additions & 0 deletions meta/documents/changelog_en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Release Notes for wallee

## v2.0.0 (2019-03-21)

### Added
- Allow customers to change payment method if a payment fails.
- Allow customers to download invoice document and packing slip from order confirmation page.

### Fixed
- Create order before redirecting customer to payment page.

## v1.0.23 (2019-03-01)

### Fixed
Expand Down
12 changes: 10 additions & 2 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
},
"namespace": "Wallee",
"type": "payment",
"version": "1.0.23",
"version": "2.0.0",
"license": " Apache License Version 2",
"isClosedSource" : false,
"pluginIcon" : "icon_plugin_md.png",
Expand All @@ -33,10 +33,18 @@
"containers": [],
"require": ["IO"],
"dependencies":{
"wallee/sdk":"1.1.1"
"wallee/sdk":"1.1.14"
},
"runOnBuild": [
"Wallee\\Migrations\\CreatePaymentMethods",
"Wallee\\Migrations\\CreateWebhookTable"
],
"dataProviders": [
{
"key": "Wallee\\Providers\\DataProvider\\PaymentInformation",
"name": "wallee Payment Information",
"description": "Display information about the wallee payment on the checkout page.",
"defaultLayoutContainer": "Ceres::OrderConfirmation.AdditionalPaymentInformation"
}
]
}
62 changes: 32 additions & 30 deletions resources/lang/de/Config.properties
Original file line number Diff line number Diff line change
@@ -1,137 +1,139 @@
GrundeinstellungenTab=Grundeinstellungen
apiUserIdLabel=API Benutzer ID
apiUserKeyLabel=API Benutzer Schlüssel
apiUserKeyLabel=API Benutzer Schlüssel
spaceIdLabel=Space Id
resourceVersionLabel=Resource Version
refundSuccessfulStatusLabel=Status ID für erfolgreiche Gutschrift
refundFailedStatusLabel=Status ID für fehlgeschlagene Gutschrift
refundSuccessfulStatusLabel=Status ID für erfolgreiche Gutschrift
refundFailedStatusLabel=Status ID für fehlgeschlagene Gutschrift
confirmationInvoiceLabel=Kunden erlauben, Rechnungsdokument herunterzuladen
confirmationPackingSlipLabel=Kunden erlauben, Lieferschein herunterzuladen
AlipayTab=Alipay
alipayActiveLabel=Aktiv
alipayTitleLabel=Titel
alipayDescriptionLabel=Beschreibung
alipayFeeLabel=Gebühr
BankBerweisungTab=Bank Überweisung
alipayFeeLabel=Gebühr
BankBerweisungTab=Bank Überweisung
banktransferActiveLabel=Aktiv
banktransferTitleLabel=Titel
banktransferDescriptionLabel=Beschreibung
banktransferFeeLabel=Gebühr
banktransferFeeLabel=Gebühr
CASHUTab=CASHU
cashuActiveLabel=Aktiv
cashuTitleLabel=Titel
cashuDescriptionLabel=Beschreibung
cashuFeeLabel=Gebühr
cashuFeeLabel=Gebühr
KreditDebitkarteTab=Kredit- / Debitkarte
creditcardActiveLabel=Aktiv
creditcardTitleLabel=Titel
creditcardDescriptionLabel=Beschreibung
creditcardFeeLabel=Gebühr
creditcardFeeLabel=Gebühr
DaoPayTab=DaoPay
daopayActiveLabel=Aktiv
daopayTitleLabel=Titel
daopayDescriptionLabel=Beschreibung
daopayFeeLabel=Gebühr
daopayFeeLabel=Gebühr
LastschriftSEPATab=Lastschrift (SEPA)
directdebitsepaActiveLabel=Aktiv
directdebitsepaTitleLabel=Titel
directdebitsepaDescriptionLabel=Beschreibung
directdebitsepaFeeLabel=Gebühr
directdebitsepaFeeLabel=Gebühr
LastschriftUKTab=Lastschrift (UK)
directdebitukActiveLabel=Aktiv
directdebitukTitleLabel=Titel
directdebitukDescriptionLabel=Beschreibung
directdebitukFeeLabel=Gebühr
directdebitukFeeLabel=Gebühr
EPSTab=EPS
epsActiveLabel=Aktiv
epsTitleLabel=Titel
epsDescriptionLabel=Beschreibung
epsFeeLabel=Gebühr
epsFeeLabel=Gebühr
GiropayTab=Giropay
giropayActiveLabel=Aktiv
giropayTitleLabel=Titel
giropayDescriptionLabel=Beschreibung
giropayFeeLabel=Gebühr
giropayFeeLabel=Gebühr
iDealTab=iDeal
idealActiveLabel=Aktiv
idealTitleLabel=Titel
idealDescriptionLabel=Beschreibung
idealFeeLabel=Gebühr
idealFeeLabel=Gebühr
RechnungTab=Rechnung
invoiceActiveLabel=Aktiv
invoiceTitleLabel=Titel
invoiceDescriptionLabel=Beschreibung
invoiceFeeLabel=Gebühr
invoiceFeeLabel=Gebühr
MasterPassTab=MasterPass
masterpassActiveLabel=Aktiv
masterpassTitleLabel=Titel
masterpassDescriptionLabel=Beschreibung
masterpassFeeLabel=Gebühr
masterpassFeeLabel=Gebühr
OnlineBankingTab=Online Banking
onlinebankingActiveLabel=Aktiv
onlinebankingTitleLabel=Titel
onlinebankingDescriptionLabel=Beschreibung
onlinebankingFeeLabel=Gebühr
onlinebankingFeeLabel=Gebühr
payboxTab=paybox
payboxActiveLabel=Aktiv
payboxTitleLabel=Titel
payboxDescriptionLabel=Beschreibung
payboxFeeLabel=Gebühr
payboxFeeLabel=Gebühr
PaydirektTab=Paydirekt
paydirektActiveLabel=Aktiv
paydirektTitleLabel=Titel
paydirektDescriptionLabel=Beschreibung
paydirektFeeLabel=Gebühr
paydirektFeeLabel=Gebühr
PaylibTab=Paylib
paylibActiveLabel=Aktiv
paylibTitleLabel=Titel
paylibDescriptionLabel=Beschreibung
paylibFeeLabel=Gebühr
paylibFeeLabel=Gebühr
PayPalTab=PayPal
paypalActiveLabel=Aktiv
paypalTitleLabel=Titel
paypalDescriptionLabel=Beschreibung
paypalFeeLabel=Gebühr
paypalFeeLabel=Gebühr
paysafecardTab=paysafecard
paysafecardActiveLabel=Aktiv
paysafecardTitleLabel=Titel
paysafecardDescriptionLabel=Beschreibung
paysafecardFeeLabel=Gebühr
paysafecardFeeLabel=Gebühr
POLiTab=POLi
poliActiveLabel=Aktiv
poliTitleLabel=Titel
poliDescriptionLabel=Beschreibung
poliFeeLabel=Gebühr
poliFeeLabel=Gebühr
Przelewy24Tab=Przelewy24
przelewy24ActiveLabel=Aktiv
przelewy24TitleLabel=Titel
przelewy24DescriptionLabel=Beschreibung
przelewy24FeeLabel=Gebühr
przelewy24FeeLabel=Gebühr
QIWITab=QIWI
qiwiActiveLabel=Aktiv
qiwiTitleLabel=Titel
qiwiDescriptionLabel=Beschreibung
qiwiFeeLabel=Gebühr
qiwiFeeLabel=Gebühr
SkrillTab=Skrill
skrillActiveLabel=Aktiv
skrillTitleLabel=Titel
skrillDescriptionLabel=Beschreibung
skrillFeeLabel=Gebühr
skrillFeeLabel=Gebühr
SOFORTBankingTab=SOFORT Banking
sofortbankingActiveLabel=Aktiv
sofortbankingTitleLabel=Titel
sofortbankingDescriptionLabel=Beschreibung
sofortbankingFeeLabel=Gebühr
sofortbankingFeeLabel=Gebühr
TenpayTab=Tenpay
tenpayActiveLabel=Aktiv
tenpayTitleLabel=Titel
tenpayDescriptionLabel=Beschreibung
tenpayFeeLabel=Gebühr
tenpayFeeLabel=Gebühr
TrustlyTab=Trustly
trustlyActiveLabel=Aktiv
trustlyTitleLabel=Titel
trustlyDescriptionLabel=Beschreibung
trustlyFeeLabel=Gebühr
trustlyFeeLabel=Gebühr
TWINTTab=TWINT
twintActiveLabel=Aktiv
twintTitleLabel=Titel
twintDescriptionLabel=Beschreibung
twintFeeLabel=Gebühr
twintFeeLabel=Gebühr
7 changes: 7 additions & 0 deletions resources/lang/de/Template.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
paymentFailureTitle = "Zahlung abgebrochen"
paymentFailureDescription = "Die Bestellung wurde übermittelt, aber die Zahlung ist abgebrochen worden. Bitte versuchen Sie es erneut."
paymentFailureSubmit = "Zahlen"

paymentInformationLabel = "Ihre Zahlung wurde erhalten. Der Bestellstatus wird in Kürze aktualisiert."
paymentInformationDownloadInvoice = "Rechnung herunterladen"
paymentInformationDownloadPackingSlip = "Lieferschein herunterladen"
2 changes: 2 additions & 0 deletions resources/lang/en/Config.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ spaceIdLabel=Space Id
resourceVersionLabel=Resource Version
refundSuccessfulStatusLabel=Status ID for successful refunds
refundFailedStatusLabel=Status ID for failed refunds
confirmationInvoiceLabel=Allow customers to download invoice document
confirmationPackingSlipLabel=Allow customers to download packing slip
AlipayTab=Alipay
alipayActiveLabel=Enabled
alipayTitleLabel=Title
Expand Down
7 changes: 7 additions & 0 deletions resources/lang/en/Template.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
paymentFailureTitle = "Payment cancelled"
paymentFailureDescription = "The order has been submitted but the payment was cancelled. Please try again."
paymentFailureSubmit = "Pay"

paymentInformationLabel = "Your payment has been received. The order's status will be updated shortly."
paymentInformationDownloadInvoice = "Download Invoice"
paymentInformationDownloadPackingSlip = "Download Packing Slip"
20 changes: 14 additions & 6 deletions resources/lib/WalleeSdkHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,22 @@ public static function convertData($data)
}
return $data;
} elseif (is_object($data)) {
$values = [];
foreach (array_keys($data::swaggerTypes()) as $property) {
$getter = 'get' . ucfirst($property);
if ($data->$getter() !== null) {
$values[$property] = self::convertData($data->$getter());
if ($data instanceof stdClass) {
$values = [];
foreach ($data as $property => $value) {
$values[$property] = self::convertData($value);
}
return $values;
} else {
$values = [];
foreach (array_keys($data::swaggerTypes()) as $property) {
$getter = 'get' . ucfirst($property);
if ($data->$getter() !== null) {
$values[$property] = self::convertData($data->$getter());
}
}
return $values;
}
return $values;
} else {
return (string) $data;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<?php
use Wallee\Sdk\Service\TransactionService;
use Wallee\Sdk\Service\LanguageService;
use Wallee\Sdk\Model\TransactionCreate;
use Wallee\Sdk\Model\LineItem;
use Wallee\Sdk\Model\LineItemCreate;
use Wallee\Sdk\Model\AddressCreate;
use Wallee\Sdk\Model\Tax;
use Wallee\Sdk\Model\TaxCreate;
use Wallee\Sdk\Service\PaymentMethodConfigurationService;
use Wallee\Sdk\Model\EntityQuery;
use Wallee\Sdk\Model\EntityQueryFilter;
use Wallee\Sdk\Model\PaymentMethodConfiguration;
use Wallee\Sdk\Service\CurrencyService;
use Wallee\Sdk\Model\Gender;
use Wallee\Sdk\Model\TransactionPending;
use Wallee\Sdk\Model\TransactionCreate;

require_once __DIR__ . '/WalleeSdkHelper.php';

Expand Down Expand Up @@ -210,15 +207,18 @@ function collectTransactionData($transactionRequest, $client)
$transactionRequest->setAllowedPaymentMethodConfigurations($allowedPaymentMethodConfigurations);
}

$spaceId = SdkRestApi::getParam('spaceId');

$transactionRequest = new TransactionCreate();
collectTransactionData($transactionRequest, $client);
$transactionRequest->setAutoConfirmationEnabled(true);
$transactionRequest->setCustomersPresence(\Wallee\Sdk\Model\CustomersPresence::VIRTUAL_PRESENT);

$service = new TransactionService($client);
$createdTransaction = $service->create($spaceId, $transactionRequest);
$spaceId = SdkRestApi::getParam('spaceId');
$transactionId = SdkRestApi::getParam('transactionId');
if (! empty($transactionId)) {
$createdTransaction = $service->read($spaceId, $transactionId);
} else {
$transactionRequest = new TransactionCreate();
collectTransactionData($transactionRequest, $client);
$transactionRequest->setAutoConfirmationEnabled(true);
$transactionRequest->setCustomersPresence(\Wallee\Sdk\Model\CustomersPresence::VIRTUAL_PRESENT);
$createdTransaction = $service->create($spaceId, $transactionRequest);
}

$pendingTransaction = new TransactionPending();
$pendingTransaction->setId($createdTransaction->getId());
Expand All @@ -227,6 +227,4 @@ function collectTransactionData($transactionRequest, $client)
$pendingTransaction->setFailedUrl(SdkRestApi::getParam('failedUrl') . '/' . $createdTransaction->getId());
$transactionResponse = $service->update($spaceId, $pendingTransaction);

return [
'id' => $transactionResponse->getId()
];
return WalleeSdkHelper::convertData($transactionResponse);
Loading

0 comments on commit b9e0eaa

Please sign in to comment.