Commit 68e61ccc authored by Azad Cheikho's avatar Azad Cheikho
Browse files

Merge branch 'develop' into 'master'

Version 2.4.3

See merge request !1
parents 1e806ebe 420c8297
......@@ -467,30 +467,32 @@ class WC_Gateway_Hosted_Payments extends WC_Payment_Gateway
\Upg\Library\Request\CreateTransaction $request
) {
$billingAddress = new \Upg\Library\Request\Objects\Address();
$shippingAddress = new \Upg\Library\Request\Objects\Address();
$billingStreet = $order->get_billing_address_1() . ' ' . $order->get_billing_address_2();
$shippingStreet = $order->get_shipping_address_1() . ' ' . $order->get_shipping_address_2();
$billingAddress->setStreet($billingStreet)
->setZip($order->get_billing_postcode())
->setCity($order->get_billing_city())
->setState($order->get_billing_state())
->setCountry($order->get_billing_country());
$request->setBillingAddress($billingAddress);
$shippingAddress->setStreet($shippingStreet)
->setZip($order->get_shipping_postcode())
->setCity($order->get_shipping_city())
->setState($order->get_shipping_state())
->setCountry($order->get_shipping_country());
$shippingStreet = $order->get_shipping_address_1() . ' ' . $order->get_shipping_address_2();
$request->setBillingAddress($billingAddress);
$request->setShippingAddress($shippingAddress);
if(!empty(trim($shippingStreet))) {
$shippingAddress = new \Upg\Library\Request\Objects\Address();
$shippingAddress->setStreet($shippingStreet)
->setZip($order->get_shipping_postcode())
->setCity($order->get_shipping_city())
->setState($order->get_shipping_state())
->setCountry($order->get_shipping_country());
$request->setShippingAddress($shippingAddress);
}
return $request;
}
/**
* Populate th basket
* Populate the basket
*
* @param WC_Order $order
* @param \Upg\Library\Request\CreateTransaction $request
......@@ -532,8 +534,9 @@ class WC_Gateway_Hosted_Payments extends WC_Payment_Gateway
$calculated += $shippingAmount;
$shippingMethodName = (empty($order->get_shipping_method())) ? 'Shipping' : $order->get_shipping_method();
$shippingItem = new \Upg\Library\Request\Objects\BasketItem();
$shippingItem->setBasketItemText($order->get_shipping_method())
$shippingItem->setBasketItemText($shippingMethodName)
->setBasketItemCount(1)
->setBasketItemType(\Upg\Library\Basket\BasketItemType::BASKET_ITEM_TYPE_SHIPPINGCOST)
->setBasketItemAmount(new \Upg\Library\Request\Objects\Amount($shippingAmount));
......
......@@ -2,7 +2,7 @@
/**
* Plugin Name: CrefoPay für WooCommerce
* Description: Die Komplettlösung für Ihre Zahlungsabwicklung.
* Version: 2.4.2
* Version: 2.4.3
* Author: CrefoPayment GmbH & Co. KG
* Text Domain: upg
*/
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment