stripe.js

Load Stripe.js with Require.js

一笑奈何 提交于 2021-02-10 18:00:15
问题 I'm having trouble loading Stripe.js with Require.js. My setup looks a bit like this requirejs.config({ paths: { 'stripe': 'https://js.stripe.com/v3/?noext' }, shim: { 'stripe': { exports: 'stripe' } } }); This actually does work, that is, I can see the script tag in the dom but when I require it it's undefined . Any ideas what could be happening here? 回答1: The global that stripe exports is Stripe with an uppercase "S". The exports needs to match the global export exactly , meaning case. This

How to add card holder's name to Stripe checkout using Elements?

蹲街弑〆低调 提交于 2019-12-31 12:18:12
问题 I need to add an additional field to my custom form, I want to add the name of the credit card. I tried in the following way: var cardNameElement = elements.create('cardName', { style: style //, placeholder: 'Custom card number placeholder', }); cardNameElement.mount('#card-name-element'); <div id="card-name-element" class="field"></div> But this does not work, in its documentation only allows to perform these procedures validating only four elements or data: cardNumber, cardExpiry, cardCvc,

Stripe.js v3 elements requiring double tap to focus (but only on iPad/iPhone)

元气小坏坏 提交于 2019-12-24 03:24:43
问题 I've been working with Bootstrap 4 beta and Stripe.js v3. If you're not familiar with this newer version of Stripe.js, it's basically injecting iframes into spans, and making the spans act as if they are form inputs. I'm not in love with the idea, but it's supposedly more PCI compliant that the older version of Stripe.js (v2). Demo here: https://codepen.io/skunkbad/pen/BdgYmY Reducing the HTML down to what represents my credit card input looks like this: <span id="card-number" class="form

How to integrate Stripe payments gateway with Django Oscar?

旧街凉风 提交于 2019-12-22 08:48:13
问题 I am trying to integrate the Stripe payment gateway to Django oscar for an e-commerce site which sells physical goods like groceries online.I use python 3.6.3, Django 2.0, Django-oscar 1.6, stripe 1.82.2. Method 1 : So I followed this link in django-oscar groups: https://groups.google.com/forum/#!searchin/django-oscar/handle_payment$20override%7Csort:date/django-oscar/Cr8sBI0GBu0/PHRdXX2uFQAJ I have signed up for a stripe account and used my publishable key and test key to configure stripe

Get (localized) payment source registration errors directly from Stripe Elements

假装没事ソ 提交于 2019-12-13 08:12:28
问题 I'm trying to localize error messages occurring during the registration of payment sources and am looking for an easy way out: Is it possible to let stripe do the complete validation of a card directly via the stripe.js api and get a localized error message as a result before I send the token to my server (and then to stripe)? Some errors are caught by the card element, e.g. an incorrect checksum (CC No. 4242424242424241 ) and returned localized by the js library, giving me hope that I have

Using Stripe with Angular 5

两盒软妹~` 提交于 2019-12-07 12:14:51
问题 I have an angular application that uses Stripe to save customer payment card info. I include this script in my index.html <script src="https://js.stripe.com/v3/"></script> this script provides a "Stripe" object that I can use like this: <script> var stripe = Stripe('pk_XXXXXXXXXXX') </script> the question is: How can I access the Stripe object from my angular typescript code? 回答1: Register the type in typings.d.ts declare var Stripe: any; Instantiate a Stripe object from a Service import {

Stripe Custom Checkout With Options

时光怂恿深爱的人放手 提交于 2019-12-06 06:06:46
How can you add a size option to Stripe Custom Checkout? As of right now I have this for using the custom checkout with a script tag. <?php require('config.php'); ?> <form action="charge.php" method="post"> <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="<?php echo $stripe['publishable_key']?>" data-amount="3500" data-locale="auto" data-company="Company Name" data-billingAddress="true" data-email="true"> </script> </form> You cannot. This is because Stripe embeds the checkout inside an iframe element. It does this so that you cannot access the card details

Stripe - create / retrieve customer in one call

混江龙づ霸主 提交于 2019-12-06 05:11:49
Is there a stripe API call that we can use to create a user if they don't exist, and retrieve the new user? say we do this: export const createCustomer = function (email: string) { return stripe.customers.create({email}); }; even if the user with that email already exists, it will always create a new customer id. Is there a method that will create a user only if the user email does not exist in stripe? I just want to avoid a race condition where more than one stripe.customers.create({email}) calls might happen in the same timeframe. For example, we check to see if customer.id exists, and does

How to integrate Stripe payments gateway with Django Oscar?

ε祈祈猫儿з 提交于 2019-12-05 19:25:52
I am trying to integrate the Stripe payment gateway to Django oscar for an e-commerce site which sells physical goods like groceries online.I use python 3.6.3, Django 2.0, Django-oscar 1.6, stripe 1.82.2. Method 1 : So I followed this link in django-oscar groups: https://groups.google.com/forum/#!searchin/django-oscar/handle_payment$20override%7Csort:date/django-oscar/Cr8sBI0GBu0/PHRdXX2uFQAJ I have signed up for a stripe account and used my publishable key and test key to configure stripe.The problem is, when I try to pay using the button provided with label "Pay with Card",it collects my

Using Stripe with Angular 5

戏子无情 提交于 2019-12-05 12:14:50
I have an angular application that uses Stripe to save customer payment card info. I include this script in my index.html <script src="https://js.stripe.com/v3/"></script> this script provides a "Stripe" object that I can use like this: <script> var stripe = Stripe('pk_XXXXXXXXXXX') </script> the question is: How can I access the Stripe object from my angular typescript code? Register the type in typings.d.ts declare var Stripe: any; Instantiate a Stripe object from a Service import { Injectable } from '@angular/core'; @Injectable() export class PaymentService { stripe = Stripe('pk_test_XXXXX'