Ejemplo n.º 1
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $mollie_payment = $this->client->get_payment($payment->get_transaction_id());
     if ($mollie_payment) {
         $payment->set_status(Pronamic_WP_Pay_Mollie_Statuses::transform($mollie_payment->status));
         if (isset($mollie_payment->details)) {
             $details = $mollie_payment->details;
             if (isset($details->consumerName)) {
                 $payment->set_consumer_name($details->consumerName);
             }
             if (isset($details->consumerAccount)) {
                 $payment->set_consumer_iban($details->consumerAccount);
             }
         }
     } else {
         $this->error = $this->client->get_error();
     }
 }
Ejemplo n.º 2
0
 /**
  * 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());
     if ($result instanceof Pronamic_WP_Pay_Gateways_Sisow_Error) {
         $this->error = $this->client->get_error();
         return;
     }
     if (false === $result) {
         $this->error = $this->client->get_error();
         return;
     }
     if ($result instanceof Pronamic_WP_Pay_Gateways_Sisow_Transaction) {
         $transaction = $result;
         $payment->set_status($transaction->status);
         $payment->set_consumer_name($transaction->consumer_name);
         $payment->set_consumer_account_number($transaction->consumer_account);
         $payment->set_consumer_city($transaction->consumer_city);
     }
 }
Ejemplo n.º 3
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $mollie_payment = $this->client->get_payment($payment->get_transaction_id());
     if (!$mollie_payment) {
         $this->error = $this->client->get_error();
         return;
     }
     $status = Pronamic_WP_Pay_Mollie_Statuses::transform($mollie_payment->status);
     $payment->set_status($status);
     $subscription = $payment->get_subscription();
     if ($subscription && '' === $subscription->get_transaction_id()) {
         // First payment or non-subscription recurring payment,
         // use payment status for subscription too.
         $subscription->set_status($status);
     }
     if (isset($mollie_payment->details)) {
         $details = $mollie_payment->details;
         if (isset($details->consumerName)) {
             $payment->set_consumer_name($details->consumerName);
         }
         if (isset($details->consumerAccount)) {
             $payment->set_consumer_iban($details->consumerAccount);
         }
     }
 }
Ejemplo n.º 4
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $result = $this->client->get_payment_status($payment->get_id());
     if ($result) {
         $payment->set_status(Pronamic_WP_Pay_Gateways_PayDutch_States::transform($result->state));
         $payment->set_consumer_name($result->consumername);
         $payment->set_consumer_account_number($result->consumeraccount);
         $payment->set_consumer_city($result->consumercity);
         // $payment->set_consumer_country( $result->consumercountry );
     } else {
         $this->error = $this->client->get_error();
     }
 }
 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();
     }
 }
Ejemplo n.º 6
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $status = $this->client->check_status($this->config->layoutcode, $payment->get_transaction_id(), false, Pronamic_IDeal_IDeal::MODE_TEST === $this->config->mode);
     if ($status) {
         $payment->set_status(Pronamic_WP_Pay_Gateways_TargetPay_ResponseCodes::transform($status->code));
         if (Pronamic_WP_Pay_Gateways_TargetPay_ResponseCodes::OK === $status->code) {
             $payment->set_consumer_name($status->account_name);
             $payment->set_consumer_account_number($status->account_number);
             $payment->set_consumer_city($status->account_city);
         }
     }
 }
Ejemplo n.º 7
0
 /**
  * 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 (null !== $error) {
         $this->set_error($error);
     } else {
         $transaction = $result->transaction;
         $payment->set_status($transaction->getStatus());
         $payment->set_consumer_name($transaction->getConsumerName());
         $payment->set_consumer_account_number($transaction->getConsumerAccountNumber());
         $payment->set_consumer_city($transaction->getConsumerCity());
     }
 }
Ejemplo n.º 8
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $order = $this->client->get_order($payment->get_transaction_id());
     if ($order) {
         $payment->set_status(Pronamic_WP_Pay_ING_KassaCompleet_Statuses::transform($order->status));
         if (isset($order->transactions[0]->payment_method_details)) {
             $details = $order->transactions[0]->payment_method_details;
             if (isset($details->consumer_name)) {
                 $payment->set_consumer_name($details->consumer_name);
             }
             if (isset($details->consumer_iban)) {
                 $payment->set_consumer_iban($details->consumer_iban);
             }
         }
     } else {
         $this->error = $this->client->get_error();
     }
 }
Ejemplo n.º 9
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $result = $this->client->check_payment($payment->get_transaction_id());
     if (false !== $result) {
         $consumer = $result->consumer;
         switch ($result->status) {
             case Pronamic_WP_Pay_Gateways_Mollie_IDeal_Statuses::SUCCESS:
                 $payment->set_consumer_name($consumer->name);
                 $payment->set_consumer_account_number($consumer->account);
                 $payment->set_consumer_city($consumer->city);
             case Pronamic_WP_Pay_Gateways_Mollie_IDeal_Statuses::CANCELLED:
             case Pronamic_WP_Pay_Gateways_Mollie_IDeal_Statuses::EXPIRED:
             case Pronamic_WP_Pay_Gateways_Mollie_IDeal_Statuses::FAILURE:
                 $payment->set_status($result->status);
                 break;
             case Pronamic_WP_Pay_Gateways_Mollie_IDeal_Statuses::CHECKED_BEFORE:
                 // Nothing to do here
                 break;
         }
     } else {
         $this->error = $this->client->get_error();
     }
 }
Ejemplo n.º 10
0
 /**
  * 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());
     }
 }
Ejemplo n.º 11
0
 /**
  * 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);
     }
 }