Payment step functionality and order confirmation page #16
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Payment step
This currently only works properly with a single payment gateway. I've set it up to use Stripe in my testing. We will need to revisit it at a later date. There are difficulties in having multiple gateways within the same form and I couldn't get the Stripe scripts to initialise when they were within the accordion.
I've had to move the payment submission button to within the main area as Stripe injects this and I could not find a way to submit their payment form from an external button.
I've taken the liberty of moving the billing address section above the card payment section. It just seemed to make more sense that way, especially with the payment button within the main area.
I've had issues setting the billing address if it's different to the shipping address. I think I have resolved these. However the billing address form is currently being populated with address values and it should probably be blank if it hasn't previously been set.
Updating an address submits to a different controller than the payment itself. So I've added submit buttons to the "Different billing address" form to get around this.
Order confirmation page
All information on this screen is generated from the order
There is, as far as I know, any means to handle the "Review or Cancel Your Order" thing without writing some custom code. I've taken the step of hooking the button up to point at a non-existent controller action for now.
Additional things
Though the shipping estimator is not working yet. I've changed the cart/order summary so that, once a shipping address is set, the wording changes to "Shipping" rather than "Estimated Shipping"