0
votes

Is it correct to charge a source based on the event data's amount and currency? Sometimes I receive events like:

{
  "object": {
    "id": "src_1Ch7qCIhY6Z3DMWts3HPpWoH",
    "object": "source",
    "amount": null,
    "card": {
      "exp_month": 2,
      "exp_year": 2022,
      "address_zip_check": "unchecked",
      "brand": "Visa",
      "card_automatically_updated": false,
      "country": "US",
      "cvc_check": "unchecked",
      "fingerprint": "xGimquKE7Rnk7LK2",
      "funding": "credit",
      "last4": "3063",
      "three_d_secure": "required",
      "address_line1_check": null,
      "tokenization_method": null,
      "dynamic_last4": null
    },
    "client_secret": "src_client_secret_D7MZe67elxyyCGGAaUA1lCsS",
    "created": 1529983660,
    "currency": null,
    "flow": "none",
    "livemode": false,
    "metadata": {
    },
    "owner": {
      "address": {
        "city": null,
        "country": null,
        "line1": null,
        "line2": null,
        "postal_code": "22222",
        "state": null
      },
      "email": null,
      "name": null,
      "phone": null,
      "verified_address": null,
      "verified_email": null,
      "verified_name": null,
      "verified_phone": null
    },
    "statement_descriptor": null,
    "status": "chargeable",
    "type": "card",
    "usage": "reusable"
  },
  "previous_attributes": null
}

Notice amount and currency are null. Why isit null even when I have set the amount and currency when creating the source? I also notice its sometimes set correctly. Should I be relying on this properties set? Or should I be storing them in my DB? And store this transaction ID from DB into the metadata of the source for example.


UPDATE

I realized that this event is called when my frontend creates a 3ds source.

stripe.createSource(card).then(function (result) {
    console.log(result.source)
})

I am alittle confused, the docs did say

When creating a 3D Secure source, its status is most commonly first set to pending and cannot yet be used to create a charge. In some cases, a 3D Secure source’s status can be immediately set to chargeable. This can happen if the customer’s card has not yet been enrolled in 3D Secure.

But I am using the test card, 4000000000003063 which requires 3ds verification. Why is it immediately chargeable?

status: "chargeable"
type: "card"
usage: "reusable"
1

1 Answers

1
votes

The source you are creating is a regular card source, which is distinct from a Three D Secure source. That card source itself is chargeable, but if you try to charge it you will see that it will be declined because the card requires 3DS.

If the card source indicates that Three D Secure is required, then you need to use it to create a 3DS source and proceed with charging that instead : https://stripe.com/docs/sources/three-d-secure#create-3ds-source