Changeset 1951028
- Timestamp:
- 10/03/2018 06:29:03 PM (8 years ago)
- Location:
- ing-psp/trunk
- Files:
-
- 2 added
- 8 edited
-
CHANGELOG.md (modified) (1 diff)
-
README.md (modified) (1 diff)
-
classes/class-wc-ingpsp-afterpay.php (modified) (1 diff)
-
classes/class-wc-ingpsp-helper.php (modified) (5 diffs)
-
ing-php/src/Order/Customer.php (modified) (8 diffs)
-
ing-php/src/Order/Customer/AdditionalAddress.php (added)
-
ing-php/src/Order/Customer/AdditionalAddresses.php (added)
-
ing-php/vendor/beberlei/assert/lib/Assert/Assertion.php (modified) (1 diff)
-
ingpsp.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ing-psp/trunk/CHANGELOG.md
r1942964 r1951028 1 1 # Changelog WooCommerce 2 3 ** 1.3.4 ** 4 * Handle AfterPay testing. Correct calculation of line item totals. Support different billing address. 2 5 3 6 ** 1.3.3 ** -
ing-psp/trunk/README.md
r1942964 r1951028 15 15 16 16 ## Version number 17 Version 1.3. 317 Version 1.3.4 18 18 19 19 ## Pre-requisites to install the plug-ins -
ing-psp/trunk/classes/class-wc-ingpsp-afterpay.php
r1942964 r1951028 54 54 } elseif ($ingOrder->status()->isCancelled()) { 55 55 wc_add_notice( 56 __('Unfortunately, we can not currently accept your purchase with AfterPay. Please choose another payment option to complete your order. We apologize for the inconvenience.' ),56 __('Unfortunately, we can not currently accept your purchase with AfterPay. Please choose another payment option to complete your order. We apologize for the inconvenience.', WC_Ingpsp_Helper::DOMAIN), 57 57 'error' 58 58 ); -
ing-psp/trunk/classes/class-wc-ingpsp-helper.php
r1942964 r1951028 93 93 public static function getCustomerInfo(WC_Order $order) 94 94 { 95 $address = $order->get_address(); 95 $shipping_address = $order->get_address('shipping'); 96 $billing_address = $order->get_address('billing'); 96 97 97 98 if (version_compare(get_option('woocommerce_version'), '3.0', '>=')) { … … 110 111 111 112 return \GingerPayments\Payment\Common\ArrayFunctions::withoutNullValues([ 112 'address_type' => ' billing',113 'address_type' => 'customer', 113 114 'merchant_customer_id' => $order->get_user_id(), 114 'email_address' => $ address['email'],115 'first_name' => $ address['first_name'],116 'last_name' => $ address['last_name'],117 'address' => trim($ address['address_1'])118 .' '.trim($ address['address_2'])119 .' '.trim($ address['postcode'])120 .' '.trim($ address['city']),121 'postal_code' => $ address['postcode'],122 'country' => $ address['country'],123 'phone_numbers' => [$ address['phone']],115 'email_address' => $billing_address['email'], 116 'first_name' => $shipping_address['first_name'], 117 'last_name' => $shipping_address['last_name'], 118 'address' => trim($shipping_address['address_1']) 119 .' '.trim($shipping_address['address_2']) 120 .' '.trim($shipping_address['postcode']) 121 .' '.trim($shipping_address['city']), 122 'postal_code' => $shipping_address['postcode'], 123 'country' => $shipping_address['country'], 124 'phone_numbers' => [$billing_address['phone']], 124 125 'user_agent' => $user_agent, 125 126 'ip_address' => $ip_address, … … 127 128 'gender' => static::getCustomPaymentField('gender'), 128 129 'birthdate' => $birthdate, 130 'additional_addresses' => [ 131 [ 132 'address_type' => 'billing', 133 'address' => trim($billing_address['address_1']) 134 .' '.trim($billing_address['address_2']) 135 .' '.trim($billing_address['postcode']) 136 .' '.trim($billing_address['city']), 137 'country' => $billing_address['country'], 138 ] 139 ] 129 140 ]); 130 141 } … … 151 162 * @return float|string 152 163 */ 153 public static function getProductPrice( WC_Product $product)164 public static function getProductPrice($orderLine, $order) 154 165 { 155 166 if (version_compare(get_option('woocommerce_version'), '3.0', '>=')) { 156 return wc_get_price_including_tax($product);167 return $order->get_item_total( $orderLine, true ); 157 168 } else { 169 $product = $orderLine->get_product(); 158 170 return $product->get_price_including_tax(); 159 171 } … … 294 306 'name' => $orderLine->get_name(), 295 307 'type' => \GingerPayments\Payment\Order\OrderLine\Type::PHYSICAL, 296 'amount' => static::getAmountInCents(static::getProductPrice($orderLine ->get_product())),308 'amount' => static::getAmountInCents(static::getProductPrice($orderLine, $order)), 297 309 'currency' => \GingerPayments\Payment\Currency::EUR, 298 310 'quantity' => (int) $orderLine->get_quantity(), -
ing-psp/trunk/ing-php/src/Order/Customer.php
r1652620 r1951028 13 13 use GingerPayments\Payment\Order\Customer\Country; 14 14 use GingerPayments\Payment\Order\Customer\PhoneNumbers; 15 use GingerPayments\Payment\Order\Customer\AdditionalAddresses; 16 use GingerPayments\Payment\Order\Customer\AdditionalAddress; 15 17 use GingerPayments\Payment\Order\Customer\Locale; 16 18 use GingerPayments\Payment\Order\Customer\Birthdate; … … 69 71 */ 70 72 private $phoneNumbers; 73 74 /** 75 * @var AdditionalAddresses|null 76 */ 77 private $additionalAddresses; 71 78 72 79 /** … … 108 115 array_key_exists('country', $details) ? Country::fromString($details['country']) : null, 109 116 array_key_exists('phone_numbers', $details) ? PhoneNumbers::fromArray($details['phone_numbers']) : null, 117 array_key_exists('additional_addresses', $details) ? AdditionalAddresses::fromArray($details['additional_addresses']) : null, 110 118 array_key_exists('locale', $details) ? Locale::fromString($details['locale']) : null, 111 119 array_key_exists('gender', $details) ? Gender::fromString($details['gender']) : null, … … 132 140 'country' => ($this->country() !== null) ? $this->country()->toString() : null, 133 141 'phone_numbers' => ($this->phoneNumbers() !== null) ? $this->phoneNumbers()->toArray() : [], 142 'additional_addresses' => ($this->AdditionalAddresses() !== null) ? $this->AdditionalAddresses()->toArray() : [], 134 143 'locale' => ($this->locale() !== null) ? $this->locale()->toString() : null, 135 144 'gender' => ($this->gender() !== null) ? $this->gender()->toString() : null, … … 217 226 { 218 227 return $this->phoneNumbers; 228 } 229 230 public function additionalAddresses() 231 { 232 return $this->additionalAddresses; 219 233 } 220 234 … … 262 276 * @param Country $country 263 277 * @param PhoneNumbers $phoneNumbers 278 * @param AdditionalAddresses $additionalAddresses 264 279 * @param Locale $locale 265 280 * @param Gender $gender … … 278 293 Country $country = null, 279 294 PhoneNumbers $phoneNumbers = null, 295 AdditionalAddresses $additionalAddresses = null, 280 296 Locale $locale = null, 281 297 Gender $gender = null, … … 293 309 $this->country = $country; 294 310 $this->phoneNumbers = $phoneNumbers; 311 $this->additionalAddresses = $additionalAddresses; 295 312 $this->locale = $locale; 296 313 $this->gender = $gender; -
ing-psp/trunk/ing-php/vendor/beberlei/assert/lib/Assert/Assertion.php
r1942964 r1951028 2198 2198 if (false === $dateTime || $value !== $dateTime->format($format)) { 2199 2199 $message = \sprintf( 2200 static::generateMessage($message) ?: 'Datum "%s" is niet correct of in het formaat "%s".', 2201 static::stringify($value), 2202 static::stringify($format) 2200 static::generateMessage($message) ?: 'Datum "%s" is niet correct of in het formaat jjjj-mm-dd.', 2201 static::stringify($value) 2203 2202 ); 2204 2203 -
ing-psp/trunk/ingpsp.php
r1942964 r1951028 5 5 * Plugin URI: https://www.ing.nl/ 6 6 * Description: ING WooCommerce plugin for ING Kassa Compleet and ING ePay markets. 7 * Version: 1.3. 37 * Version: 1.3.4 8 8 * Author: Ginger Payments 9 9 * Author URI: https://www.gingerpayments.com/ … … 20 20 * Define ING PSP plugin version 21 21 */ 22 define('INGPSP_PLUGIN_VERSION', 'WooCommerce v1.3. 3');22 define('INGPSP_PLUGIN_VERSION', 'WooCommerce v1.3.4'); 23 23 24 24 add_action('plugins_loaded', 'woocommerce_ingpsp_init', 0); … … 99 99 $methods[] = 'WC_Ingpsp_Payconiq'; 100 100 } 101 if (in_array('afterpay', $allowed_products) || $apiTestMode) { 102 $methods[] = 'WC_Ingpsp_AfterPay'; 103 } 101 $methods[] = 'WC_Ingpsp_AfterPay'; 104 102 105 103 return $methods; -
ing-psp/trunk/readme.txt
r1942964 r1951028 5 5 Requires at least: 4.0 6 6 Tested up to: 4.9.6 7 Stable tag: 1.3. 37 Stable tag: 1.3.4 8 8 License: The MIT License (MIT) 9 9 License URI: https://opensource.org/licenses/MIT … … 104 104 == Changelog == 105 105 106 = 1.3.4 = 107 * Handle AfterPay testing. Correct calculation of line item totals. Support different billing address. 108 106 109 = 1.3.3 = 107 110 * Updated translations. Supporting dutch format for DOB
Note: See TracChangeset
for help on using the changeset viewer.