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

PayPal Fails if a Password Field is Provided #188

Open
gordonbanderson opened this issue Apr 23, 2018 · 0 comments
Open

PayPal Fails if a Password Field is Provided #188

gordonbanderson opened this issue Apr 23, 2018 · 0 comments

Comments

@gordonbanderson
Copy link

hi,

I spent some time banging my head before I got to the bottom of this. It turns out that is a password field is provided, as below, then the initial authentication step of purchase does not work and payment is immediately cancelled.

Payload that works:

Array
(
    [amount] => 10
    [transactionId] => ORDER35939
    [currency] => USD
    [cancelUrl] => http://localhost/paymentendpoint/8e250c99555eb3a73f538081f796f5/cancel
    [returnUrl] => http://localhost/paymentendpoint/8e250c99555eb3a73f538081f796f5/complete
    [clientIp] => 172.26.0.1
    [notifyUrl] => http://localhost/paymentendpoint/8e250c99555eb3a73f538081f796f5/notify
    [card] => Omnipay\Common\CreditCard Object
        (
            [supported_cards:protected] => Array
                (
                    [visa] => /^4\d{12}(\d{3})?$/
                    [mastercard] => /^(5[1-5]\d{4}|677189)\d{10}$|^2(?:2(?:2[1-9]|[3-9]\d)|[3-6]\d\d|7(?:[01]\d|20))\d{12}$/
                    [discover] => /^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/
                    [amex] => /^3[47]\d{13}$/
                    [diners_club] => /^3(0[0-5]|[68]\d)\d{11}$/
                    [jcb] => /^35(28|29|[3-8]\d)\d{12}$/
                    [switch] => /^6759\d{12}(\d{2,3})?$/
                    [solo] => /^6767\d{12}(\d{2,3})?$/
                    [dankort] => /^5019\d{12}$/
                    [maestro] => /^(5[06-8]|6\d)\d{10,17}$/
                    [forbrugsforeningen] => /^600722\d{10}$/
                    [laser] => /^(6304|6706|6709|6771(?!89))\d{8}(\d{4}|\d{6,7})?$/
                )

            [parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
                (
                    [parameters:protected] => Array
                        (
                        )

                )

        )

)

Payload that fails:

 Array
(
    [FirstName] => fred
    [Surname] => fred
    [Email] => [email protected]
    [Password] => Array
        (
            [_Password] => redfred
            [_ConfirmPassword] => redfred
        )

    [MiddleName] => Fred
    [City] => Fred
    [SecurityID] => 8707b420fa0cef7743f7b5f492f246a29f7577bd
    [Captcha] => seven
    [action_pay] => Register and Pay
    [clientIp] => 172.26.0.1
    [amount] => 10
    [currency] => USD
    [returnUrl] => http://localhost/paymentendpoint/24caae03dff7346ea6037bc376a313/complete
    [cancelUrl] => http://localhost/paymentendpoint/24caae03dff7346ea6037bc376a313/cancel
    [notifyUrl] => http://localhost/paymentendpoint/24caae03dff7346ea6037bc376a313/notify
    [transactionId] => 24caae03dff7346ea6037bc376a313
    [card] => Omnipay\Common\CreditCard Object
        (
            [supported_cards:protected] => Array
                (
                    [visa] => /^4\d{12}(\d{3})?$/
                    [mastercard] => /^(5[1-5]\d{4}|677189)\d{10}$|^2(?:2(?:2[1-9]|[3-9]\d)|[3-6]\d\d|7(?:[01]\d|20))\d{12}$/
                    [discover] => /^(6011|65\d{2}|64[4-9]\d)\d{12}|(62\d{14})$/
                    [amex] => /^3[47]\d{13}$/
                    [diners_club] => /^3(0[0-5]|[68]\d)\d{11}$/
                    [jcb] => /^35(28|29|[3-8]\d)\d{12}$/
                    [switch] => /^6759\d{12}(\d{2,3})?$/
                    [solo] => /^6767\d{12}(\d{2,3})?$/
                    [dankort] => /^5019\d{12}$/
                    [maestro] => /^(5[06-8]|6\d)\d{10,17}$/
                    [forbrugsforeningen] => /^600722\d{10}$/
                    [laser] => /^(6304|6706|6709|6771(?!89))\d{8}(\d{4}|\d{6,7})?$/
                )

            [parameters:protected] => Symfony\Component\HttpFoundation\ParameterBag Object
                (
                    [parameters:protected] => Array
                        (
                            [billingFirstName] => fred
                            [shippingFirstName] => fred
                            [email] => [email protected]
                            [billingCity] => Fred
                            [shippingCity] => Fred
                        )

                )

        )

)

This relates to the initiate($data) method on this page, https://github.com/silverstripe/silverstripe-omnipay/blob/master/docs/en/GettingStarted.md

Documentation should probably be updated to save others pain :)

Cheers

Gordon

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

No branches or pull requests

1 participant