Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decode HTML entity encoding in the site name before sending data to Payfast. #219

Merged
merged 3 commits into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions includes/class-wc-gateway-payfast.php
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ public function admin_options() {
* @return void
*/
public function generate_payfast_form( $order_id ) {
$order = wc_get_order( $order_id );
$order = wc_get_order( $order_id );
$site_name = html_entity_decode( get_bloginfo( 'name' ), ENT_QUOTES, get_bloginfo( 'charset' ) );
// Construct variables for post.
$this->data_to_send = array(
// Merchant details.
Expand All @@ -412,9 +413,9 @@ public function generate_payfast_form( $order_id ) {
// Item details.
'm_payment_id' => ltrim( $order->get_order_number(), _x( '#', 'hash before order number', 'woocommerce-gateway-payfast' ) ),
'amount' => $order->get_total(),
'item_name' => get_bloginfo( 'name' ) . ' - ' . $order->get_order_number(),
'item_name' => $site_name . ' - ' . $order->get_order_number(),
/* translators: 1: blog info name */
'item_description' => sprintf( esc_html__( 'New order from %s', 'woocommerce-gateway-payfast' ), get_bloginfo( 'name' ) ),
'item_description' => sprintf( esc_html__( 'New order from %s', 'woocommerce-gateway-payfast' ), $site_name ),

// Custom strings.
'custom_str1' => self::get_order_prop( $order, 'order_key' ),
Expand Down
Loading