Skip to content

when switching between a payment methods the the redirect url is not always retrieved via ajax #7

@jdukeukpos

Description

@jdukeukpos

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions