예제 #1
0
 /**
  * Update status of the specified payment
  *
  * @param Pronamic_Pay_Payment $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment)
 {
     $result = $this->client->transaction_info($payment->get_transaction_id());
     if (isset($result, $result->paymentDetails)) {
         $state = $result->paymentDetails->state;
         $status = Pronamic_WP_Pay_Gateways_PayNL_States::transform($state);
         $payment->set_status($status);
     }
 }
예제 #2
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();
     }
 }
예제 #3
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();
     }
 }
예제 #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_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);
     }
 }
예제 #5
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);
         }
     }
 }
 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();
     }
 }
예제 #7
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);
         }
     }
 }
예제 #8
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());
     }
 }
 /**
  * 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();
     }
 }
예제 #10
0
 /**
  * Update lead status of the specified payment
  *
  * @param string $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment, $can_redirect = false)
 {
     $lead_id = $payment->get_source_id();
     $lead = RGFormsModel::get_lead($lead_id);
     if ($lead) {
         $form_id = $lead['form_id'];
         $form = RGFormsModel::get_form($form_id);
         $feed = get_pronamic_gf_pay_feed_by_entry_id($lead_id);
         $data = new Pronamic_WP_Pay_Extensions_GravityForms_PaymentData($form, $lead, $feed);
         if ($feed) {
             $url = null;
             switch ($payment->status) {
                 case Pronamic_WP_Pay_Statuses::CANCELLED:
                     $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::CANCELLED;
                     $url = $data->get_cancel_url();
                     break;
                 case Pronamic_WP_Pay_Statuses::EXPIRED:
                     $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::EXPIRED;
                     $url = $feed->get_url(Pronamic_WP_Pay_Extensions_GravityForms_Links::EXPIRED);
                     break;
                 case Pronamic_WP_Pay_Statuses::FAILURE:
                     $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::FAILED;
                     $url = $data->get_error_url();
                     break;
                 case Pronamic_WP_Pay_Statuses::SUCCESS:
                     if (!Pronamic_WP_Pay_Extensions_GravityForms_Entry::is_payment_approved($lead)) {
                         // Only fullfill order if the payment isn't approved aloready
                         $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::APPROVED;
                         // @see https://github.com/gravityforms/gravityformspaypal/blob/2.3.1/class-gf-paypal.php#L1741-L1742
                         if ($this->addon) {
                             $action = array('id' => $payment->get_transaction_id(), 'type' => 'complete_payment', 'transaction_id' => $payment->get_transaction_id(), 'amount' => $payment->get_amount(), 'entry_id' => $lead['id']);
                             $this->addon->complete_payment($lead, $action);
                         }
                         $this->fulfill_order($lead);
                     }
                     $url = $data->get_success_url();
                     break;
                 case Pronamic_WP_Pay_Statuses::OPEN:
                 default:
                     $url = $data->get_normal_return_url();
                     break;
             }
             Pronamic_WP_Pay_Extensions_GravityForms_GravityForms::update_entry($lead);
             if ($url && $can_redirect) {
                 wp_redirect($url);
                 exit;
             }
         }
     }
 }
예제 #11
0
 /**
  * Start
  *
  * @see Pronamic_WP_Pay_Gateway::start()
  * @param Pronamic_Pay_PaymentDataInterface $data
  */
 public function start(Pronamic_Pay_PaymentDataInterface $data, Pronamic_Pay_Payment $payment, $payment_method = null)
 {
     $payment->set_transaction_id(md5(time() . $data->get_order_id()));
     $payment->set_action_url($this->client->get_action_url());
     $this->client->set_customer_language(Pronamic_WP_Pay_Gateways_OmniKassa_LocaleHelper::transform($data->get_language()));
     $this->client->set_currency_numeric_code($data->get_currency_numeric_code());
     $this->client->set_order_id($data->get_order_id());
     $this->client->set_normal_return_url(home_url('/'));
     $this->client->set_automatic_response_url(home_url('/'));
     $this->client->set_amount($data->get_amount());
     $this->client->set_transaction_reference($payment->get_transaction_id());
     switch ($payment_method) {
         /*
          * If this field is not supplied in the payment request, then
          * by default the customer will be redirected to the Rabo
          * OmniKassa payment page. On the payment page, the
          * customer can choose from the payment methods
          * offered by the Rabo OmniKassa. These are the payment
          * methods: IDEAL, MINITIX, VISA, MASTERCARD,
          * MAESTRO, V PAY and BCMC.
          *
          * Exception: the register services INCASSO (direct debit),
          * ACCEPTGIRO (giro collection form) and REMBOURS
          * (cash on delivery) are not displayed on the Rabo
          * OmniKassa payment page by default.
          * If you wish to offer these register services to the
          * customer on the payment page, then you need to
          * always populate the paymentMeanBrandList field with
          * all the payment methods you wish to offer (provided
          * these have been requested and activated): IDEAL,
          * MINITIX, VISA, MASTERCARD, MAESTRO, VPAY, BCMC,
          * INCASSO, ACCEPTGIRO, REMBOURS.
          *
          * If you let the customer choose the payment method
          * while still in your webshop, then you must populate
          * this field of the payment request with only the selected
          * payment method. Populating this field with only one
          * payment method will instruct the Rabo OmniKassa to
          * redirect the customer directly to the payment page for
          * this payment method.
          */
         case Pronamic_WP_Pay_PaymentMethods::CREDIT_CARD:
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::MAESTRO);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::MASTERCARD);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::VISA);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::VPAY);
             break;
         case Pronamic_WP_Pay_PaymentMethods::DIRECT_DEBIT:
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::INCASSO);
             break;
         case Pronamic_WP_Pay_PaymentMethods::IDEAL:
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::IDEAL);
             break;
         case Pronamic_WP_Pay_PaymentMethods::MISTER_CASH:
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::BCMC);
             break;
         case Pronamic_WP_Pay_PaymentMethods::MINITIX:
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::MINITIX);
             break;
         default:
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::IDEAL);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::MINITIX);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::VISA);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::MASTERCARD);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::MAESTRO);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::VPAY);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::BCMC);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::INCASSO);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::ACCEPTGIRO);
             $this->client->add_payment_mean_brand(Pronamic_WP_Pay_Gateways_OmniKassa_PaymentMethods::REMBOURS);
             break;
     }
 }
