Beispiel #1
0
 /**
  * Payment redirect URL filter.
  *
  * @param string                  $url
  * @param Pronamic_WP_Pay_Payment $payment
  * @return string
  */
 public static function redirect_url($url, $payment)
 {
     switch ($payment->get_status()) {
         case Pronamic_WP_Pay_Statuses::CANCELLED:
             $url = give_get_failed_transaction_uri();
             break;
         case Pronamic_WP_Pay_Statuses::FAILURE:
             $url = give_get_failed_transaction_uri();
             break;
         case Pronamic_WP_Pay_Statuses::SUCCESS:
             $url = give_get_success_page_uri();
             break;
     }
     return $url;
 }
 /**
  * Payment redirect URL filter.
  *
  * @param string                  $url
  * @param Pronamic_WP_Pay_Payment $payment
  * @return string
  */
 public static function redirect_url($url, $payment)
 {
     $source_id = $payment->get_source_id();
     $data = new Pronamic_WP_Pay_Extensions_EDD_PaymentData($source_id, array());
     $url = $data->get_normal_return_url();
     switch ($payment->get_status()) {
         case Pronamic_WP_Pay_Statuses::CANCELLED:
             $url = $data->get_cancel_url();
             break;
         case Pronamic_WP_Pay_Statuses::EXPIRED:
             $url = $data->get_error_url();
             break;
         case Pronamic_WP_Pay_Statuses::FAILURE:
             $url = $data->get_error_url();
             break;
         case Pronamic_WP_Pay_Statuses::SUCCESS:
             $url = $data->get_success_url();
             break;
         case Pronamic_WP_Pay_Statuses::OPEN:
             // Nothing to do?
             break;
     }
     return $url;
 }
 /**
  * Payment redirect URL filter.
  *
  * @param string                  $url
  * @param Pronamic_WP_Pay_Payment $payment
  * @return string
  */
 public static function redirect_url($url, $payment)
 {
     $donation_id = $payment->get_source_id();
     $donation = new Charitable_Donation($donation_id);
     $url = self::get_return_url($donation);
     switch ($payment->get_status()) {
         case Pronamic_WP_Pay_Statuses::SUCCESS:
             $url = charitable_get_permalink('donation_receipt_page', array('donation_id' => $donation_id));
             break;
     }
     return $url;
 }
 /**
  * Payment redirect URL filter.
  *
  * @param string                  $url
  * @param Pronamic_WP_Pay_Payment $payment
  * @return string
  */
 public static function redirect_url($url, $payment)
 {
     // @see https://github.com/wp-plugins/membership/blob/4.0.0.2/app/model/class-ms-model-pages.php#L492-L530
     if (Pronamic_WP_Pay_Class::method_exists('MS_Model_Pages', 'get_page_url')) {
         // @see https://github.com/wp-plugins/membership/blob/4.0.0.2/app/model/class-ms-model-pages.php#L44-L55
         $url = MS_Model_Pages::get_page_url(MS_Model_Pages::MS_PAGE_REGISTER);
     } elseif (function_exists('M_get_returnurl_permalink')) {
         // @see https://github.com/wp-plugins/membership/blob/3.4.4.3/membershipincludes/includes/functions.php#L598-L622
         $url = M_get_returnurl_permalink();
     }
     switch ($payment->get_status()) {
         case Pronamic_WP_Pay_Statuses::SUCCESS:
             // @see https://github.com/wp-plugins/membership/blob/4.0.0.2/app/model/class-ms-model-pages.php#L492-L530
             if (Pronamic_WP_Pay_Class::method_exists('MS_Model_Pages', 'get_page_url')) {
                 $invoice_id = get_post_meta($payment->get_id(), '_pronamic_payment_membership_invoice_id', true);
                 $invoice = MS_Factory::load('MS_Model_Invoice', $invoice_id);
                 $subscription = $invoice->get_subscription();
                 // @see https://github.com/wp-plugins/membership/blob/4.0.0.2/app/model/class-ms-model-pages.php#L44-L55
                 $url = add_query_arg('ms_relationship_id', $subscription->id, MS_Model_Pages::get_page_url(MS_Model_Pages::MS_PAGE_REG_COMPLETE));
             } elseif (function_exists('M_get_registrationcompleted_permalink')) {
                 // @see https://github.com/wp-plugins/membership/blob/3.4.4.3/membershipincludes/includes/functions.php#L576-L598
                 $url = M_get_registrationcompleted_permalink();
             }
             break;
     }
     return $url;
 }