stripe-payments

How to create a stripe charge with a checkout token sent via AJAX to php

最后都变了- 提交于 2020-01-21 01:39:09
问题 I'm trying to use Stripe's new checkout feature with a custom button, send the token via AJAX POST to a php file which will then execute the charge. Unfortunately, I'm having some trouble retrieving the token from the POST variable. I'm hoping someone here might be able to tell me what I'm overcomplicating and if there's a simpler way to do this. On the client-side, I've got 5 buttons with different possible "donations". Here's the js written up for that so far (doesn't include the html): $

How do I save Apple Pay transaction on a customer?

折月煮酒 提交于 2020-01-17 13:48:12
问题 I implemented Apple Pay into my app and it works fine, but currently when I use apple pay the transaction isn't linked to a user, when I add a customer/user parameter on my cloud code I get this error. error: type: "invalid_request_error" message: "Customer cus_xxx does not have a linked card with ID tok_xxxx." param: "card" code: "missing" Parse.Cloud.define("chargeApplePay", function(request, response){ Stripe.Charges.create({ amount: 100 * 100, currency: "usd", customer: request.params

How do I save Apple Pay transaction on a customer?

两盒软妹~` 提交于 2020-01-17 13:47:06
问题 I implemented Apple Pay into my app and it works fine, but currently when I use apple pay the transaction isn't linked to a user, when I add a customer/user parameter on my cloud code I get this error. error: type: "invalid_request_error" message: "Customer cus_xxx does not have a linked card with ID tok_xxxx." param: "card" code: "missing" Parse.Cloud.define("chargeApplePay", function(request, response){ Stripe.Charges.create({ amount: 100 * 100, currency: "usd", customer: request.params

Calculating Sales Tax for a US State in Javascript

为君一笑 提交于 2020-01-16 19:08:08
问题 So I'm trying to calculate sales tax for a project and I can't get it to work. Needless to say, I'm still learning javascript. Here's how it works: If the buyer selects New Jersey, I want to apply a 7% sales tax to the order. Everywhere else goes to zero. Here's a link to the jsFiddle project: https://jsfiddle.net/JohnOHFS/hpdnmjfL/ Here's my basic form HTML (skipping the opening and closing tags, etc.) <div id="public"> <div class="row"> <div class="col-xs-7 col-md-7"> <div class="form-group

Pass CVC to stripe.createPaymentMethod JS?

倾然丶 夕夏残阳落幕 提交于 2020-01-16 08:59:20
问题 I need a separate input for CVC and Expiry, so I have created 3 Stripe Elements: let elements = stripe.elements(); let cardNumber = elements.create('cardNumber'); cardNumber.mount('#card-number'); let cardExpiry = elements.create('cardExpiry'); cardExpiry.mount('#card-expiry'); let cardCvc = elements.create('cardCvc'); cardCvc.mount('#card-cvc'); ... Stripe Docs only mention about how to pass card or cardNumber Element to PaymentMethod, but how do I pass cardExpiry and cardCvc ? function

how to solve the error Unsupported Gateway Type for Storage in whmcs using stripe?

爷,独闯天下 提交于 2020-01-16 08:33:59
问题 I want to save the credit card details for future use and i want to save the data in whmcs database credit card last 4 digit or card_data in blobformat. I am using stripe payment gateway and whmcs. <?php $command = 'AddPayMethod';//save the data in api format $postData = array( 'clientid' => $ca->getUserID(),//client id 'type' => 'CreditCard', //credit card type 'description' => 'Mohit - check',//account holder name 'card_number' => '4640823519584356',//credit card number 'card_expiry' =>

How can I disable stripe button from the beginning and enable it after checked the agreement?

两盒软妹~` 提交于 2020-01-16 04:58:11
问题 I want to disable the stripe checkout button from the beginning. Then when one will checked the agreement checkbox, it will be enabled. If he undo his checked, it will be disabled again. How can I do this? <script src="https://checkout.stripe.com/checkout.js" class="stripe-button" data-key="pk_test_6pRNASCoBOKtIshFeQd4XMUh" data-amount="2000" data-name="Stripe.com" data-description="2 widgets" data-image="/img/documentation/checkout/marketplace.png" data-locale="auto"> </script> My code is

Stripe API JSON returns null

陌路散爱 提交于 2020-01-16 04:25:09
问题 Using the Stripe API in PHP all attempts to pull a value off of it is returning null, r not displaying a result at all. I've tried $customers = \Stripe\Customer::all(); $customers_json = $customers->__toJSON(); json_decode($customers_json); echo $customers_json->data->id; and also $customers = \Stripe\Customer::all(); $customer = $customers->__toArray(true); echo $customer["data"]["id"]; but each time both result in a blank echo. However, when I just output the original variable without

Passing Stripe tokens to server and handling on server

跟風遠走 提交于 2020-01-16 04:20:25
问题 I am merely trying to get the test working and cannot seem to do it any help would be greatly appreciated. I keep getting a stripe invalid request error. I tried multiple things but can not get it to work. android code: private void deposit() throws AuthenticationException { //bp.purchase("android.test.purchased"); //bp.consumePurchase("android.test.purchased"); Card card = new Card("4242-4242-4242-4242", 12, 2016, "123"); if ( !card.validateCard() ) { // Show errors Toast.makeText

Stripe Checkout PHP API getting 500 Internal Server Error

柔情痞子 提交于 2020-01-15 11:15:13
问题 Here is my situation, i'm implementing Custom Stripe Checkout with Stripe PHP Api. I have requested a post Method using jquery like this one > var handler = StripeCheckout.configure({ key: 'pk_test_yGQM97VuEUdttuOOFQcyaPHW', image: 'https://stripe.com/img/documentation/checkout/marketplace.png', locale: 'auto', token: function (token) { // You can access the token ID with `token.id`. // Get the token ID to your server-side code for use. $.post( 'charge.php', { sT: token.id, sE: token.email },