ข้ามไปยังเนื้อหาหลัก

ShopeePay Jump App

รับชำระเงินผ่านการเปลี่ยนเส้นทางแบบ app-to-app ไปยังแอป ShopeePay บนมือถือเพื่อประสบการณ์การชำระเงินบนมือถือที่ราบรื่น

ภาพรวม

ShopeePay Jump App เป็นวิธีการชำระเงินแบบ app-to-app ที่ใช้ deep link นำลูกค้าจากแอปมือถือหรือเว็บไซต์ของคุณไปยังแอป ShopeePay บนมือถือโดยตรงเพื่อยืนยันการชำระเงิน วิธีนี้ให้ประสบการณ์บนมือถือที่รวดเร็วและเป็นธรรมชาติมากกว่าการสแกน QR code

คุณสมบัติหลัก:

  • การเปลี่ยนเส้นทางแบบ app-to-app - Deep link ไปยังแอป ShopeePay โดยตรง
  • ตัวเลือกการชำระเงินหลากหลาย - Wallet, บัตร, บัญชีธนาคาร, SPayLater
  • 3 ตลาด - ไทย, สิงคโปร์, มาเลเซีย
  • ชำระเงินรวดเร็ว - ประสบการณ์แอปแบบ native
  • ตรวจจับแพลตฟอร์ม - รองรับ iOS และ Android
  • ระยะเวลาคืนเงิน 180 วัน - คืนเงินเต็มจำนวนและบางส่วน
ต้องเปิดใช้งาน

ติดต่อ support@omise.co เพื่อเปิดใช้งาน ShopeePay Jump App สำหรับบัญชีร้านค้าของคุณ

ภูมิภาคที่รองรับ

ภูมิภาคสกุลเงินจำนวนขั้นต่ำจำนวนสูงสุดเวอร์ชัน API
ไทยTHB฿20.00฿150,000.002017-11-02
สิงคโปร์SGD$1.00$20,000.002017-11-02
มาเลเซียMYRRM1.00RM9,999.002017-11-02

ตัวเลือกการชำระเงินตามภูมิภาค

ตัวเลือกการชำระเงินไทยสิงคโปร์มาเลเซีย
ยอดเงินใน Wallet
บัตรเครดิต
หักบัญชีธนาคารโดยตรง
SPayLater (BNPL)

วิธีการทำงาน

ขั้นตอนการชำระเงิน:

  1. ลูกค้าเลือก ShopeePay บนอุปกรณ์มือถือ
  2. ร้านค้าสร้าง source ด้วยประเภท shopeepay_jumpapp
  3. ลูกค้าถูกเปลี่ยนเส้นทางผ่าน deep link
  4. แอป ShopeePay เปิดโดยอัตโนมัติ
  5. ลูกค้าเลือกวิธีการชำระเงิน (wallet, บัตร, SPayLater)
  6. ลูกค้ายืนยันตัวตนและยืนยันการชำระเงิน
  7. ลูกค้ากลับไปที่แอป/เว็บไซต์ของร้านค้า
  8. Webhook ยืนยันสถานะการชำระเงิน

เวลาที่ใช้โดยทั่วไป: 30 วินาที - 2 นาที

การเชื่อมต่อ

ขั้นตอนที่ 1: สร้าง Source

curl https://api.omise.co/sources \
-u $OMISE_PUBLIC_KEY: \
-d "amount=50000" \
-d "currency=THB" \
-d "type=shopeepay_jumpapp" \
-d "platform_type=ANDROID"

ขั้นตอนที่ 2: สร้าง Charge

curl https://api.omise.co/charges \
-u $OMISE_SECRET_KEY: \
-d "amount=50000" \
-d "currency=THB" \
-d "return_uri=https://example.com/payment/complete" \
-d "source=src_test_xxx"

คำขอแบบรวม

สร้าง source และ charge ในคำขอเดียว:

curl https://api.omise.co/charges \
-u $OMISE_SECRET_KEY: \
-d "amount=50000" \
-d "currency=THB" \
-d "return_uri=https://example.com/payment/complete" \
-d "source[type]=shopeepay_jumpapp" \
-d "source[platform_type]=ANDROID"

ขั้นตอนที่ 3: เปลี่ยนเส้นทางลูกค้า

// Detect platform and redirect
function redirectToShopeePay(authorizeUri) {
// The authorize_uri contains the deep link
window.location.href = authorizeUri;
}

// After creating charge
redirectToShopeePay(charge.authorize_uri);

ขั้นตอนที่ 4: จัดการการกลับมา

app.get('/payment/complete', async (req, res) => {
try {
// Get charge status
const chargeId = req.query.charge;
const charge = await omise.charges.retrieve(chargeId);

if (charge.status === 'successful') {
await fulfillOrder(charge.metadata.order_id);
res.redirect('/order-success');
} else if (charge.status === 'failed') {
res.redirect('/payment-failed?error=' + charge.failure_code);
} else {
// Still pending - wait for webhook
res.redirect('/payment-pending');
}
} catch (error) {
res.redirect('/payment-error');
}
});

