Code Monkey home page Code Monkey logo

checkout-one-time-payments's People

Contributors

adreyfus-stripe avatar agnoski avatar cecilphillip avatar cecilphillip-stripe avatar ch-stripe avatar charliegerard-stripe avatar cjavilla-stripe avatar ctrudeau-stripe avatar dangerousfish avatar dawn-stripe avatar deardaniel avatar dependabot[bot] avatar filipbarak avatar ghobs-stripe avatar github-actions[bot] avatar hibariya avatar hideokamoto-stripe avatar jlh-stripe avatar jofftiquez avatar karlr-stripe avatar kenlog avatar kevinpeters-stripe avatar matthewling-stripe avatar paulasjes-stripe avatar peterjclaw avatar safouh94 avatar thorsten-stripe avatar vcheung-stripe avatar yaw-stripe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

checkout-one-time-payments's Issues

no such sku when called redirectToCheckout

I want integrate with Stripe Checkout Client in my asp.net application.
Before I integrate, I am testing sample check-out-onetime-payment project in GitHub.
I also already created stripe account.
I want to test with test mode Public Key and Secret Key first before I go live.
So, I tested sample check-out-onetime-payment project in GitHub using my test mode Public Key and Secret Key.
But, I got Integration Error : No such SKU when called redirectToCheckout.
Mean, cannot test with test mode Public Key and Secret Key?
Please give me any other suggestion.
Thanks a lot.

Payment method

Bug report Payment method

Describe the bug checkout payment method on online shopping

A clear and concise description of what the bug is. I need a payment method bypass so i can get what I ordered for free

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to https://www.walmart.com/checkout/review-order?cartId=89a6dbfa-bcc2-494d-9d00-b9d1614a4c23
  2. Click on checkout
  3. Scroll down to place order
  4. See error complete the process

Expected behavior

A clear and concise description of what you expected to happen.image

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [IOS]
  • Browser (safari) [e.g. chrome, safari]
  • Server environment [e.g. Go, Java, Node, PHP, Python, Ruby, TypeScript]

Additional context

Add any other context about the problem here.

Demo broken

I followed the instructions in the README but when I click on the "Buy for $9.99" button, it changes to "Loading..." and never returns. the app just hangs and on the console I see only:

./src/components/Checkout.js
Line 61:5: Duplicate key 'price' no-dupe-keys

I'm attempting my first Stripe integration but so far not looking very good. this is dead on arrival

remove indirection for createCheckoutSession function

In the client-side script.js file there's a createCheckoutSession function that uses fetch() to hit the /create-checkout-session endpoint and return the JSON it gets. There are two huge problems with this function: A) it exists; it's only used once in one place, forcing me to jump from one place to another in the code to follow the code path, which needlessly complicates the code and makes it more difficult to follow rather than having the content of this function inline, making things nice and linear and easier to understand, and B) it doesn't handle JSON parsing errors at all, so things just fall off a cliff with the aforementioned cryptic JSON parse error if everything doesn't work perfectly.

T1First

Bug report

Describe the bug

1sun
A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Server environment [e.g. Go, Java, Node, PHP, Python, Ruby, TypeScript]

Additional context

Add any other context about the problem here.

404 for translations file

loadPath: "/locales/{{lng}}.json",

The {{lng}} parameter is e.g. en-US, so the file requested is en-US.json, while the file available is en.json, so it causes a 404 but then fetches the correct file via the fallback.

Ideal fix is to apply a similar fix to the one done here:
7045bf1

Alternatively, add a whitelist parameter to line 9 which will make this automatically fallback without the 404.

403 (FORBIDDEN) /create-checkout-session on python test server

Bug report

When the Buy button is pressed...
image

I get POST http://127.0.0.1:4242/create-checkout-session 403 (FORBIDDEN) error...

image

Describe the bug

Following the instructions in README file, I managed to run the python test server. All steps, including creating an account, getting test keys, etc are completed.

System information

  • macOS
  • chrome
  • Server environment Python

Cancel can be send multiple times

On my integration of the Stripe checkout it seems to be possible to send the cancel request multiple times by clicking repeatly on the button.

This leads to errors when the payment token is invalidated after use.

Safari On iOS 12.4.8

Bug report

The price cannot be shown

Describe the bug

There is no price value and you cannot checkout
A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

Checkout
A clear and concise description of what you expected to happen.

Screenshots

https://drive.google.com/file/d/1OqnHijGq9jzwrOUk0fbSEu6e17Opjk6i/view?usp=sharing

If applicable, add screenshots to help explain your problem.

System information

