cancel
Showing results for 
Search instead for 
Did you mean: 

Validate a specific type of card in VBA

I've got some VBA code running in the sandbox and it works when I pass in a valid card # (based on the text guide).  But I cannot find any code samples which include the card type  so that if I enter:

 

Visa: 4111111111111111

it approves the transaction but if I enter

 

Mastercard: 4111111111111111

it declines the transaction.

 

What is the proper syntax in the below to pass the card type and have the sandbox validate for the cardtype and number?

 

If frm.chk_CardType Then
    post_string = post_string & "cardType=" & URLEncode(frm.cbo_CardType) & "&"
End If
post_string = post_string & "x_card_num=" & URLEncode(frm.txtCCNum) & "&"

 

The above code does not work, as "cardType" does not appear to be a valid parameter, and it returns "This transaction has been approved" regardless of the value of cbo_CardType

 

Thanks for your help

 

dalefye1
Member
1 ACCEPTED SOLUTION

Accepted Solutions

Hello,

 

We always derive the card type from the card number, so we do not have an input parameter for card type. If for some reason you would like to validate that a customer has matched the card number to a particular card type, this would have to be done outside of our system.

 

Thanks,

Trevor

View solution in original post

Trevor
Administrator Administrator
Administrator
1 REPLY 1

Hello,

 

We always derive the card type from the card number, so we do not have an input parameter for card type. If for some reason you would like to validate that a customer has matched the card number to a particular card type, this would have to be done outside of our system.

 

Thanks,

Trevor

Trevor
Administrator Administrator
Administrator