Commits
Thomas Tornevall authored 0c097df66c8
RWC-64 -- Continued
* Adapted has_fields in ResursDefault to include both hosted and simplified. As it seems, it has no real effect as of now.
* Moved api-data-setup to own method to cover all flows ($this->setPaymentApiData()). If this is not happening, RCO will stand alone without data at successUrl.
* Marking during header scripts generator that customer is in store. The behaviour for RCO is also with this changed to only generate the iframe if the cart is not empty, making us be able to tag the session when customer is in the checkout.
* Since RCO is backing the order into woocommerce, instead of following the process_payment-routines, we also have to handle some of the metadata on the landing page. This is a big risk we take, since if the customer is not returning, that metadata will never reach us.
* Moved $this->preProcessOrder($order) out of the canProcessOrder filter.
* preProcessOrder now requests session if there is already a rco order reference set.
* Updated $checkoutRequestType = sprintf('process%s', ucfirst(Data::getCheckoutType()))
* During api-success-handler, we will now merge a new _REQUEST by session variables, since RCO does not fill up the API data properly (due to backwards creation).
* Created getApiByRco() -- Used to merge _REQUEST with prior session.
* Created getSessionApiData() -- Dependency in getApiByRco, which merges the data depending on the sent array.
* getCurrentOrder() is not fetching order_awaiting_payment from session if no order id is present in the getApiValue (common with RCO as checkout).
* Moved some standard orderMeta-sets into own function so that they can be shared over several places. Method is public.
* setOrderLines will now skip rendering process if cart is empty. Used as a protective layer when in "order success" as the header function usually recreates an iframe in RCO when user is in some various places.
* Cleaned up and adapted processRco method to reflect reality of RCO. Auto detective layer for legacy RCO or >v2.
* customerWasInCheckout is not a "constant" key in the WooCommerce class so it will be reachable by many instances.
* No longer using getResursOption to get the checkout type: Data::getCheckoutType()
* setOrderMeta() now handles integer values for the order id, and not only the proper WC_Order-class.
* setOrderMeta() is now using translations for the exception thrown.
* canProcessOrderResponse() is now telling Woocommerce where to redirect after a success.
* getPreparedRcoOrder() is now handling address data properly. It is also merging delivery address data from billing address in places where it is normally empty.
* Fixed a template error (RWC-171)