Payments source cann't be blank #4067
-
Trying to create a custom payment integration for my local payment provider but running into issues when select the new payment method:
Notes: I need to not rely on the credit card form that shows up, I am trying to alter the flow where by when they select |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Your payment method should implement Here's where that's called in the Payment model: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment.rb#L185-L187 Here's the validation that's failing: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment.rb#L41 Here's an example of a payment method that doesn't require a source: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment_method/check.rb#L32-L34 All that said, you likely want to redirect for payment before completing the order and in so doing create a payment with a source that represents whatever makes sense for how your gateway works, but I say that without knowing anything about your specific situation, so disregard if it's not relevant. |
Beta Was this translation helpful? Give feedback.
Your payment method should implement
source_required?
in order for Solidus to identify that (if this is the case) your payments won't be associated with some kind of source record representing the payment method.Here's where that's called in the Payment model: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment.rb#L185-L187
Here's the validation that's failing: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment.rb#L41
Here's an example of a payment method that doesn't require a source: https://github.com/solidusio/solidus/blob/master/core/app/models/spree/payment_method/check.rb#L32-L34
All that said, you likely want to redirect for …