2

I'm using laravel 5.2 with cashier package this is the form that i'm using in order to get the client creditcard token:

<form action="/your-server-side-code" method="POST">
  <script
    src="https://checkout.stripe.com/checkout.js" class="stripe-button"
    data-key="test_token"
    data-amount="999"
    data-name="Demo Site"
    data-description="Widget"
    data-image="https://stripe.com/img/documentation/checkout/marketplace.png"
    data-locale="auto">
  </script>
</form>

after it the form is submitted automatically And i get the regular answer from the server that contain the client token.

How i can save the credit-card last 4 number and expire date that the user enter? I Know that i don't need it for credit card transactions. i just want to save it in order to show it to my customer which card thy entered.

Thank!

Dani Banai
  • 1,080
  • 4
  • 14
  • 33
  • Do you even have that data in the response? Can you post the whole response you get from the company? – Peon Dec 28 '16 at 16:10
  • 1
    I don't think its possible, and would advice against storing any data on your server. Each country has different rules (about storing credit card information) - legal wise. By using stripe your customers are assured that no information is stored on your server. – Kyslik Dec 28 '16 at 16:58
  • On the contrary, I don't think saving last4 and expiration is bad practice. When you work with stripe they let you have that data very easily. – Serg Chernata Dec 28 '16 at 20:46
  • Why store them at all when you don't need that information? – Tom Dec 28 '16 at 21:04
  • I Know that i don't need it for creditcard transactions. i just want to save it and to show it to my customer which card thay entered – Dani Banai Dec 29 '16 at 07:47

1 Answers1

1

I don't believe you need it.

If you look at Laravel's Cashier documentation, you just pass a credit card token when creating a new subscription:

$user->newSubscription('main', 'monthly')->create($creditCardToken);

So you don't need the last 4 digits or expiry date, just the token (which you already have).

Tom
  • 1,068
  • 2
  • 25
  • 39
  • 1
    I Know that i don't need it for creditcard transactions. i just what to save it and to show to my customer which card he enter – Dani Banai Dec 29 '16 at 07:45