Basics of Integrating Stripe with PHP | Accept Credit Card Payments on Your PHP Site

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2023
  • I’d like to share how I use Stripe to process credit card payments for restaurant pick-up orders. After the customers select their items, I send them to Stripe's payment page to finish checkout. After they complete their payment, Stripe sends them back to my site to confirm the order. In this video, we'll focus on the integration points and not worry about how the shopping cart works or any of the user interfaces. We’ll see how little PHP code it takes to integrate with Stripe as a payment processor.
    Demo Code
    github.com/johnnycode8/basic-...
    Stripe SDK
    stripe.com/docs/development/q...
    Stripe API Documentation (Line Items)
    stripe.com/docs/api/checkout/...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 10

  • @tianadede349
    @tianadede349 9 หลายเดือนก่อน

    thanks bro

  • @stront
    @stront ปีที่แล้ว +1

    Just what I've been looking for. First tutorial that actually works for me. Only thing I can't seem to get to work is retrieving the customers information so I can display it or import it into my database. Any chance you've got code for that that works with the demo code you provided? Or maybe a tutorial? Cheers.

    • @johnnycode
      @johnnycode  ปีที่แล้ว

      I don't save customer info so I don't have code for that. Before you can retrieve a customer, you have to first create the customer in Stripe. It sounds like you didn't create the customers in Stripe first?

  • @rust_soldier
    @rust_soldier ปีที่แล้ว

    Fatal error: Uncaught (Status 400) (Request req_dRL7O7hJBqtmJF) Invalid array thrown in

  • @kannyiriabdulai8776
    @kannyiriabdulai8776 ปีที่แล้ว

    👍

  • @Hamster2wire
    @Hamster2wire 8 วันที่ผ่านมา

    Hi, may I know how to get lineItems data from cart page?

    • @johnnycode
      @johnnycode  8 วันที่ผ่านมา

      lineItems data is an array that you construct and store in the user's session when your customer adds an item to cart. This is something you do in PHP and is not relevant to Stripe; you just have to create the array in the format shown in the video. Look into how to do a basic PHP shopping cart.

  • @KalmanWebDesign
    @KalmanWebDesign 7 หลายเดือนก่อน

    So how would you change the quantities when a customer changes them on the product?

    • @johnnycode
      @johnnycode  7 หลายเดือนก่อน +1

      From your front end UI, when the customer changes the item quantity and clicks a submit button, then your backend PHP code would know the quantity required. Alternatively, you could use something like jquery.post() to send the quantity to the backend PHP when the customer triggers a onChange() event on the quantity input box.

    • @KalmanWebDesign
      @KalmanWebDesign 7 หลายเดือนก่อน +1

      Thanks!@@johnnycode