Releases: shiftcommerce/flex-ruby-gem
Support sending X-Forwarded-For header
Configure a lambda to set to a X-Forwarded-For header on outgoing requests:
FlexCommerceApi.config do |config|
config.forwarded_for = ->{ RequestStore[:request_ip] }
endIn a Rails app you might set this as follows:
# application_controller.rb
class ApplicationController
before_action :set_request_ip
private
def set_request_ip
RequestStore[:request_ip] = request.remote_ip
end
endPaypal Authentication migration to gem
#165 - This PR handles first part of shiftcommerce/matalan-rails-site#2388 (comment)
We have migrated the auth and order creation process to the gem. We also have introduced retries around the paypal process, as we know the Paypal Auth process is most time taking one, and the possibility of timeouts around it is more.
Updated test_mode conditional so value can be boolean or string
Update the below method:
def test_mode
FlexCommerceApi.config.order_test_mode == true || FlexCommerceApi.config.order_test_mode == "true"
endRevert Json Api Client Upgrade
Bugfix - Correct test_mode method to return TEST_ORDER_MODE boolean correctly
Updated the test mode method so it correctly returns if it should be a test order or not depending on the environment.
def test_mode
FlexCommerceApi.config.order_test_mode == true
endUpdate cart create method so initial line items created along side the cart in development mode.
In order to identify 'test' orders if we are running in development mode we were previously overwriting the attributes with {test: true}. This release updates the cart models create so {test: true} is merged into the attributes rather than overwriting them.
Upgrade json_api_client to v1.5.3
This PR upgrades json_api_client to v1.5.3.
Note that changes are required on the F/E in order to work with this version of the gem (info will be added to F/E gem update ticket)
Improve error messages when json parsing fails
Improve error messages thrown when json parsing fails (#154) * Improve error messages thrown when json parsing fails * Use raven_context instead of the error message * Add Sentry context to internal server errors
Update the Paypal Test Mode condition
#159: Instead of checking if it is true or not. Check whether it is being set or not.
Migrate Paypal setup to FE
We now have the Paypal setup and Additional Info functionalities migrated to FE. Final Payment processing like authorizations etc, will be still handled at platform level.