Skip to content

Commit

Permalink
Decode html entity encoding in site name before send data to Payfast.
Browse files Browse the repository at this point in the history
  • Loading branch information
iamdharmesh committed May 6, 2024
1 parent 690ada9 commit 5af9270
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 5af9270

Please sign in to comment.