پی اچ پی

نحوه تایید پرداخت ها

How to Accept Payments

No longer do we require brick and mortar shops to sell our products. Have you written a book? Great! You can set up a webpage to sell it in a matter of minutes. It's that easy at this point, as long as you have a touch of programming knowledge. In this series, we'll review the ins and outs of accepting payments and subscriptions through Stripe.

سطح متوسط 20 جلسه آموزشی 03:15:00 ساعت
01
قسمت 1

Stripe Checkout

In this opening episode, we'll leverage Stripe's Checkout integration to quickly generate a "Pay Now" button to sell our fictional book. Along the way, we'll discuss the basic flow for performing charges through Stripe. It's vital that you understand...

02
قسمت 2

Custom Checkout

You may find that you need more control over the checkout process. In this episode, we'll review the manual approach for loading Stripe's checkout modal.

03
قسمت 3

Integrating Vue 2

As you may know, I'm a huge advocate of the Vue JavaScript framework. In this episode, we'll take the code we wrote in episode two, and transition it over to a custom Vue 2 component.

04
قسمت 4

Dynamically Populating the Checkout Modal

Now that we've transitioned over to Vue, let's figure out how to dynamically populate the checkout modal's price and details, based upon a chosen product from a dropdown menu.

05
قسمت 5

Recurring Subscriptions

So far, we've only attempted single charges. However, in this episode, we'll migrate over to associating customers with recurring subscription plans. It's easy! To start, we'll add two simple plans that mimic Laracasts, itself: monthly and yearly.

06
قسمت 6

Handling Failed Charges

When using Checkout, Stripe will perform a preliminary bit of validation on the provided card number. However, there can and will still be situations when the Customer object is properly created, but the charge fails to go through. It's paramount tha...

07
قسمت 7

Recording the Stripe Customer

When working with Stripe, it's paramount that you store a handful of columns in your database that indicate the user's customer id, their subscription status, and, if canceled, the timestamp for when their subscription-only access should expire.

08
قسمت 8

Refactoring Strategies

In this episode, I'll demonstrate a few refactoring strategies that I often implement in my own projects. To clean up our SubscriptionsController, we might leverage form objects, as well as creating a dedicated Subscription class to manage any intera...

09
قسمت 9

Events and Webhooks

It's paramount that you listen for a number of Stripe-specific events. For example, what if attempts to renew a customer's subscription fails? Though Stripe will attempt this charge a number of times, eventually, the subscription will be canceled. As...

10
قسمت 10

Cleaner Webhook Management

Now that we understand the basics of how to register Stripe web hooks, let's take a few moments to refactor the code to make it more enjoyable to work with and extend. If we're planning on responding to a number of Stripe events in the future, it's v...

11
قسمت 11

Testing Stripe Webhooks

I'm sure you're itching to dig into more of Stripe's main API, however, it's vital that we learn how to write the necessary tests to ensure that all billing code works as expected. You never want to be in a situation, where you deploy code one aftern...

12
قسمت 12

Testing Against Stripe's API

In certain situations, it's paramount that we physically tough Stripe's API to ensure that our code does in fact work as expected. In this episode, let's verify that our Subscription class does make a Stripe customer, associates them with the proper...

13
قسمت 13

A Billable Trait

If we want to maintain our current API, that allows us to call various subscriptions-specific methods off of $user, then we might consider extracting a helpful BillableTrait to clean things up. Let's tackle that very thing in this episode.

14
قسمت 14

Record All Stripe Charges

We should setup a dedicated table to store all incoming Stripe charges. Not only will this provide a fast payments list for the user, but it will also makes reporting and daily summaries easier to prepare.

15
قسمت 15

Cancel Subscriptions With Tests

It would be a pretty shabby service, if we didn't offer users the ability to cancel their subscriptions. In this episode, we'll write that very logic, while also preparing a test to ensure that everything works as we expect.

16
قسمت 16

Apply Coupon Codes

It's likely that your website will at some point offer coupon codes to new subscribers. Luckily, once again, Stripe makes this all a cinch. Let's review the basic flow - including the tests to ensure that it all works properly - in this episode. Vie...

17
قسمت 17

Testing for Grace Periods

We need to offer users the ability to resume recently canceled subscriptions. But before we get to that point, we must first learn how to determine if a user is currently on their grace period. Let's tackle that in this episode!

18
قسمت 18

Resuming Subscriptions

In this episode, we'll update our API to allow users to resume their subscriptions. This will require that we add a resume method to the Subscription class. Stay tuned to the end for a bit of homework as well.

19
قسمت 19

Clarity and Rendering Subscription-Only Content

In this video, we'll take a few moments to discuss clarity, double-negatives, and the potential they have to introduce bugs. Then, we'll setup a template for rendering subscription-only content, while providing the necessary call-to-action for guests...

20
قسمت 20

How to Reduce Conditionals in Your Views

In the previous episode, we constructed multiple conditionals to determine which set of HTML should be displayed. For our basic example, the outcome was simple enough. However, for real-life projects, you may find that this quickly bloats your views...

دوره در حال اجرا

این دوره هنوز به پایان نرسیده است و در آینده درس های دیگری به آن افزوده خواهد شد.