/** * Update status of the specified payment * * @param Pronamic_Pay_Payment $payment */ public function update_status(Pronamic_Pay_Payment $payment) { $result = $this->client->get_status($payment->get_transaction_id()); $error = $this->client->get_error(); if (is_wp_error($error)) { $this->set_error($error); } else { $transaction = $result->transaction; $payment->set_status($transaction->get_status()); $payment->set_consumer_name($transaction->get_consumer_name()); $payment->set_consumer_iban($transaction->get_consumer_iban()); $payment->set_consumer_bic($transaction->get_consumer_bic()); } }
public function update_status(Pronamic_Pay_Payment $payment) { $merchant = new Pronamic_WP_Pay_Gateways_MultiSafepay_Connect_Merchant(); $merchant->account = $this->config->account_id; $merchant->site_id = $this->config->site_id; $merchant->site_secure_code = $this->config->site_code; $message = new Pronamic_WP_Pay_Gateways_MultiSafepay_Connect_XML_StatusRequestMessage($merchant, $payment->get_transaction_id()); $result = $this->client->get_status($message); if ($result) { $status = Pronamic_WP_Pay_Gateways_MultiSafepay_Connect_Statuses::transform($result->ewallet->status); $payment->set_status($status); $payment->set_consumer_name($result->payment_details->account_holder_name); $payment->set_consumer_iban($result->payment_details->account_iban); $payment->set_consumer_bic($result->payment_details->account_bic); $payment->set_consumer_account_number($result->payment_details->account_id); } else { $this->error = $this->client->get_error(); } }
/** * Update status of the specified payment * * @param Pronamic_Pay_Payment $payment */ public function update_status(Pronamic_Pay_Payment $payment) { $method = filter_var($_SERVER['REQUEST_METHOD'], FILTER_SANITIZE_STRING); $data = array(); switch ($method) { case 'GET': $data = $_GET; break; case 'POST': $data = $_POST; // WPCS: CSRF OK break; } $data = Pronamic_WP_Pay_Buckaroo_Util::urldecode($data); $data = stripslashes_deep($data); $data = $this->client->verify_request($data); if ($data) { $payment->set_transaction_id($data[Pronamic_WP_Pay_Buckaroo_Parameters::PAYMENT]); $payment->set_status(Pronamic_WP_Pay_Buckaroo_Statuses::transform($data[Pronamic_WP_Pay_Buckaroo_Parameters::STATUS_CODE])); $payment->set_consumer_iban($data[Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_IBAN]); $payment->set_consumer_bic($data[Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_BIC]); $payment->set_consumer_name($data[Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_NAME]); $labels = array(Pronamic_WP_Pay_Buckaroo_Parameters::PAYMENT => __('Payment', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::PAYMENT_METHOD => __('Payment Method', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::STATUS_CODE => __('Status Code', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::STATUS_CODE_DETAIL => __('Status Code Detail', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::STATUS_MESSAGE => __('Status Message', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::INVOICE_NUMBER => __('Invoice Number', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::AMOUNT => __('Amount', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::CURRENCY => __('Currency', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::TIMESTAMP => __('Timestamp', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_ISSUER => __('Service iDEAL Consumer Issuer', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_NAME => __('Service iDEAL Consumer Name', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_IBAN => __('Service iDEAL Consumer IBAN', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::SERVICE_IDEAL_CONSUMER_BIC => __('Service iDEAL Consumer BIC', 'pronamic_ideal'), Pronamic_WP_Pay_Buckaroo_Parameters::TRANSACTIONS => __('Transactions', 'pronamic_ideal')); $note = ''; $note .= '<p>'; $note .= __('Buckaroo data:', 'pronamic_ideal'); $note .= '</p>'; $note .= '<dl>'; foreach ($labels as $key => $label) { if (isset($data[$key])) { $note .= sprintf('<dt>%s</dt>', esc_html($label)); $note .= sprintf('<dd>%s</dd>', esc_html($data[$key])); } } $note .= '</dl>'; $payment->add_note($note); } }