stripe-payments

Stripe Rules Not Working as Expected for Blocking Specific Bins


I have implemented stripe for payments, and I need a rules to block bin, for that I have created a list bins_to_block into radar section:

enter image description here

then I have created a rule for the next escenario:

We have a list of bins that they should be blocked for new clients, but there are another old clients that they already have subscriptions and for those clients we have to accept the payment so basicalle we have 2 escenarios, for example:

  1. Existing customers with an active subscription should be able to continue making payments as usual, even if their BIN is on the blocked list.
  2. New clients that want to make a payment with a bin that it's in the list, the payment should be rejected!

So for that I have created this rule:

Block if :card_bin: in @bins_to_block and not :is_recurring:

but when I make a payment with a new mail (basically new subscription) this payment is accepted. Is there any rule for this escenario?


Solution

  • The easiest way to achieve this is to use custom metadata attribute. In this case you can use Block if :card_bin: in @card_bin_blocklist and ::customer:block_bin:: = 'true' where block_bin is a metadata that you will add to all of your new customers as follows:

    stripe.createCustomer({
    //....
       metadata: {
          block_bin : 'true'
       }
    }