mage2pro / stripe

Stripe integration with Magento 2
https://upwork.com/fl/mage2pro
61 stars 8 forks source link

A charge for the test card with required 3D Secure verification (4000000000003063) fails: «Your card was declined» #46

Closed dmitrii-fediuk closed 7 years ago

dmitrii-fediuk commented 7 years ago

My Stripe account: dfediuk@gmail.com I use it in the test mode. I use the official test bank card with required 3D Secure verification: 4000000000003063

1. The problem payment: ch_1BNNbYFzKb8aMux1r8am3qhm.

01

2. The problem POST /v1/charges API request : req_uOlp1BAbu4LOPM

2.1. Request POST body

{
  "customer": "cus_BktO7aVsP2aC5m",
  "description": "Alligator Briefcase (2), New Very Prive 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890 1234567890",
  "capture": "true",
  "statement_descriptor": "PREVED, MEDVED!",
  "amount": "12700",
  "currency": "USD",
  "source": "src_1BNNaQFzKb8aMux1a5L3DynD",
  "metadata": {
    "Customer Name": "Dmitry Fedyuk",
    "Order ID": "ORD-2017/11-01225",
    "Order Items": "Alligator Briefcase (2), New Very Prive",
    "Store Domain": "mage2.pro",
    "Store Name": "Mage2.PRO",
    "Store URL": "https://mage2.pro/sandbox/"
  },
  "shipping": {
    "address": {
      "city": "Sydney",
      "country": "AU",
      "line1": "72 Liverpool St",
      "line2": "",
      "postal_code": "2000"
    },
    "carrier": "Flat Rate",
    "name": "Dmitry Fedyuk",
    "phone": "+61 2 8268 8888"
  }
}

2.1. Response POST body

{
  "error": {
    "message": "Your card was declined.",
    "type": "card_error",
    "code": "card_declined",
    "decline_code": "generic_decline",
    "charge": "ch_1BNNbYFzKb8aMux1r8am3qhm"
  }
}

3. The used source: src_1BNNaQFzKb8aMux1a5L3DynD

3.1. As it is shown in my Stripe dashboard

02

3.2. The POST /v1/sources API request used to create the source: req_vm8i83J8J5voZR

3.2.1. Request POST body

{
  "type": "card",
  "owner": {
    "address": {
      "city": "Sydney",
      "country": "AU",
      "line1": "72 Liverpool St",
      "postal_code": "2000"
    },
    "email": "dfediuk@gmail.com",
    "name": "DMITRY FEDYUK",
    "phone": "+61282688888"
  },
  "usage": "reusable",
  "card": {
    "number": "************3063",
    "cvc": "***",
    "exp_month": "07",
    "exp_year": "21"
  },
  "payment_user_agent": "stripe.js/e8028cf; stripe-js-v3/e8028cf",
  "referrer": "https://mage2.pro/sandbox/checkout/",
  "key": "pk_test_xf2fh0Hu3LqXlqqUg2DEWhEz",
  "pasted_fields": "number"
}

3.2.2. Response body

{
  "id": "src_1BNNaQFzKb8aMux1a5L3DynD",
  "object": "source",
  "amount": null,
  "client_secret": "src_client_secret_BktNAJs55Ik0PLD3pjFcuC3V",
  "created": 1510501290,
  "currency": null,
  "flow": "none",
  "livemode": false,
  "metadata": {
  },
  "owner": {
    "address": {
      "city": "Sydney",
      "country": "AU",
      "line1": "72 Liverpool St",
      "line2": null,
      "postal_code": "2000",
      "state": null
    },
    "email": "dfediuk@gmail.com",
    "name": "DMITRY FEDYUK",
    "phone": "+61282688888",
    "verified_address": null,
    "verified_email": null,
    "verified_name": null,
    "verified_phone": null
  },
  "statement_descriptor": null,
  "status": "chargeable",
  "type": "card",
  "usage": "reusable",
  "card": {
    "exp_month": 7,
    "exp_year": 2021,
    "address_line1_check": "unchecked",
    "address_zip_check": "unchecked",
    "brand": "Visa",
    "country": "US",
    "cvc_check": "unchecked",
    "funding": "credit",
    "last4": "3063",
    "three_d_secure": "required",
    "tokenization_method": null,
    "dynamic_last4": null
  }
} 
dmitrii-fediuk commented 7 years ago

It looks like we should not attach a card with required 3D Secure verification to its customer: we should use such card only once instead.

dmitrii-fediuk commented 7 years ago

Fixed in 2.4.5.