Drop refund handling, finalize captures via webhook, add profanity filter

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
shadowdaoandClaude Sonnet 5.5 committed 2026-11-15 10:20:53 -08:00
1 parent 35f5d1acfb
commit 2e3abf33d9
11 files changed
+420 -82

No files matched your search

-9
View File
@@ -21,15 +21,6 @@ final class WebhookEvent {
$r = is_array( $event['resource'] ?? null ) ? $event['resource'] : array();
$type = (string) ( $event['event_type'] ?? '' );
$capId = (string) ( $r['id'] ?? '' );
// REFUNDED/REVERSED resources are refund objects whose "up" link points at the capture.
if ( 'PAYMENT.CAPTURE.COMPLETED' !== $type ) {
foreach ( (array) ( $r['links'] ?? array() ) as $l ) {
if ( is_array( $l ) && 'up' === ( $l['rel'] ?? '' ) && preg_match( '#/captures/([A-Za-z0-9\-_]+)$#', (string) ( $l['href'] ?? '' ), $m ) ) {
$capId = $m[1];
break;
}
}
}
$amount = null;
if ( isset( $r['amount']['value'], $r['amount']['currency_code'] ) ) {
try {