feat: [barobill] 독립 SMS API 연동 및 OTP 발송 전환
- BarobillService에 SMS WSDL 엔드포인트 추가 - sendSMSMessage, checkSMSFromNumber, getSMSFromNumbers 메서드 추가 - sendOtpViaSms를 알림톡 대체발송 → 독립 SMS API(SendSMSMessage)로 전환
This commit is contained in:
@@ -614,7 +614,7 @@ public function downloadDocument(string $token): StreamedResponse|JsonResponse
|
||||
// ─── Private ───
|
||||
|
||||
/**
|
||||
* SMS로 OTP 발송 (바로빌 알림톡 SMS 대체발송 기능 활용)
|
||||
* SMS로 OTP 발송 (바로빌 독립 SMS API 사용)
|
||||
*/
|
||||
private function sendOtpViaSms(EsignContract $contract, EsignSigner $signer, string $otpCode): bool
|
||||
{
|
||||
@@ -632,31 +632,17 @@ private function sendOtpViaSms(EsignContract $contract, EsignSigner $signer, str
|
||||
$barobill = app(BarobillService::class);
|
||||
$barobill->setServerMode($member->server_mode ?? 'production');
|
||||
|
||||
// 채널 ID 조회
|
||||
$channelResult = $barobill->getKakaotalkChannels($member->biz_no);
|
||||
$yellowId = '';
|
||||
if ($channelResult['success'] ?? false) {
|
||||
$chData = $channelResult['data'];
|
||||
if (is_object($chData) && isset($chData->KakaotalkChannel)) {
|
||||
$ch = is_array($chData->KakaotalkChannel) ? $chData->KakaotalkChannel[0] : $chData->KakaotalkChannel;
|
||||
$yellowId = $ch->ChannelId ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
$fromNumber = preg_replace('/[^0-9]/', '', $member->manager_hp);
|
||||
$toNumber = preg_replace('/[^0-9]/', '', $signer->phone);
|
||||
$smsText = "[SAM] 전자계약 인증코드: {$otpCode} (5분 이내 입력)";
|
||||
|
||||
$result = $barobill->sendATKakaotalkEx(
|
||||
$result = $barobill->sendSMSMessage(
|
||||
corpNum: $member->biz_no,
|
||||
senderId: $member->barobill_id,
|
||||
yellowId: $yellowId,
|
||||
templateName: '인증코드',
|
||||
receiverName: $signer->name,
|
||||
receiverNum: preg_replace('/[^0-9]/', '', $signer->phone),
|
||||
title: '',
|
||||
message: $smsText,
|
||||
buttons: [],
|
||||
smsMessage: $smsText,
|
||||
smsSenderNum: preg_replace('/[^0-9]/', '', $member->manager_hp),
|
||||
fromNumber: $fromNumber,
|
||||
toName: $signer->name,
|
||||
toNumber: $toNumber,
|
||||
contents: $smsText,
|
||||
);
|
||||
|
||||
if ($result['success'] ?? false) {
|
||||
|
||||
Reference in New Issue
Block a user