Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #9 from heidelpay/change/PLENTY-42/workaround-vat
Browse files Browse the repository at this point in the history
Change/plenty 42/workaround vat
  • Loading branch information
xBlack-Shadow authored Dec 13, 2018
2 parents 6ff7dc5 + f7c2c62 commit 2ddb183
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 9 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,19 @@ Diese Erweiterung integriert die heidelpay Zahlarten in Ihren Plentymarkets Shop
This extension provides an integration of the heidelpay payment methods for your plentymarkets shop.\
* [User Guide](meta/documents/user_guide_en.md)
* [Changelog](meta/documents/changelog_en.md)
* [Support Contacts](meta/documents/support_contact_en.md)
* [Support Contacts](meta/documents/support_contact_en.md)

## Support
For any issues or questions please get in touch with our support.

#### Web page
https://dev.heidelpay.com/

#### Email
[email protected]

#### Phone
+49 (0)6221/6471-100

#### Twitter
@devHeidelpay
4 changes: 3 additions & 1 deletion meta/documents/changelog_de.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@

### Change
- Logos ausgetauscht.
- diverse Codingstyle-Fehler behoben.
- Diverse Codingstyle-Fehler behoben.
- .gitignore aktualisiert
- Readme um Support Informationen ergänzt

### Fixed
- Support Telefonnummer korrigiert.
- MwSt wird nun bei Auslandsgeschäften nicht mit einbezogen

## [1.1.0][1.1.0]

Expand Down
4 changes: 3 additions & 1 deletion meta/documents/changelog_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
### Change
- Replace images.
- Resolve codingstyle violations.
- update .gitignore
- Update .gitignore
- Add support information to readme

### Fixed
- Fix support phone number.
- Fix incorrect VAT for internaational customer

## [1.1.0][1.1.0]

Expand Down
21 changes: 15 additions & 6 deletions src/Services/PaymentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@ public function getPaymentMethodContent(
*/
private function prepareRequest(Basket $basket, string $paymentMethod, int $mopId, string $transactionId)
{
$basketArray = $basket->toArray();

/** @var BasketService $basketService */
$basketService = pluginApp(BasketService::class);

Expand All @@ -314,7 +316,7 @@ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopI

// set customer personal information & address data
$addresses = $this->getCustomerAddressData($basket);
$this->heidelpayRequest['IDENTIFICATION_SHOPPERID'] = $basket->customerId;
$this->heidelpayRequest['IDENTIFICATION_SHOPPERID'] = $basketArray['customerId'];
$this->heidelpayRequest['NAME_GIVEN'] = $addresses['billing']->firstName;
$this->heidelpayRequest['NAME_FAMILY'] = $addresses['billing']->lastName;
$this->heidelpayRequest['CONTACT_EMAIL'] = $addresses['billing']->email;
Expand All @@ -332,9 +334,16 @@ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopI

$this->heidelpayRequest['IDENTIFICATION_TRANSACTIONID'] = $transactionId;

// set amount to net if showNetPrice === true
if ($this->sessionStorageFactory->getCustomer()->showNetPrice) {
$basketArray['itemSum'] = $basketArray['itemSumNet'];
$basketArray['basketAmount'] = $basketArray['basketAmountNet'];
$basketArray['shippingAmount'] = $basketArray['shippingAmountNet'];
}

// set basket information (amount, currency, orderId, ...)
$this->heidelpayRequest['PRESENTATION_AMOUNT'] = $basket->basketAmount;
$this->heidelpayRequest['PRESENTATION_CURRENCY'] = $basket->currency;
$this->heidelpayRequest['PRESENTATION_AMOUNT'] = $basketArray['basketAmount'];
$this->heidelpayRequest['PRESENTATION_CURRENCY'] = $basketArray['currency'];

$this->heidelpayRequest['FRONTEND_ENABLED'] = 'TRUE';
$this->heidelpayRequest['FRONTEND_LANGUAGE'] = $this->sessionStorageFactory->getLocaleSettings()->language;
Expand Down Expand Up @@ -362,9 +371,9 @@ private function prepareRequest(Basket $basket, string $paymentMethod, int $mopI
$this->heidelpayRequest['CRITERION_MOP'] = $mopId;
$this->heidelpayRequest['CRITERION_SHOP_TYPE'] = 'plentymarkets 7';
$this->heidelpayRequest['CRITERION_SHOPMODULE_VERSION'] = Plugin::VERSION;
$this->heidelpayRequest['CRITERION_BASKET_ID'] = $basket->id;
$this->heidelpayRequest['CRITERION_ORDER_ID'] = $basket->orderId;
$this->heidelpayRequest['CRITERION_ORDER_TIMESTAMP'] = $basket->orderTimestamp;
$this->heidelpayRequest['CRITERION_BASKET_ID'] = $basketArray['id'];
$this->heidelpayRequest['CRITERION_ORDER_ID'] = $basketArray['orderId'];
$this->heidelpayRequest['CRITERION_ORDER_TIMESTAMP'] = $basketArray['orderTimestamp'];
$this->heidelpayRequest['CRITERION_PUSH_URL'] =
$this->paymentHelper->getDomain() . '/' . Routes::PUSH_NOTIFICATION_URL;

Expand Down

0 comments on commit 2ddb183

Please sign in to comment.