3D Secure should fail but doesn't...

thierryler
Contributor
Contributor

Using the standard integration, I want to test 3D Secure result.

 

I've found credit card numbers here : https://developer.paypal.com/docs/checkout/advanced/customize/3d-secure/test/

 

For the card "4000000000000010" it should fail for "Unsuccessful signature verification" but it goes into the onApprove function.

 

For card  "4000000000000028" it should fail for "Unsuccessful authentication" but it goes into the onApprove function too...

 

For card  "4000000000000051" it should fail for "Cardholder not enrolled" but it goes into the onApprove function too...

 

So actually, all card that should fail are working... 

 

Is there something I do not understand well?

 

Here my code

 

<script src="https://www.paypal.com/sdk/js?client-id=MY_CLIENT_ID&currency=EUR"></script>


<script>
  showSpinner();

  paypal.Buttons({
    style: {
      shape: 'pill',
    },

    createOrder: function(data, actions) {
      return actions.order.create({
        purchase_units: [{
          amount: {
            currency_code: "EUR",
            value: "{{ price }}",
          },
          invoice_id: "{{ invoice.ppInvoiceId }}",
          custom_id: "{{ invoice.ppCustomId }}",
        }],
        
        payer: {
          email_address: "{{ email }}",
          name: {
            given_name: "{{ firstname }}",
            surname: "{{ lastname }}",
          },
          
          address: {
            address_line_1: "{{ streetAddress1 }}",
            address_line_2: "{{ streetAddress2 }}",
            postal_code: "{{ postalCode }}",
            country_code: "{{ countryCode | upper}}",
            admin_area_2: "{{ city | upper}}",
          }
        }
      });
    },

    onApprove: function(data, actions) {
      console.log('ICE ::: onApprove ::: data: ', data)
      showSpinner();
      const { facilitatorAccessToken, orderID, payerID } = data
      // Here send data to server to perform capture...
    },

    onCancel: function (data) {
      // console.log('ICE ::: onCancel ::: data: ', data)
      hideSpinner();
    },

    onError: function (err) {
      console.log('ICE ::: onError ::: data: ', err)
      hideSpinner();
    },

    onClick: function()  {
      console.log('ICE ::: onClick')
    },

    onInit: function(data, actions)  {
      console.log('ICE ::: onInit ::: data: ', data)
      hideSpinner();
    }

  }).render('#paypal-button-container');
</script>

 

Login to Me Too
2 REPLIES 2

angelleye
Advisor
Advisor

Do you have negative testing enabled for the sandbox receiver account you're working with?  I believe you need to enable this in order for those triggers to return errors like you're wanting.

 

angelleye_0-1647243798873.png

 

Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

thierryler
Contributor
Contributor

Hello,

 

I've turn on the negative testing param

 

Capture d’écran 2022-03-14 à 21.19.29.png

 

but it still goes into the onApprove function 😞

 

Does it work with the standard integration?

 

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.