Search code examples
bluesnap

Can I save multiple cards for one shopper using the BlueSnap Payment API?


I'm vaulting credit card data on BlueSnap, using the vaulted shopper request.How can I vault multiple cards for the same shopper? Will it return a single token or different tokens per card?


Solution

  • BlueSnap vaults cards under a shopper and supports multiple cards per shopper. Here’s an example of how to vault a Shopper with two credit cards:

    <vaulted-shopper xmlns="http://ws.plimus.com">
       <first-name>FirstName</first-name>
       <last-name>LastName</last-name>
       <payment-sources>
          <credit-card-info>
             <credit-card>
                <card-number>4263982640269299</card-number>
                <security-code>837</security-code>
                <expiration-month>02</expiration-month>
                <expiration-year>2018</expiration-year>
             </credit-card>
          </credit-card-info>
          <credit-card-info>
             <credit-card>
                <card-number>374245455400126</card-number>
                <security-code>1234</security-code>
                <expiration-month>05</expiration-month>
                <expiration-year>2017</expiration-year>
             </credit-card>
          </credit-card-info>
       </payment-sources>
    </vaulted-shopper>
    

    Notice in the code above that the credit-card-info element has 2 credit-card elements. When using this vaulted shopper to conduct transactions you will need to pass the card-last-four-digits and card-type to tell BlueSnap which card to use for the specific transaction.