iOS 12.4.8 with Safari

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
    Safari
  • Server environment [e.g. Go, Java, Node, PHP, Python, Ruby, TypeScript]
    Node 14

Additional context

Add any other context about the problem here.

Uncaught (in promise) SyntaxError: Unexpected token < in JSON

Hello, thank you for the project.
I am using client and server / PHP and I have the following bug when clicking on 1st page button so there is no redirection to checkout page
Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
Promise.then (async)
(anonymous) @ script.js:115

client-only/client

Please only file issues here that you believe represent actual bugs or feature requests for this sample.

If you're having general trouble with your Stripe integration, please reach out to support using the form at https://support.stripe.com/ (preferred) or via email to [email protected].

If you are reporting a bug, please include the server language you're using, as well as any other details that may be helpful in reproducing the problem.

Name missing from the returned JSON

Bug report

Describe the bug

Returned JSON does not include the name/ title of the purchase. In the example "Pacha Photo"

Additional context

Add any other context about the problem here.

Put a line break in the .env file on line 14 before the second comment?

Small "fix" that hopefully with save someone time in the end

.env.example
# DOMAIN="http://localhost:3000" # When using the React client

Can we make this two lines?

I lost some work time because of this and I just don't want it to happen to someone else :)
Essentially, I uncommented this line, and commented the one on top, because I'm using react. Intellisense was still showing the same-line comment as commented out, but when we use dotenv to grab that line, it picks up the the url + comment at the end of the line and sends them to the server as 1 string.

Stripe-Checkout Unable to execute

Bug report

Describe the bug

Stripe-Checkout Unable to execute

To Reproduce

Session session = Session.create(createParams);

Stripe return msg: java.lang.IllegalArgumentException: Refusing to create type reflection-based type adapter for external class: com.google.gson.JsonObject

System information

  • OS: [Windows]
  • Browser (if applies) [chrome]
  • Server environment [Java]

PAYMENT_METHODS environment variable not used

When creating a Checkout Session, we should use this environment variable to pass the list of supported payment method types.

  1. Rename the variable to PAYMENT_METHOD_TYPES
  2. Update the servers to retrieve that environment variable, split on comma, trim whitespace, and pass that as a list of strings into the payment_method_types argument.

React demo code sandbox doesn't work

Bug report

Describe the bug

crashes returns Invalid Host header
A clear and concise description of what the bug is.

To Reproduce

click the react demo link
Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Server environment [e.g. Go, Java, Node, PHP, Python, Ruby, TypeScript]

Additional context

Add any other context about the problem here.

Permission for config.ini on server

Hi,
Everything is working perfect , I want to upload my website to live server , what permission should I assign to config.ini .

Permission means 644 or what

inconsistent use of locale

We should either remove all localization from the sample, or make sure the locale is passed when creating the checkout session in all servers.

Minor typo in README.md

Bug report

There is an additional word in the typo where it shouldn't be.

Describe the bug

ln 97:
STATIC_DIR` tells the server where to the client files are located and does not need to be modified unless you move the server files.

Should be:
STATIC_DIR tells the server where the client files are located and does not need to be modified unless you move the server files.

To Reproduce

https://github.com/stripe-samples/checkout-one-time-payments/pull/503/files

Expected behavior

Correct the typo.

Additional context

PR Submitted to resolve:
#503

var basicPhotoButton = document.getElementById('basic-photo-button');

This Var: var basicPhotoButton = document.getElementById('basic-photo-button');
not in the HTML file.
Can I use this project to list more than one item per page? How can we achieve this? ADD more price vars in .env and edit the script.js in client update server.js in server to retrieve the price

Errors running application.

ran the sample using npm start. Getting the Error: No such plan: 'price_12345' error. Am I missing some configuration step?
On the localhost:4242 url in browser, I am getting ```
Uncaught ReferenceError: config is not defined
at HTMLButtonElement.updateQuantity (script.js:40)


> [email protected] start C:\temp\checkout-one-time-payments\client-and-server\server\node
> node server.js

