Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4b090d7
version bump
RichardWatkins1 Apr 7, 2017
9b17da2
fix merge conflicts
RichardWatkins1 May 25, 2017
f47bcaa
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Nov 27, 2017
4f6c4ca
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Apr 12, 2018
841932f
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Apr 18, 2018
35d9a93
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Jun 8, 2018
d50da9a
updated assocation to be belongs_to
RichardWatkins1 Jun 8, 2018
1427537
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Jun 27, 2018
a9387ea
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Aug 28, 2018
7aa24f7
Merge branch 'master' of https://github.com/shiftcommerce/flex-ruby-gem
RichardWatkins1 Nov 1, 2018
225991f
updated method to merge with arributes
RichardWatkins1 Nov 1, 2018
afe14bb
updated method
RichardWatkins1 Nov 1, 2018
8df1229
add logging
RichardWatkins1 Nov 1, 2018
c713b5f
updated method
RichardWatkins1 Nov 1, 2018
94e59cc
added safe operator
RichardWatkins1 Nov 1, 2018
da94d69
spec updated
RichardWatkins1 Nov 1, 2018
22119b9
revert change
RichardWatkins1 Nov 1, 2018
720e6f0
remove variable
RichardWatkins1 Nov 1, 2018
b179683
updated as test: true is not being merged into attributes
RichardWatkins1 Nov 2, 2018
f933df3
removed *
RichardWatkins1 Nov 2, 2018
a6fc033
add default arg {} to handle when nil
RichardWatkins1 Nov 2, 2018
e571cf5
updated version
RichardWatkins1 Nov 12, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/models/cart.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ def add_payment_transaction(transaction)
self.class.requestor.custom("relationships/payment_transactions", {request_method: :post}, {id: id, data: [type: "payment_transactions", id: transaction.id.to_s]})
end

def self.create(*args)
def self.create(args = {})
if FlexCommerceApi.config.order_test_mode
super({test: true})
super(args.merge(test: true))
else
super
end
Expand Down
2 changes: 1 addition & 1 deletion lib/flex_commerce_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module FlexCommerceApi
VERSION = '0.6.51'
VERSION = '0.6.52'
end
8 changes: 4 additions & 4 deletions spec/lib/paypal_express/setup_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
].join(',').freeze

let(:uuid) { SecureRandom.uuid }

let(:global_product) do
to_clean.global_product ||= FlexCommerce::Product.create!(title: "Title for product 1 for variant #{uuid}",
reference: "reference for product 1 for variant #{uuid}",
Expand All @@ -56,12 +56,12 @@
to_clean.line_items ||= FlexCommerce::LineItem.create(item_id: global_variant.id, unit_quantity: 2, item_type: 'Variant', cart_id: cart_id)
end

let(:shipping_address) do
let(:shipping_address) do
to_clean.shipping_address ||= FlexCommerce::Address.create(first_name: 'First Name', last_name: 'Last name', address_line_1: 'Address line 1', city: 'Leeds', country: 'GB', postcode: 'LS10 1QN')
end

subject { described_class.new(cart: cart, success_url: success_url, cancel_url: cancel_url, ip_address: ip_address, callback_url: callback_url, allow_shipping_change: allow_shipping_change, use_mobile_payments: use_mobile_payments) }

context "normal flow" do

let(:redirect_url) { "https://some.paypal.url.com" }
Expand Down Expand Up @@ -254,7 +254,7 @@
to_clean.shipping_method ||= FlexCommerce::ShippingMethod.create(reference:"testing_shipping_#{uuid}", sku: "test_shipping_#{uuid}", label: 'Test Shipping Method', total: '5.00')
end
let(:cart) do
cart ||= FlexCommerce::Cart.find(line_items.container_id)
cart ||= FlexCommerce::Cart.find(line_items.container_id)
cart.update(shipping_method_id: shipping_method.id, shipping_address_id: shipping_address.id)
cart
end
Expand Down