we have 2 payment methods on our site - sagepage direct and paypal
- there is no form for paypal and it requires a redirect to a paymentRedirect url
- there is a form for sagepay and it does a ajax post to the specified save url
Issue 1:
If a user goes to the checkout, selects the paypal payment method and then refreshes the page the checkout displays properly with the paypal payment method selected; however the checkout js object does not the correct paymentRedirect url (it has none at all).
Solution:
pass the paymentRedirect url in the config options for the chekout js object and then have the initialize method set it internally if present
Issue 2:
The payment.switchMethod method sets the paymentRedirect url to false on a switch; however if there is no form (as in the case of paypal) handleChange() only fires completely the first time.
After the first time the LastSubmittedValues match the values the getValues() - an empty hash.
This means that the payment change is not submitted and no paymentReditect url is received via ajax leaving the paymentRedirect url incorrectly as false