ขั้นตอนที่ 5: จัดการ Webhook

app.post('/webhooks/omise', (req, res) => {
const event = req.body;

if (event.key === 'charge.complete') {
const charge = event.data;

if (charge.source.type === 'shopeepay_jumpapp') {
if (charge.status === 'successful') {
fulfillOrder(charge.metadata.order_id);
} else if (charge.status === 'failed') {
handleFailedPayment(charge);
}
}
}

res.status(200).send('OK');
});

ตัวอย่างการเชื่อมต่อแบบสมบูรณ์

const express = require('express');
const omise = require('omise')({
secretKey: process.env.OMISE_SECRET_KEY
});

const app = express();
app.use(express.json());

// Checkout endpoint
app.post('/checkout/shopeepay-jumpapp', async (req, res) => {
try {
const { amount, currency, order_id, platform_type } = req.body;

// Validate currency
if (!['THB', 'SGD', 'MYR'].includes(currency)) {
return res.status(400).json({
error: 'Currency not supported. Use THB, SGD, or MYR.'
});
}

// Validate platform
const platform = ['IOS', 'ANDROID'].includes(platform_type)
? platform_type
: 'ANDROID';

// Create source
const source = await omise.sources.create({
type: 'shopeepay_jumpapp',
amount: amount,
currency: currency,
platform_type: platform
});

// Create charge with 20-minute expiry
const charge = await omise.charges.create({
amount: amount,
currency: currency,
source: source.id,
return_uri: `${process.env.BASE_URL}/payment/complete`,
metadata: {
order_id: order_id
}
});

// Return deep link URL
res.json({
authorize_uri: charge.authorize_uri,
charge_id: charge.id,
expires_at: charge.expires_at
});

} catch (error) {
console.error('ShopeePay Jump App error:', error);
res.status(500).json({ error: error.message });
}
});

// Return handler
app.get('/payment/complete', async (req, res) => {
const chargeId = req.query.charge;

try {
const charge = await omise.charges.retrieve(chargeId);

if (charge.status === 'successful') {
res.redirect(`/order-confirmation?order=${charge.metadata.order_id}`);
} else {
res.redirect(`/payment-failed?charge=${chargeId}`);
}
} catch (error) {
res.redirect('/payment-error');
}
});

// Webhook handler
app.post('/webhooks/omise', (req, res) => {
const event = req.body;

if (event.key === 'charge.complete') {
const charge = event.data;

if (charge.source.type === 'shopeepay_jumpapp') {
if (charge.status === 'successful') {
processOrder(charge.metadata.order_id);
sendConfirmationEmail(charge);
} else {
notifyPaymentFailure(charge);
}
}
}

res.sendStatus(200);
});

app.listen(3000);

การเชื่อมต่อกับแอปมือถือ

iOS (Swift)

func openShopeePayJumpApp(authorizeUri: String) {
guard let url = URL(string: authorizeUri) else { return }

UIApplication.shared.open(url, options: [:]) { success in
if !success {
// ShopeePay app not installed - show fallback
self.showAppStorePrompt()
}
}
}

Android (Kotlin)

fun openShopeePayJumpApp(authorizeUri: String) {
val intent = Intent(Intent.ACTION_VIEW, Uri.parse(authorizeUri))

try {
startActivity(intent)
} catch (e: ActivityNotFoundException) {
// ShopeePay app not installed - show fallback
showPlayStorePrompt()
}
}

React Native

import { Linking } from 'react-native';

const openShopeePayJumpApp = async (authorizeUri) => {
try {
const supported = await Linking.canOpenURL(authorizeUri);

if (supported) {
await Linking.openURL(authorizeUri);
} else {
// Fallback to app store
showAppStorePrompt();
}
} catch (error) {
console.error('Failed to open ShopeePay:', error);
}
};

การหมดอายุของ Charge

การหมดอายุ charge เริ่มต้นคือ 20 นาที คุณสามารถปรับแต่งได้สูงสุด 60 นาที:

curl https://api.omise.co/charges \
-u $OMISE_SECRET_KEY: \
-d "amount=50000" \
-d "currency=THB" \
-d "source=src_test_xxx" \
-d "return_uri=https://example.com/complete" \
-d "expires_at=2024-12-31T23:59:59Z"

ค่าสถานะ Charge

สถานะคำอธิบาย
pendingรอการยืนยันจากลูกค้าในแอป ShopeePay
successfulการชำระเงินสำเร็จ
failedการชำระเงินถูกปฏิเสธหรือมีข้อผิดพลาด
expiredลูกค้าไม่ได้ดำเนินการภายในระยะเวลาที่กำหนด

รหัสข้อผิดพลาด

รหัสคำอธิบาย
payment_expiredหมดเวลาการยืนยัน
payment_rejectedShopeePay ปฏิเสธธุรกรรม
insufficient_balanceยอดเงินใน wallet ไม่เพียงพอ
failed_processingข้อผิดพลาดในการประมวลผลทั่วไป

