Automattic\WooCommerce\Internal\ReceiptRendering
ReceiptRenderingEngine::get_woo_pay_data
Get the order data related to WooCommerce Payments.
It will return null if any of these is true:
- Payment method is not "woocommerce_payments".
- WooCommerce Payments is not installed.
- No intent id is stored for the order.
- Retrieving the payment information from Stripe API (providing the intent id) fails.
- The received data set doesn't contain the expected information.
Метод класса: ReceiptRenderingEngine{}
Хуков нет.
Возвращает
array|null. An array of payment information for the order, or null if not available.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_woo_pay_data( $order ): ?array;
- $order(WC_Abstract_Order) (обязательный)
- The order to get the data from.
Код ReceiptRenderingEngine::get_woo_pay_data() ReceiptRenderingEngine::get woo pay data WC 11.3.0
private function get_woo_pay_data( WC_Abstract_Order $order ): ?array {
$card_info = PaymentInfo::get_card_info( $order );
if ( empty( $card_info ) ) {
return null;
}
// Backcompat for custom templates.
$card_info['card_icon'] = $card_info['icon'];
$card_info['card_last4'] = $card_info['last4'];
return $card_info;
}