#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2

    check card is debit or not in php


    Hi Friends,

    I have an ecommerce website built in PHP. I have integrate with a payment gateway authipay.
    In my website how can we check card is debit or credit using PHP.


    THanks,
    Sarath.T.S
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,027
    Rep Power
    377
    you dont,, you let your payment gateway do that for you..
  4. #3
  5. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    There's nothing special about the card number that determines credit/debit status, as far as I know.

    A better question is why do you care? What use would this information be to you?
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2
    Hi,

    Actually in my website i need to add 1% extra amount for credicard users.

    Originally Posted by ManiacDan
    There's nothing special about the card number that determines credit/debit status, as far as I know.

    A better question is why do you care? What use would this information be to you?
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    105
    Rep Power
    11
    Originally Posted by Sarath_PHP
    Hi,

    Actually in my website i need to add 1% extra amount for credicard users.
    No joke, this is something you will have to inform the payment gateway, as this kind of information is not really supposed to common knowledge
  10. #6
  11. Confused badger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Mar 2009
    Location
    West Yorkshire
    Posts
    1,184
    Rep Power
    492
    The only way as far as I know is to have a drop-down for the user to select:
    Visa
    Visa Debit
    Mastercard
    etc.

    But I'd speak to your payment gateway providers, they'll have been asked this question 10,000 times already and can probably advise better then we can!
    "For if leisure and security were enjoyed by all alike, the great mass of human beings who are normally stupefied by poverty would become literate and would learn to think for themselves; and when once they had done this, they would sooner or later realise that the privileged minority had no function and they would sweep it away"
    - George Orwell, 1984
  12. #7
  13. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Also be careful when doing something like this, since a credit card surcharge is a violation of the standard merchant service agreement of the credit card companies.

    (Last time I checked. I am not a lawyer. I work for a card processing company and we advise clients not to do this, nor is it possible in the system)
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.
  14. #8
  15. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,316
    Rep Power
    7171
    There's nothing special about the card number that determines credit/debit status, as far as I know.
    This must be correct considering some issuers allow you to use the same card number for both credit and debit transactions. Literally the only way to know in this case is to ask the user; even the payment gateway doesn't know. It might be possible to determine from the first few digits of the number whether the card is a credit card, a debit card or both; but I'm not sure about this (and it doesn't help anyway in the case of the card being both).

    The only way as far as I know is to have a drop-down for the user to select:
    Visa
    Visa Debit
    Mastercard
    etc.
    You can distinguish between issuers (ie: Visa, Mastercard, etc.) using the first few digits of the number.

    Also be careful when doing something like this, since a credit card surcharge is a violation of the standard merchant service agreement of the credit card companies.
    In the US, Visa and Mastercard were sued for having this clause in their merchant service agreement and they lost. So while the clause may be present in older copies of the agreement, it is legally void. However, there is a huge laundry list of caveats:
    * Outside the US, surcharges are still a violation of the agreement by default unless there is a law or court case in the relevant jurisdiction that has specifically ruled otherwise
    * Inside the US, some jurisdictions disallow surcharges anyway.
    * (in the US) You have to file paperwork with Visa / Mastercard before you can charge a surcharge and you have to follow strict guidelines
    * (in the US) You can't charge a surcharge on a debit card even if the debit card is used to run a credit transaction
    * Probably some other stuff I don't know about
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2013
    Location
    kerala, India
    Posts
    81
    Rep Power
    2
    Thanks for your valuable information.

    Originally Posted by ManiacDan
    Also be careful when doing something like this, since a credit card surcharge is a violation of the standard merchant service agreement of the credit card companies.

    (Last time I checked. I am not a lawyer. I work for a card processing company and we advise clients not to do this, nor is it possible in the system)
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Dec 2004
    Posts
    3,027
    Rep Power
    377
    in the UK at least, some companies (major airlines) add a surcharge for using Credit Card last time I checked, and no one has batted an eyelid so it must not be illegal in UK?
  20. #11
  21. Sarcky
    Devshed Supreme Being (6500+ posts)

    Join Date
    Oct 2006
    Location
    Pennsylvania, USA
    Posts
    10,908
    Rep Power
    6352
    Airlines add a surcharge for breathing while in flight.
    HEY! YOU! Read the New User Guide and Forum Rules

    "They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin

    "The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002

    Think we're being rude? Maybe you asked a bad question or you're a Help Vampire. Trying to argue intelligently? Please read this.

IMN logo majestic logo threadwatch logo seochat tools logo