การใช้ Stripe Connect สำหรับแพลตฟอร์ม
สร้างตลาดกลางหรือแพลตฟอร์มที่อำนวยความสะดวกด้านการชำระเงินระหว่างหลายฝ่ายด้วย Stripe Connect พร้อมจัดการการจ่ายเงินและค่าธรรมเนียม
การใช้ Stripe Connect สำหรับแพลตฟอร์ม เป็นบทเรียน Stripe Payments & SaaS Billing Systems ฟรีบน CoddyKit นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Stripe Payments & SaaS Billing Systems และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Stripe Payments & SaaS Billing Systems มีบทเรียนทั้งหมด 4 บทเรียน
บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ
What is Stripe Connect?
Stripe Connect is a powerful solution for platforms and marketplaces. It allows you to facilitate payments between buyers and sellers, manage payouts, and handle the financial complexity of multi-party transactions.
Think of platforms like Shopify, DoorDash, or Etsy. They all use Connect (or similar solutions) to manage payments for their merchants or service providers.
Powering Your Platform
Connect simplifies many challenges for platforms:
- Onboarding: Easily register sellers/service providers.
- Payment Processing: Collect payments from customers on behalf of others.
- Payouts: Distribute funds to your connected accounts.
- Compliance: Stripe handles many regulatory and PCI DSS requirements for you.
Connect Account Types
Stripe Connect offers three main account types to fit different platform needs:
- Standard: For platforms needing minimal involvement in connected accounts.
- Express: For platforms that want more control over the user experience.
- Custom: For platforms that need full control and customization.
Each type offers a different balance of control and responsibility.
The Simple Standard Account
Standard accounts are the simplest. Your connected accounts have their own full Stripe accounts and dashboards.
The platform directs users to Stripe to complete their onboarding. Stripe handles their compliance, support, and direct communication.
You direct payments to them and can take an application fee.
Creating a Standard Account Link
To onboard a Standard account, you create an AccountLink. This generates a URL that your user visits to complete their Stripe account setup. Here's how you'd initiate that on your backend:
import com.stripe.Stripe;
import com.stripe.model.AccountLink;
import com.stripe.param.AccountLinkCreateParams;
public class Main {
public static void main(String[] args) {
// In a real application, set your secret key securely.
// Stripe.apiKey = "sk_test_YOUR_SECRET_KEY";
// Simulate creating a new account first (usually done via Account.create)
String connectedAccountId = "acct_example_standard"; // Placeholder ID
AccountLinkCreateParams params = AccountLinkCreateParams.builder()
.setAccount(connectedAccountId)
.setRefreshUrl("https://your-platform.com/reauth")
.setReturnUrl("https://your-platform.com/return")
.setType(AccountLinkCreateParams.Type.ACCOUNT_ONBOARDING)
.build();
// In a live environment, you'd call:
// AccountLink accountLink = AccountLink.create(params);
// System.out.println("Generated Account Link URL: " + accountLink.getUrl());
System.out.println("Simulated Account Link Creation for ID: " + connectedAccountId);
System.out.println("Users would be redirected to Stripe to complete setup.");
System.out.println("A real link would look like: https://connect.stripe.com/setup/acct_... ");
}
}Payments to Connected Accounts
When a customer pays on your platform, you collect the payment and then transfer the appropriate amount to the connected account. Stripe Connect offers different charge types for this:
- Direct Charges: The customer's payment goes directly to the connected account, and you take a fee.
- Destination Charges: The payment is made to your platform account, and then a portion is transferred to the connected account.
We'll focus on Destination Charges as they give platforms more control over funds.
Processing a Destination Charge
With a destination charge, you create a PaymentIntent on your platform's account and specify the transfer_data to indicate which connected account receives the funds.
The amount in transfer_data is what the connected account receives.
import com.stripe.Stripe;
import com.stripe.model.PaymentIntent;
import com.stripe.param.PaymentIntentCreateParams;
public class Main {
public static void main(String[] args) {
// Stripe.apiKey = "sk_test_YOUR_SECRET_KEY"; // Your platform's secret key
String customerId = "cus_example"; // A customer on your platform
String connectedAccountId = "acct_example_standard"; // The seller's account
PaymentIntentCreateParams params = PaymentIntentCreateParams.builder()
.setCurrency("usd")
.setAmount(2000L) // Total amount: $20.00
.addPaymentMethodType("card")
.setCustomer(customerId)
.setTransferData(
PaymentIntentCreateParams.TransferData.builder()
.setDestination(connectedAccountId)
.setAmount(1800L) // $18.00 goes to the connected account
.build()
)
.build();
// In a live environment, you'd call:
// PaymentIntent paymentIntent = PaymentIntent.create(params);
// System.out.println("PaymentIntent created: " + paymentIntent.getId());
System.out.println("Simulated PaymentIntent for $20.00.");
System.out.println(" $18.00 would be transferred to connected account: " + connectedAccountId);
System.out.println(" Your platform retains $2.00 as an application fee.");
}
}Earning Your Platform Fee
In the previous example, your platform automatically retained the difference between the PaymentIntent amount ($20.00) and the transfer_data.amount ($18.00). This difference ($2.00) is your application fee.
Stripe handles the splitting of funds automatically. This simplifies your accounting and ensures your platform earns its share with each transaction.
Initiating Programmatic Payouts
While Standard accounts can manage their own payouts, you might need to initiate a payout programmatically (e.g., for specific platform rules or refunds). You can create a Transfer object to send funds from your platform to a connected account.
import com.stripe.Stripe;
import com.stripe.model.Transfer;
import com.stripe.param.TransferCreateParams;
public class Main {
public static void main(String[] args) {
// Stripe.apiKey = "sk_test_YOUR_SECRET_KEY"; // Your platform's secret key
String connectedAccountId = "acct_example_standard"; // The recipient account
TransferCreateParams params = TransferCreateParams.builder()
.setAmount(5000L) // Amount to transfer: $50.00
.setCurrency("usd")
.setDestination(connectedAccountId)
.build();
// In a live environment, you'd call:
// Transfer transfer = Transfer.create(params);
// System.out.println("Transfer created: " + transfer.getId());
System.out.println("Simulated Transfer for $50.00 to account: " + connectedAccountId);
System.out.println("This moves funds from your platform to the connected account.");
}
}Choose the Connect Type
Which Stripe Connect account type offers the most direct control for the platform over the user's experience and onboarding flow, requiring the platform to manage more compliance?
Connect Powering Platforms
In this lesson, we explored Stripe Connect, a vital tool for building multi-party platforms and marketplaces.
You learned about the different Connect account types (Standard, Express, Custom), with a focus on Standard accounts. We covered how to onboard connected accounts using AccountLink, collect payments via destination charges, and manage your platform's application fees.
Connect handles much of the complexity, allowing you to focus on your platform's core features!
เรียนรู้ Stripe Payments & SaaS Billing Systems ด้วย AI tutor — ฟรี
เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป
- คอร์ส
- 12
- บทเรียน
- 48
คำถามที่พบบ่อย
บทเรียน “การใช้ Stripe Connect สำหรับแพลตฟอร์ม” ฟรีหรือไม่
ใช่ — ข้อความเต็มของ “การใช้ Stripe Connect สำหรับแพลตฟอร์ม” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Stripe Payments & SaaS Billing Systems ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Stripe Payments & SaaS Billing Systems มีบทเรียนทั้งหมด 4 บทเรียน
คุณจะเรียนรู้อะไรในบทเรียน “การใช้ Stripe Connect สำหรับแพลตฟอร์ม”
สร้างตลาดกลางหรือแพลตฟอร์มที่อำนวยความสะดวกด้านการชำระเงินระหว่างหลายฝ่ายด้วย Stripe Connect พร้อมจัดการการจ่ายเงินและค่าธรรมเนียม คุณปฏิบัติ Stripe Payments & SaaS Billing Systems ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน
คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Stripe Payments & SaaS Billing Systems หรือไม่
ไม่จำเป็นต้องมีประสบการณ์มาก่อน Stripe Payments & SaaS Billing Systems บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 2 จากทั้งหมด 4 บทเรียน
บทเรียน “การใช้ Stripe Connect สำหรับแพลตฟอร์ม” ใช้เวลานานแค่ไหน
บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย
ฉันเขียนและรันโค้ดในบทเรียน Stripe Payments & SaaS Billing Systems นี้ได้ไหม
ได้ บทเรียน Stripe Payments & SaaS Billing Systems ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ
บทเรียนทั้งหมดในหลักสูตรนี้
- การผสานรวมกับระบบ CRM และ ERP
- การใช้ Stripe Connect สำหรับแพลตฟอร์ม
- การสำรวจการผสานรวมและปลั๊กอินจากบุคคลที่สาม
- การซิงโครไนซ์ข้อมูล Stripe ไปยังคลังข้อมูล