✏️ 编辑:Refund.php
路径:
/home/forge/woocommerce-square/includes/Gateway/API/Responses/Refund.php
大小:1.12 KB · 修改:2025-12-23 20:26:26 · 权限:0644 · 可写
← 返回目录
👁 查看
⬇ 下载
<?php namespace WooCommerce\Square\Gateway\API\Responses; defined( 'ABSPATH' ) || exit; /** * The refund API response object. * * @since 2.0.0 * * @method \Square\Models\CreateRefundResponse|\Square\Models\GetPaymentRefundResponse get_data() */ class Refund extends \WooCommerce\Square\Gateway\API\Response { /** * Determines if the transaction was approved. * * @since 2.0.0 * * @return bool */ public function transaction_approved() { return parent::transaction_approved() && ( in_array( $this->get_status_code(), array( 'APPROVED', 'COMPLETED', 'PENDING' ), true ) ); } /** * Gets the transaction ID. * * @since 2.0.0 * * @return string */ public function get_transaction_id() { return $this->get_data() && $this->get_data()->getRefund() ? $this->get_data()->getRefund()->getId() : ''; } /** * Gets the response status code. * * @since 2.0.0 * * @return string */ public function get_status_code() { if ( ! $this->has_errors() && $this->get_data() ) { $code = $this->get_data()->getRefund()->getStatus(); } else { $code = parent::get_status_code(); } return $code; } }
💾 保存
取消
保存为 UTF-8,换行统一为 LF