Skip to content

Releases: shiftcommerce/flex-ruby-gem

Support sending X-Forwarded-For header

04 Mar 10:58

Choose a tag to compare

Configure a lambda to set to a X-Forwarded-For header on outgoing requests:

FlexCommerceApi.config do |config|
  config.forwarded_for = ->{ RequestStore[:request_ip] }
end

In 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
end

Paypal Authentication migration to gem

16 Apr 10:00
0b858fe

Choose a tag to compare

#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

03 Apr 12:01
0bc8126

Choose a tag to compare

Update the below method:

def test_mode
  FlexCommerceApi.config.order_test_mode == true || FlexCommerceApi.config.order_test_mode == "true"
end

Revert Json Api Client Upgrade

08 Mar 09:23
d5f0ff8

Choose a tag to compare

#170 - This PR reverts the json api client upgrade introduced in #158 this upgrade has introduced serious performance issues on FE

Bugfix - Correct test_mode method to return TEST_ORDER_MODE boolean correctly

05 Feb 15:39
49feac5

Choose a tag to compare

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 
end

Update cart create method so initial line items created along side the cart in development mode.

12 Nov 16:13
573701a

Choose a tag to compare

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

05 Oct 09:32
292304f

Choose a tag to compare

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

03 Oct 10:44
e64a65e

Choose a tag to compare

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

13 Sep 10:47
45344ee

Choose a tag to compare

#159: Instead of checking if it is true or not. Check whether it is being set or not.

Migrate Paypal setup to FE

09 Aug 13:42
3cde200

Choose a tag to compare

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.