Comments (5)
@Mafi88 Yes. Thank you very much!
from spree_braintree_vzero.
@vmatekole it looks like your payment was not processed (maybe https://github.com/spree-contrib/spree_braintree_vzero/blob/master/app/models/spree/order_decorator.rb#L2 is not firing)?
Please try order.process_payments!
in console and check if payment got processed (both Spree and Braintree)
from spree_braintree_vzero.
@Mafi88 Thank you so much for your support — you were correct but I don't understand the root cause, perhaps you can explain....
I have an existing order decorator, it appears this somehow was preventing the after_transition ("complete") state in the above decorator from firing, here is an excerpt:
Spree::Order.class_eval do
# alias_method :can_ship?, :ship
# Vend Inventory reconcile step
insert_checkout_step :reconciled, :after => :complete
Spree::Order.state_machine.before_transition :to => :complete, :do => :paypal
Spree::Order.state_machine.after_transition :to => :complete, :do => :update_vend_inventory_status
Spree::Order.state_machine.after_transition :to => :reconciled, :do => :log_order
I had to include my own method and duplicate the following code and the after_transition('complete') :
def paypal
process_paypal_express_payments
end
def process_paypal_express_payments
return unless paid_with_paypal_express?
if payments.valid.empty?
order.errors.add(:base, Spree.t(:no_payment_found))
false
else
payments.valid.last.update(amount: total)
process_payments!
end
end
from spree_braintree_vzero.
@vmatekole it happens to me when I mess with checkout flow (insert/remove checkout steps) Lately I had the same problem with tax_cloud before_transition
.
I think that you only need to duplicate the transition method from gem, so:
state_machine.before_transition to: :complete, do: :process_paypal_express_payments
without overriding the actual process_paypal_express_payments
method. Only this one line.
Also, I recommend usage of before_transition
here, because it's the default checkout flow.
Right now, if it fails, customer will probably get order_complete email, not sure if inventory won't get processed too.
from spree_braintree_vzero.
@vmatekole did it help?
from spree_braintree_vzero.
Related Issues (20)
- Shipment tax adjustments not created when using Paypal Express
- @Mafi88 There was a JS error that was impacting all pages, fixing this solved the problem. It must have affected some JS related to the checkout.
- PayPal HOT 4
- Template scripts fail to run if "head script" is included with "defer" HOT 1
- Getting ActiveRecord::StatementInvalid in Spree::UserSessionsController#create HOT 2
- uninitialized constant Spree::BraintreeVzero::LegacyRailsPatch
- Payment "source" is nil on PayPalExpress HOT 1
- Dependabot can't resolve your Ruby dependency files
- PayPal Express Checkout not rendering on payment page HOT 2
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- "braintree is not defined" on cart using PayPal Express Checkout HOT 1
- 3D Secure preference has no impact on checkout process
- Drop-in does not appear on backend - source_required?
- Truncate Product Description and Name HOT 7
- Feature Request: PayPal ACDC
- SKU should not be used as product_code for Braintree!
- Switching between payment methods broken by this gem
- 2099 authorisation required error on 3.5.1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spree_braintree_vzero.