Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ** Client Side **
- stripe.createSource(card).then(function(result) {
- if (result.error) {
- formIsPending = false;
- // Inform the user if there was an error
- var errorElement = document.getElementById('card-errors');
- errorElement.textContent = result.error.message;
- } else {
- // Send the source to your server
- stripeSourceHandler(result.source);
- }
- });
- ** Server Side **
- $cardSource = \Stripe\Source::retrieve($stripeSource);
- if (in_array($cardSource->card->three_d_secure, ['required', 'recommended', 'optional'])) {
- $success = $this->_process3DSecure($cardSource);
- } else {
- $success = $this->_processNormal($cardSource);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement