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

จำลองความล้มเหลวและสถานการณ์ข้อผิดพลาด

คำแนะนำที่ครอบคลุมสำหรับการทดสอบสถานการณ์ข้อผิดพลาด, โหมดความล้มเหลว และกรณีพิเศษในการผสานรวม Omise ของคุณ เรียนรู้วิธีจำลองความล้มเหลวของเครือข่าย, การปฏิเสธการชำระเงิน, ข้อผิดพลาด API และการใช้ลอจิกการลองใหม่ที่เหมาะสม

ภาพรวม

การทดสอบสถานการณ์ความล้มเหลวเป็นสิ่งสำคัญสำหรับการสร้างการผสานรวมการชำระเงินที่แข็งแกร่ง แอปพลิเคชันของคุณต้องจัดการข้อผิดพลาดอย่างสวยงาม, ให้ข้อมูลป้อนกลับที่ชัดเจนแก่ผู้ใช้ และใช้ลอจิกการลองใหม่ที่เหมาะสม คำแนะนำนี้ครอบคลุมสถานการณ์ความล้มเหลวทั้งหมดที่คุณควรทดสอบก่อนไปใช้งานจริง

เหตุใดจึงต้องทดสอบความล้มเหลว

  • ประสบการณ์ผู้ใช้: ให้ข้อความแสดงข้อผิดพลาดที่ชัดเจนและเป็นประโยชน์
  • ความสมบูรณ์ของข้อมูล: ป้องกันประจำเงินที่ซ้ำกันและการเสียหายของข้อมูล
  • ความน่าเชื่อถือของระบบ: จัดการปัญหาเครือข่ายและการหมดเวลาอย่างสง่างาม
  • ความปลอดภัย: ตรวจจับและป้องกันธุรกรรมปลอมปลน
  • ความปฏิบัติตาม: ปฏิบัติตามข้อกำหนดของอุตสาหกรรมการชำระเงิน
  • ความต่อเนื่องทางธุรกิจ: รักษาการดำเนินการระหว่างการหยุดชั่วคราว

ประเภทของความล้มเหลวที่ต้องทดสอบ

  1. การปฏิเสธการชำระเงิน: การปฏิเสธบัตร, เงินไม่เพียงพอ, การตรวจจับปลอมปลน
  2. ความล้มเหลวของเครือข่าย: ข้อผิดพลาดการเชื่อมต่อ, การหมดเวลา, ความล้มเหลว DNS
  3. ข้อผิดพลาด API: คำขอไม่ถูกต้อง, ข้อผิดพลาดการตรวจสอบสิทธิ์, ขีดจำกัดอัตรา
  4. ความล้มเหลว 3D Secure: ล้มเหลวการตรวจสอบสิทธิ์, การหมดเวลา, ยกเลิก
  5. ความล้มเหลวของเวบฮุก: ความล้มเหลวในการจัดส่ง, ข้อผิดพลาดการตรวจสอบลายเซ็น
  6. ข้อผิดพลาดระบบ: ข้อผิดพลาดของเซิร์ฟเวอร์, ความล้มเหลวของฐานข้อมูล, ปัญหาการผสานรวม

สถานการณ์การปฏิเสธการชำระเงิน

การทดสอบเหตุผลการปฏิเสธเฉพาะ

ใช้บัตรทดสอบเหล่านี้เพื่อจำลองสถานการณ์การปฏิเสธเฉพาะ:

// JavaScript - การทดสอบสถานการณ์การปฏิเสธทั้งหมด
const Omise = require('omise')({
secretKey: 'skey_test_xxxxxxxxxx'
});

const declineTestCases = [
{
card: '4000000000000101',
expectedCode: 'insufficient_funds',
description: 'เงินไม่เพียงพอ'
},
{
card: '4000000000000119',
expectedCode: 'processing_error',
description: 'ข้อผิดพลาดในการประมวลผล'
},
{
card: '4000000000000127',
expectedCode: 'lost_card',
description: 'บัตรหาย'
},
{
card: '4000000000000135',
expectedCode: 'stolen_card',
description: 'บัตรถูกขโมย'
},
{
card: '4000000000000143',
expectedCode: 'expired_card',
description: 'บัตรหมดอายุ'
},
{
card: '4000000000000150',
expectedCode: 'invalid_security_code',
description: 'CVV ไม่ถูกต้อง'
},
{
card: '4000000000000192',
expectedCode: 'failed_fraud_check',
description: 'ล้มเหลวการตรวจจับปลอมปลน'
},
{
card: '4000000000000234',
expectedCode: 'payment_rejected',
description: 'ปฏิเสธการชำระเงิน'
}
];

async function testAllDeclines() {
for (const testCase of declineTestCases) {
try {
console.log(`Testing: ${testCase.description}`);

const token = await Omise.tokens.create({
card: {
name: 'Test User',
number: testCase.card,
expiration_month: 12,
expiration_year: 2026,
security_code: '123'
}
});

const charge = await Omise.charges.create({
amount: 100000,
currency: 'THB',
card: token.id
});

// ตรวจสอบการปฏิเสธที่คาดหวัง
if (charge.status === 'failed') {
console.log(`${testCase.description}: ${charge.failure_code}`);

// ยืนยันรหัสความล้มเหลวที่คาดหวัง
if (charge.failure_code === testCase.expectedCode) {
console.log(` รหัสที่คาดหวังตรงกัน: ${testCase.expectedCode}`);
} else {
console.error(` คาดหวัง: ${testCase.expectedCode}, ได้รับ: ${charge.failure_code}`);
}
} else {
console.error(`✗ คาดหวังประจำที่ล้มเหลว, ได้รับ: ${charge.status}`);
}

} catch (error) {
console.error(`${testCase.description} error:`, error.message);
}
}
}

testAllDeclines();

การจัดการข้อความการปฏิเสธ

ให้ข้อความแสดงข้อผิดพลาดที่เป็นมิตรกับผู้ใช้:

# Ruby - การแปลงรหัสความล้มเหลวเป็นข้อความผู้ใช้
require 'omise'

Omise.api_key = 'skey_test_xxxxxxxxxx'

class PaymentErrorHandler
DECLINE_MESSAGES = {
'insufficient_funds' => 'บัตรของคุณมีเงินไม่เพียงพอ โปรดใช้วิธีการชำระเงินอื่น',
'processing_error' => 'ไม่สามารถประมวลผลการชำระเงินของคุณ โปรดลองอีกครั้ง',
'lost_card' => 'บัตรนี้ได้รับการรายงานว่าหาย โปรดใช้บัตรอื่น',
'stolen_card' => 'บัตรนี้ไม่สามารถใช้ได้ โปรดติดต่อธนาคารของคุณ',
'expired_card' => 'บัตรของคุณหมดอายุแล้ว โปรดอัปเดตข้อมูลการชำระเงินของคุณ',
'invalid_security_code' => 'รหัสความปลอดภัย (CVV) ไม่ถูกต้อง',
'invalid_card_number' => 'เลขบัตรไม่ถูกต้อง โปรดตรวจสอบและลองอีกครั้ง',
'invalid_expiry_date' => 'วันหมดอายุไม่ถูกต้อง โปรดตรวจสอบและลองอีกครั้ง',
'transaction_not_permitted' => 'ธุรกรรมนี้ไม่อนุญาตสำหรับบัตรของคุณ',
'failed_fraud_check' => 'การชำระเงินปฏิเสธเพื่อเหตุผลความปลอดภัย',
'payment_rejected' => 'การชำระเงินปฏิเสธ โปรดลองวิธีการชำระเงินอื่น',
'card_restricted' => 'บัตรของคุณมีข้อจำกัดที่ป้องกันการชำระเงินนี้',
'exceeds_withdrawal_limit' => 'จำนวนเงินเกินขีดจำกัดของบัตรของคุณ',
'issuer_unavailable' => 'ผู้ออกบัตรไม่พร้อมชั่วคราว โปรดลองอีกครั้งในภายหลัง'
}.freeze

def self.get_user_message(failure_code)
DECLINE_MESSAGES[failure_code] || 'การชำระเงินปฏิเสธ โปรดลองวิธีการชำระเงินอื่น'
end

def self.should_retry?(failure_code)
# ความล้มเหลวเหล่านี้อาจสำเร็จเมื่อลองใหม่
retryable = %w[processing_error issuer_unavailable timeout_error]
retryable.include?(failure_code)
end

def self.handle_payment_failure(charge)
{
message: get_user_message(charge.failure_code),
code: charge.failure_code,
can_retry: should_retry?(charge.failure_code),
suggestion: get_suggestion(charge.failure_code)
}
end

def self.get_suggestion(failure_code)
case failure_code
when 'insufficient_funds'
'ลองบัตรอื่นหรือเพิ่มเงินเข้าบัตรนี้'
when 'invalid_security_code', 'invalid_card_number', 'invalid_expiry_date'
'ตรวจสอบรายละเอียดบัตรของคุณอีกครั้งและลองใหม่'
when 'processing_error', 'issuer_unavailable'
'รอสักครู่แล้วลองอีกครั้ง'
when 'failed_fraud_check'
'ติดต่อธนาคารของคุณเพื่ออนุมัติการชำระเงินนี้'
else
'ใช้วิธีการชำระเงินอื่น'
end
end
end

# ตัวอย่างการใช้งาน
def process_payment_with_error_handling(token_id)
begin
charge = Omise::Charge.create(
amount: 100_000,
currency: 'THB',
card: token_id
)

if charge.status == 'failed'
error_info = PaymentErrorHandler.handle_payment_failure(charge)
puts "Payment failed: #{error_info[:message]}"
puts "Suggestion: #{error_info[:suggestion]}"
puts "Can retry: #{error_info[:can_retry]}"

return { success: false, error: error_info }
end

{ success: true, charge: charge }

rescue Omise::Error => e
puts "Error: #{e.message}"
{ success: false, error: e.message }
end
end

ความล้มเหลวของเครือข่าย

การทดสอบการหมดเวลา

จำลองการหมดเวลาของเครือข่ายในแอปพลิเคชันของคุณ:

// JavaScript - การทดสอบการจัดการการหมดเวลา
const Omise = require('omise')({
secretKey: 'skey_test_xxxxxxxxxx'
});

// ตั้งค่าการหมดเวลาที่กำหนดเอง (เป็นมิลลิวินาที)
const axios = require('axios');
const https = require('https');

async function testTimeoutHandling() {
const timeout = 5000; // 5 วินาที

const customAgent = new https.Agent({
timeout: timeout
});

try {
const token = await Omise.tokens.create({
card: {
name: 'Test User',
number: '4242424242424242',
expiration_month: 12,
expiration_year: 2026,
security_code: '123'
}
});

// จำลองการหมดเวลาด้วยการหมดเวลาที่สั้นมาก
const chargePromise = Omise.charges.create({
amount: 100000,
currency: 'THB',
card: token.id
});

// สร้างสัญญา timeout
const timeoutPromise = new Promise((_, reject) => {
setTimeout(() => reject(new Error('Request timeout')), timeout);
});

// แข่งขันระหว่างประจำและการหมดเวลา
const charge = await Promise.race([chargePromise, timeoutPromise]);
console.log('Charge completed:', charge.id);

} catch (error) {
if (error.message === 'Request timeout') {
console.log('✓ Timeout handled correctly');
// ใช้ลอจิกการลองใหม่
await retryWithBackoff();
} else {
console.error('Unexpected error:', error.message);
}
}
}

async function retryWithBackoff(attempt = 1, maxAttempts = 3) {
const backoffDelay = Math.min(1000 * Math.pow(2, attempt - 1), 10000);

console.log(`Retry attempt ${attempt} after ${backoffDelay}ms`);

await new Promise(resolve => setTimeout(resolve, backoffDelay));

try {
// ลองดำเนินการอีกครั้ง
const result = await performPayment();
return result;
} catch (error) {
if (attempt < maxAttempts) {
return retryWithBackoff(attempt + 1, maxAttempts);
}
throw error;
}
}

testTimeoutHandling();

ความล้มเหลว 3D Secure

การทดสอบความล้มเหลวการตรวจสอบสิทธิ์ 3DS

# Python - การทดสอบความล้มเหลว 3D Secure
import omise

omise.api_secret = 'skey_test_xxxxxxxxxx'
omise.api_version = '2019-05-29'

def test_3ds_authentication_failure():
"""ทดสอบล้มเหลวการตรวจสอบสิทธิ์ 3DS"""
try:
# ใช้บัตรที่ล้มเหลวการตรวจสอบสิทธิ์ 3DS
token = omise.Token.create(
card={
'name': 'Test User',
'number': '4000000000000010', # บัตรลงทะเบียน 3DS, การตรวจสอบล้มเหลว
'expiration_month': 12,
'expiration_year': 2026,
'security_code': '123'
}
)

charge = omise.Charge.create(
amount=100000,
currency='THB',
card=token.id,
return_uri='https://example.com/complete'
)

print(f'Initial Status: {charge.status}') # 'pending'
print(f'Authorize URI: {charge.authorize_uri}')

# หลังจากลูกค้าพยายามใช้ 3DS, ประจำจะล้มเหลว
# จำลองการตรวจสอบประจำหลังจาก 3DS
import time
time.sleep(2) # ในสถานการณ์จริง, รอการเปลี่ยนเส้นทาง

updated_charge = omise.Charge.retrieve(charge.id)
print(f'Final Status: {updated_charge.status}') # 'failed'
print(f'Failure Code: {updated_charge.failure_code}') # '3ds_authentication_failed'

except omise.errors.BaseError as e:
print(f'Error: {e.message}')

def test_3ds_timeout():
"""ทดสอบสถานการณ์การหมดเวลา 3DS"""
try:
token = omise.Token.create(
card={
'name': 'Test User',
'number': '4000000000000002', # บัตรลงทะเบียน 3DS
'expiration_month': 12,
'expiration_year': 2026,
'security_code': '123'
}
)

charge = omise.Charge.create(
amount=100000,
currency='THB',
card=token.id,
return_uri='https://example.com/complete'
)

# ในโหมดการทดสอบ, ประจำ 3DS หมดอายุหลังจาก 15 นาที
# ตรวจสอบว่าประจำหมดอายุเนื่องจากการหมดเวลา
print(f'Charge created: {charge.id}')
print(f'Expires at: {charge.expires_at}')

# ในการผลิต, ใช้การจัดการตัวจัดการเวบฮุกสำหรับเหตุการณ์ charge.expire

except omise.errors.BaseError as e:
print(f'Error: {e.message}')

def test_3ds_cancellation():
"""ทดสอบการยกเลิก 3DS ของผู้ใช้"""
try:
token = omise.Token.create(
card={
'name': 'Test User',
'number': '4000000000000028', # บัตรลงทะเบียน 3DS, ปฏิเสธ
'expiration_month': 12,
'expiration_year': 2026,
'security_code': '123'
}
)

charge = omise.Charge.create(
amount=100000,
currency='THB',
card=token.id,
return_uri='https://example.com/complete'
)

# ผู้ใช้ยกเลิกบนหน้า 3DS
updated_charge = omise.Charge.retrieve(charge.id)

if updated_charge.status == 'failed':
print(f'3DS rejected: {updated_charge.failure_code}')

except omise.errors.BaseError as e:
print(f'Error: {e.message}')

if __name__ == '__main__':
print("Testing 3DS authentication failure...")
test_3ds_authentication_failure()

print("\nTesting 3DS timeout...")
test_3ds_timeout()

print("\nTesting 3DS cancellation...")
test_3ds_cancellation()

ข้อผิดพลาด API

การทดสอบคำขอไม่ถูกต้อง

// JavaScript - การทดสอบข้อผิดพลาดการตรวจสอบ API
const Omise = require('omise')({
secretKey: 'skey_test_xxxxxxxxxx'
});

async function testValidationErrors() {
const testCases = [
{
name: 'Invalid amount (negative)',
data: { amount: -100, currency: 'THB', card: 'tok_test' },
expectedError: 'invalid_amount'
},
{
name: 'Invalid amount (below minimum)',
data: { amount: 100, currency: 'THB', card: 'tok_test' },
expectedError: 'invalid_amount'
},
{
name: 'Invalid currency',
data: { amount: 100000, currency: 'XXX', card: 'tok_test' },
expectedError: 'invalid_currency'
},
{
name: 'Missing required field',
data: { amount: 100000, currency: 'THB' },
expectedError: 'missing_card'
},
{
name: 'Invalid token',
data: { amount: 100000, currency: 'THB', card: 'invalid_token' },
expectedError: 'invalid_card'
}
];

for (const testCase of testCases) {
try {
console.log(`\nTesting: ${testCase.name}`);
const charge = await Omise.charges.create(testCase.data);
console.log('✗ Expected error but charge succeeded');
} catch (error) {
console.log(`✓ Error caught: ${error.code}`);
console.log(` Message: ${error.message}`);

if (error.code === testCase.expectedError) {
console.log(` Expected error matched`);
}
}
}
}

async function testAuthenticationErrors() {
// ทดสอบด้วย API key ไม่ถูกต้อง
const badClient = require('omise')({
secretKey: 'skey_test_invalid'
});

try {
const charges = await badClient.charges.list();
console.log('✗ Expected authentication error');
} catch (error) {
if (error.code === 'authentication_failure') {
console.log('✓ Authentication error handled correctly');
}
}
}

async function testRateLimiting() {
// จำลองคำขอที่รวดเร็วเพื่อทดสอบขีดจำกัดอัตรา
const requests = [];

for (let i = 0; i < 100; i++) {
requests.push(
Omise.charges.list({ limit: 1 })
.catch(error => {
if (error.code === 'rate_limit_exceeded') {
console.log('✓ Rate limit detected');
return { rateLimited: true };
}
throw error;
})
);
}

const results = await Promise.allSettled(requests);
const rateLimited = results.filter(r =>
r.status === 'fulfilled' && r.value?.rateLimited
).length;

console.log(`Rate limited: ${rateLimited} requests`);
}

async function runAllAPITests() {
console.log('=== Testing Validation Errors ===');
await testValidationErrors();

console.log('\n=== Testing Authentication Errors ===');
await testAuthenticationErrors();

console.log('\n=== Testing Rate Limiting ===');
await testRateLimiting();
}

runAllAPITests();

สถานการณ์ที่ใช้งานได้จริง

การทดสอบการดำเนินการคืนเงิน

ทดสอบการคืนเงินแบบเต็มและบางส่วน:

# Ruby - การทดสอบลำดับการคืนเงิน
require 'omise'

Omise.api_key = 'skey_test_xxxxxxxxxx'

def test_refund_flow
begin
# สร้างประจำที่สำเร็จ
token = Omise::Token.create(
card: {
name: 'Test User',
number: '4242424242424242',
expiration_month: 12,
expiration_year: 2026,
security_code: '123'
}
)

charge = Omise::Charge.create(
amount: 100_000,
currency: 'THB',
card: token.id
)

puts "Charge created: #{charge.id} - #{charge.status}"

# ทดสอบการคืนเงินแบบเต็ม
full_refund = Omise::Refund.create(charge.id)
puts "Full refund: #{full_refund.id} - #{full_refund.amount}"

# สร้างประจำอื่นสำหรับการทดสอบการคืนเงินบางส่วน
token2 = Omise::Token.create(
card: {
name: 'Test User',
number: '4242424242424242',
expiration_month: 12,
expiration_year: 2026,
security_code: '123'
}
)

charge2 = Omise::Charge.create(
amount: 100_000,
currency: 'THB',
card: token2.id
)

# ทดสอบการคืนเงินบางส่วน (50%)
partial_refund = Omise::Refund.create(charge2.id, amount: 50_000)
puts "Partial refund: #{partial_refund.id} - #{partial_refund.amount}"

rescue Omise::Error => e
puts "Error: #{e.message}"
end
end

test_refund_flow

แนวทางปฏิบัติที่ดีสำหรับการทดสอบความล้มเหลว

1. ทดสอบโหมดความล้มเหลวทั้งหมด

สร้างชุดการทดสอบที่ครอบคลุมสำหรับสถานการณ์ความล้มเหลวทั้งหมด:

// ชุดการทดสอบความล้มเหลวแบบครอบคลุม
const failureTests = {
// การปฏิเสธการชำระเงิน
'insufficient_funds': '4000000000000101',
'lost_card': '4000000000000127',
'stolen_card': '4000000000000135',
'expired_card': '4000000000000143',
'invalid_cvv': '4000000000000150',
'fraud_check': '4000000000000192',

// ความล้มเหลว 3D Secure
'3ds_failed': '4000000000000010',
'3ds_rejected': '4000000000000028',

// การจำลองเครือข่าย
'timeout': async () => { /* การจำลองการหมดเวลา */ },
'connection_error': async () => { /* ข้อผิดพลาดการเชื่อมต่อ */ },

// ข้อผิดพลาด API
'invalid_amount': { amount: -100 },
'invalid_currency': { currency: 'XXX' },
'missing_card': { /* ไม่มีช่องบัตร */ }
};

2. ติดตั้งการบันทึกข้อผิดพลาดที่เหมาะสม

บันทึกข้อผิดพลาดทั้งหมดด้วยบริบทที่เพียงพอสำหรับการแก้ไขข้อบกพร่อง:

import logging
import json
from datetime import datetime

logging.basicConfig(
level=logging.INFO,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s'
)
logger = logging.getLogger(__name__)

def log_payment_error(error_type, error_data, context=None):
"""บันทึกข้อผิดพลาดการชำระเงินด้วยบริบทแบบเต็ม"""
log_entry = {
'timestamp': datetime.utcnow().isoformat(),
'error_type': error_type,
'error_data': error_data,
'context': context or {}
}

logger.error(f'Payment Error: {json.dumps(log_entry, indent=2)}')

# ส่งไปยังบริการการตรวจสอบในการผลิต
# send_to_monitoring(log_entry)

3. ตรวจสอบอัตราความล้มเหลว

ติดตามและเตือนเกี่ยวกับอัตราข้อผิดพลาด:

class FailureMonitor
def initialize
@failures = Hash.new(0)
@total_attempts = 0
end

def record_attempt
@total_attempts += 1
end

def record_failure(failure_type)
@failures[failure_type] += 1
end

def failure_rate(failure_type = nil)
return 0 if @total_attempts.zero?

if failure_type
(@failures[failure_type].to_f / @total_attempts * 100).round(2)
else
(@failures.values.sum.to_f / @total_attempts * 100).round(2)
end
end

def report
puts "Total Attempts: #{@total_attempts}"
puts "Total Failures: #{@failures.values.sum}"
puts "Overall Failure Rate: #{failure_rate}%"
puts "\nBreakdown by type:"
@failures.each do |type, count|
puts " #{type}: #{count} (#{failure_rate(type)}%)"
end
end
end

ตรวจสอบการแก้ไขปัญหา

ปัญหาทั่วไป

ปัญหา: การลองใหม่ทำให้เกิดประจำที่ซ้ำกัน

สาเหตุ: ไม่ใช้คีย์ความเป็นปัญหาเดียวกัน

วิธีแก้ไข: ใช้คีย์ความเป็นปัญหาเดียวกันเสมอสำหรับคำขอการชำระเงิน:

const charge = await Omise.charges.create(
{
amount: 100000,
currency: 'THB',
card: token.id
},
{ 'Idempotency-Key': uniqueKey }
);

ปัญหา: จุดสิ้นสุดเวบฮุกหมดเวลา

สาเหตุ: ประมวลผลเวบฮุกอย่างซิงโครนัส

วิธีแก้ไข: ประมวลผลเวบฮุกอย่างไม่ซิงโครนัส:

@app.route('/webhooks', methods=['POST'])
def handle_webhook():
# ตรวจสอบและเข้าคิวทันที่
event = request.get_json()
queue_for_processing(event)

# ส่งกลับ 200 อย่างรวดเร็ว
return jsonify({'received': True}), 200

def queue_for_processing(event):
# เพิ่มไปยังคิวเพื่อประมวลผลอย่างไม่ซิงโครนัส
event_queue.put(event)

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

ฉันควรลองอีกครั้งการชำระเงินที่ล้มเหลวโดยอัตโนมัติหรือไม่

ลองใหม่เฉพาะกับข้อผิดพลาดชั่วคราว (การหมดเวลา, ความล้มเหลวของการเชื่อมต่อ, ข้อผิดพลาด 5xx) ไม่เคยลองใหม่กับความล้มเหลวถาวร (บัตรไม่ถูกต้อง, เงินไม่เพียงพอ, การตรวจจับปลอมปลน)

ฉันควรรอนานแค่ไหนระหว่างการลองใหม่

ใช้การสืบย้อยแบบเอกโพเนนเชียลเริ่มต้นที่ 1 วินาที, เพิ่มเป็นสองเท่าในแต่ละครั้ง, สูงสุด 30 วินาที เพิ่มการสั่นสะเทือนเพื่อป้องกันปัญหา herd ที่คำรณา

ข้อผิดพลาดที่สามารถลองใหม่ได้และไม่สามารถลองใหม่ได้ต่างกันอย่างไร

สามารถลองใหม่ได้: ข้อผิดพลาดเครือข่าย, การหมดเวลา, ข้อผิดพลาด 5xx, ขีดจำกัดอัตรา ไม่สามารถลองใหม่ได้: ข้อมูลคำขอไม่ถูกต้อง, ข้อผิดพลาดการตรวจสอบสิทธิ์, การปฏิเสธบัตร, การตรวจจับปลอมปลน

ทรัพยากรที่เกี่ยวข้อง

ขั้นตอนถัดไป

  1. ใช้การจัดการข้อผิดพลาด สำหรับสถานการณ์ความล้มเหลวทั้งหมด
  2. ตั้งค่าการบันทึกที่ครอบคลุม เพื่อแก้ไขปัญหา
  3. ทดสอบลอจิกการลองใหม่ ด้วยการสืบย้อยแบบเอกโพเนนเชียล
  4. ใช้การตรวจสอบลายเซ็นเวบฮุก และการจัดการความล้มเหลว
  5. ทดสอบสถานการณ์การปฏิเสธทั้งหมด ด้วยบัตรทดสอบ
  6. ตรวจสอบอัตราความล้มเหลว ในการผลิต
  7. ตั้งค่าการแจ้งเตือน สำหรับรูปแบบข้อผิดพลาดที่ผิดปกติ
  8. เอกสารการจัดการข้อผิดพลาด สำหรับทีมของคุณ

พร้อมทดสอบเวบฮุก ดูการทดสอบเวบฮุก

ต้องการข้อมูลบัตรทดสอบ ดูเลขบัตรทดสอบและข้อมูล