예제 #12
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());
     }
 }
예제 #13
0
 /**
  * Update lead status of the specified payment
  *
  * @param string $payment
  */
 public function update_status(Pronamic_Pay_Payment $payment, $can_redirect = false)
 {
     $lead_id = $payment->get_source_id();
     $lead = RGFormsModel::get_lead($lead_id);
     if (!$lead) {
         return;
     }
     $form_id = $lead['form_id'];
     $form = RGFormsModel::get_form($form_id);
     $feed = get_pronamic_gf_pay_feed_by_entry_id($lead_id);
     if (!$feed) {
         return;
     }
     $data = new Pronamic_WP_Pay_Extensions_GravityForms_PaymentData($form, $lead, $feed);
     switch ($payment->status) {
         case Pronamic_WP_Pay_Statuses::CANCELLED:
             $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::CANCELLED;
             break;
         case Pronamic_WP_Pay_Statuses::EXPIRED:
             $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::EXPIRED;
             break;
         case Pronamic_WP_Pay_Statuses::FAILURE:
             $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::FAILED;
             break;
         case Pronamic_WP_Pay_Statuses::SUCCESS:
             if (!Pronamic_WP_Pay_Extensions_GravityForms_Entry::is_payment_approved($lead)) {
                 // Only fullfill order if the payment isn't approved already
                 $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS] = Pronamic_WP_Pay_Extensions_GravityForms_PaymentStatuses::APPROVED;
                 // @see https://github.com/wp-premium/gravityformspaypal/blob/2.3.1/class-gf-paypal.php#L1741-L1742
                 if ($this->addon) {
                     $action = array('id' => $payment->get_transaction_id(), 'type' => 'complete_payment', 'transaction_id' => $payment->get_transaction_id(), 'amount' => $payment->get_amount(), 'entry_id' => $lead['id']);
                     $this->addon->complete_payment($lead, $action);
                 }
                 $this->fulfill_order($lead);
             }
             break;
         case Pronamic_WP_Pay_Statuses::OPEN:
         default:
             // Nothing to do.
             break;
     }
     // Update payment status property of lead
     Pronamic_WP_Pay_Extensions_GravityForms_GravityForms::update_entry_property($lead['id'], Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS, $lead[Pronamic_WP_Pay_Extensions_GravityForms_LeadProperties::PAYMENT_STATUS]);
 }