| @@ -8,24 +8,25 @@ | ||
| 8 | 8 | /** |
| 9 | 9 | * Get the receipt link for a Stripe payment. |
| 10 | 10 | * |
| 11 | 11 | * @param string $receipt |
| 12 | - * | |
| 13 | 12 | * @return string |
| 14 | 13 | */ |
| 15 | 14 | public static function get_receipt_link( $receipt ) { |
| 16 | 15 | $url = 'https://dashboard.stripe.com/'; |
| 17 | 16 | |
| 18 | - if ( str_starts_with( $receipt, 'sub_' ) ) { | |
| 17 | + if ( 0 === strpos( $receipt, 'sub_' ) ) { | |
| 19 | 18 | $url .= 'subscriptions/'; |
| 20 | - } elseif ( str_starts_with( $receipt, 'seti_' ) ) { | |
| 19 | + } elseif ( 0 === strpos( $receipt, 'seti_' ) ) { | |
| 21 | 20 | $url .= 'setup_intents/'; |
| 22 | 21 | } else { |
| 23 | 22 | $url .= 'payments/'; |
| 24 | 23 | } |
| 25 | 24 | |
| 26 | - $url .= $receipt; | |
| 25 | + $url .= $receipt; | |
| 26 | + | |
| 27 | 27 | $link = '<a href="' . esc_url( $url ) . '" target="_blank">'; |
| 28 | 28 | $link .= esc_html( $receipt ); |
| 29 | - return $link . '</a>'; | |
| 29 | + $link .= '</a>'; | |
| 30 | + return $link; | |
| 30 | 31 | } |
| 31 | 32 | } |