Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

programatically choose the payment method and skip the step #9249

Open
krtschmr opened this issue Feb 14, 2019 · 0 comments
Open

programatically choose the payment method and skip the step #9249

krtschmr opened this issue Feb 14, 2019 · 0 comments

Comments

@krtschmr
Copy link
Contributor

  def select_default_payment
    self.payments_attributes = [{"payment_method_id" => available_payment_methods.select{|x|x.type == "Spree::PaymentMethod::BankTransfer"}.first.id}]
    self.save
  end

this in theory will work, always assign the BankTransfer to the order. Sometimes, which i can't debug, the payment method is getting lost. is there another way to force a certain payment method to an order?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants