9 January 2024 Seminar on “Non-arbitration of disputes before international arbitration on the grounds that it is illegal.” (in Arabic)
Speaker: Dr. Ibrahim El Ananny
Moderator: Ambassador Mohamed Mustafa Kamal
Watch Video.
$lang = !empty($payment->language_code) ? sanitize_text_field($payment->language_code) : 'en'; // 1. Build the API payload $payload = array( 'apiOperation' => 'INITIATE_CHECKOUT', 'interaction' => array( 'operation' => 'PURCHASE', 'merchant' => array( 'name' => get_bloginfo('name'), ), 'displayControl' => array( 'billingAddress' => 'HIDE' // This hides the billing address section in MPGS ) ), 'order' => array( 'amount' => number_format((float)$payment->amount, 2, '.', ''), 'currency' => 'EGP', 'id' => (string)$payment_id, ) ); // 2. Setup the request arguments $args = array( 'body' => wp_json_encode($payload), 'headers' => array( 'Content-Type' => 'application/json; charset=utf-8', 'Authorization' => 'Basic ' . base64_encode("merchant." . $gateway->merchant_id . ":" . $password), ), 'timeout' => 45, 'method' => 'POST', 'data_format' => 'body', ); // 3. Send remote request to MPGS $response = wp_remote_post($endpoint, $args); if (is_wp_error($response)) { $this->logger->log('Session creation failed: ' . $response->get_error_message()); return $response; } $body = wp_remote_retrieve_body($response); $data = json_decode($body, true); if (isset($data['result']) && $data['result'] === 'SUCCESS') { // Update your payment entity with $data['session']['id'] here $session_id = $data['session']['id']; $token = $this->get_or_create_token($payment_id); return $this->build_redirect_url($session_id, $token); } return new WP_Error('session_failed', __('Failed to initialize payment session.', 'crcica-eventbridge')); } }