การคืนเงิน

ShopeePay Jump App รองรับการคืนเงินเต็มจำนวนและบางส่วนภายใน 180 วัน:

// Full or partial refund
const refund = await omise.charges.refund('chrg_test_xxx', {
amount: 25000 // Partial refund of THB 250.00
});
ธุรกรรม Off-Us

การคืนเงินและการยกเลิกไม่สามารถทำได้สำหรับธุรกรรม "off-us" (การชำระเงินด้วยบัตรหรือบัญชีธนาคารที่ไม่ได้ผ่าน ShopeePay wallet โดยตรง)

แนวทางปฏิบัติที่ดีที่สุด

  1. ตรวจจับแพลตฟอร์ม - ตรวจจับและส่ง platform_type ที่ถูกต้องเสมอ (IOS/ANDROID)
  2. จัดการกรณีไม่ได้ติดตั้งแอป - มีทางเลือกสำรองหากไม่ได้ติดตั้งแอป ShopeePay
  3. เฉพาะมือถือเท่านั้น - วิธีนี้ต้องใช้อุปกรณ์มือถือที่มีแอป ShopeePay
  4. ตั้งเวลาหมดอายุที่เหมาะสม - ตั้งเวลาหมดอายุให้ตรงกับเซสชันการชำระเงินของคุณ
  5. ให้ความสำคัญกับ Webhook - ใช้ webhook สำหรับการดำเนินการตามคำสั่งซื้อเสมอ

คำถามที่พบบ่อย

ShopeePay Jump App และ ShopeePay QR แตกต่างกันอย่างไร?

ShopeePay Jump App (shopeepay_jumpapp): การเปลี่ยนเส้นทางแบบ app-to-app ที่ใช้ deep link ไปยังแอป ShopeePay บนมือถือโดยตรง เหมาะสำหรับการเชื่อมต่อกับแอปมือถือ

ShopeePay QR (shopeepay): แสดง QR code ให้ลูกค้าสแกนด้วยแอป ShopeePay ใช้ได้ทั้งบนเดสก์ท็อปและมือถือ

ลูกค้าสามารถใช้วิธีการชำระเงินใดได้บ้าง?

ลูกค้าสามารถชำระเงินโดยใช้:

  • ยอดเงินใน ShopeePay Wallet - ทุกภูมิภาค
  • บัตรเครดิต/เดบิต - ไทย, สิงคโปร์
  • หักบัญชีธนาคารโดยตรง - ไทยเท่านั้น
  • SPayLater (BNPL) - ไทย, สิงคโปร์

ตัวเลือกที่มีขึ้นอยู่กับภูมิภาคและการตั้งค่าบัญชีของลูกค้า

SPayLater คืออะไร?

SPayLater คือบริการซื้อก่อนจ่ายทีหลังของ Shopee ที่ช่วยให้ลูกค้าสามารถชำระเงินเป็นงวดได้ มีให้บริการในไทยและสิงคโปร์ ลูกค้าสามารถสมัครวงเงิน SPayLater ผ่านแอป Shopee

จำเป็นต้องระบุประเภทแพลตฟอร์มหรือไม่?

พารามิเตอร์ platform_type (IOS หรือ ANDROID) เป็นตัวเลือกแต่แนะนำให้ใช้ ช่วยปรับ deep link ให้เหมาะสมกับอุปกรณ์ของลูกค้า หากไม่ระบุ ระบบจะพยายามตรวจจับโดยอัตโนมัติ

จะเกิดอะไรขึ้นถ้าลูกค้าไม่ได้ติดตั้งแอป ShopeePay?

หากไม่ได้ติดตั้งแอป ShopeePay deep link จะไม่ทำงาน ให้ใช้ทางเลือกสำรองที่:

  1. ตรวจจับว่าแอปเปิดสำเร็จหรือไม่
  2. เปลี่ยนเส้นทางไปยัง app store หากไม่สำเร็จ
  3. เสนอวิธีการชำระเงินอื่น
ลูกค้ามีเวลานานเท่าไหร่ในการชำระเงินให้เสร็จสิ้น?

โดยค่าเริ่มต้น ลูกค้ามีเวลา 20 นาที ในการชำระเงินให้เสร็จสิ้น คุณสามารถขยายเวลาได้สูงสุด 60 นาที โดยใช้พารามิเตอร์ expires_at เมื่อสร้าง charge

สามารถใช้บนเดสก์ท็อปได้หรือไม่?

ShopeePay Jump App ถูกออกแบบมาสำหรับอุปกรณ์มือถือ สำหรับผู้ใช้เดสก์ท็อป ใช้ ShopeePay QR แทน ซึ่งจะแสดง QR code ให้พวกเขาสแกนด้วยโทรศัพท์

แหล่งข้อมูลที่เกี่ยวข้อง