Node server listening on port 4242!
(node:8740) UnhandledPromiseRejectionWarning: Error: No such plan: 'price_12345'
    at Function.generate (C:\temp\checkout-one-time-payments\client-and-server\server\node\node_modules\stripe\lib\Error.js:39:16)
    at IncomingMessage.<anonymous> (C:\temp\checkout-one-time-payments\client-and-server\server\node\node_modules\stripe\lib\StripeResource.js:190:33)
    at Object.onceWrapper (events.js:417:28)
    at IncomingMessage.emit (events.js:323:22)
    at endReadableNT (_stream_readable.js:1204:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:8740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:8740) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:8740) UnhandledPromiseRejectionWarning: Error: No such plan: 'price_12345'
    at Function.generate (C:\temp\checkout-one-time-payments\client-and-server\server\node\node_modules\stripe\lib\Error.js:39:16)
    at IncomingMessage.<anonymous> (C:\temp\checkout-one-time-payments\client-and-server\server\node\node_modules\stripe\lib\StripeResource.js:190:33)
    at Object.onceWrapper (events.js:417:28)
    at IncomingMessage.emit (events.js:323:22)
    at endReadableNT (_stream_readable.js:1204:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
(node:8740) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Support community?

is there a Discord group, Telegram or IRC channel, or any other kind of place where developers struggling with Stripe congregate to help each other?

if not, could you guys create one and publish its existence for the sake of those of us struggling?

Incrementing button for quantity-based UI form not working with demo javascript

Hi,

When incrementing using front end code provided by the sample demo in the repository (using both client and server code), I experience this error:

Annotation 2020-01-06 152645

And it points to this part of the code (pictured below)
Annotation 2020-01-06 152744

You'll notice the document object ID is different than what's in the sample, this was just me changing it on the front end and the JS to see if I could gain control over what was wrong.

What can I do or should I do differently to avoid this?

Confusion on doc about Apple Pay & Google Pay using Checkout

Thanks to the pre-built example which is really nice! But I have a confusion about the Apply Pay & Google Pay document for Stripe Checkout (the pre-built Stripe hosted page).

On the doc https://stripe.com/docs/apple-pay?platform=web#accept it says You can start accepting Apple Pay payments on the Web using Checkout or Elements. No additional configuration is required to use Apple Pay in Checkout. It directs me to the example code to the Payment Request Button if using Element.

But I don't see any example code that uses pre-built Checkout with Apple pay or Google Pay. I am confused about how to implement Apple Pay and Google Pay just with pre-built Checkout?

I tried with https://checkout.stripe.dev/preview to explore the Checkout, and on the 3rd step there is a button with Apply Pay, but nothing is there and still no clue how to implement it.

I found there is an issue stripe-samples/accept-a-payment#1 stating Unfortunately, all of the payment request demos have so many restrictions around https and having cards setup in chrome / google pay settings that it'll be hard for anyone to test locally. Is this the reason why there is no sample code for apply pay?

Thanks! Any help is really appreciated!

Displaying Checkout page in Iframe instead of redirection ?

Good Morning,

First of all, i really appreciate the hard work done in the repo.

I have successfully integrated Stripe Checkout with one of the projects i am working on,

but I have a small inquiry, is it possible to show the Checkout page in an iframe instead of redirecting the user to the stripe domain ?

I want to let the user feels that he is still on my website instead of multiple redirections

Thanks in advance

Client only but with prices inline HELP

Hi I want to use client only integration but I want to use a PRODUCT_ID rather than PRICE_ID
The reason being is I am charging shipping, so the product is shipping, but the price varies depending on region. So I want to be able to send the PRDUCT_ID with a custom Price derived from my form. AKA inline Price. How would I go about modifying the script to enable this.

`
var PRICE_ID = "price_1234";

  if (PUBLISHABLE_KEY === "pk_1234") {
    console.log(
      "Replace the hardcoded publishable key with your own publishable key: https://dashboard.stripe.com/test/apikeys"
    );
  }

  if (PRICE_ID === "price_1234") {
    console.log(
      "Replace the hardcoded SKU ID with your own SKU: https://stripe.com/docs/api/skus"
    );
  }

`

cp: cannot create regular file 'client-and-server/server/node/.env': No such file or directory

Bug report

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Server environment [e.g. Go, Java, Node, PHP, Python, Ruby, TypeScript]

Additional context

Add any other context about the problem here.

A function has been defined twice

In client-and-server/client/script.js, a function called handleResult has been defined twice in line 70 and 96. Which would be prone to inconsistency.

/* Handle any errors returns from Checkout  */
var handleResult = function(result) {
  if (result.error) {
    var displayError = document.getElementById("error-message");
    displayError.textContent = result.error.message;
  }
};

// Create a Checkout Session with the selected quantity
var createCheckoutSession = function(stripe) {
  var inputEl = document.getElementById("quantity-input");
  var quantity = parseInt(inputEl.value);

  return fetch("/create-checkout-session", {
    method: "POST",
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      quantity: quantity
    })
  }).then(function(result) {
    return result.json();
  });
};

// Handle any errors returned from Checkout
var handleResult = function(result) {
  if (result.error) {
    var displayError = document.getElementById("error-message");
    displayError.textContent = result.error.message;
  }
};

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.