Skip to content

Commit

Permalink
correction issue paypal
Browse files Browse the repository at this point in the history
  • Loading branch information
Yop-La committed Aug 7, 2018
1 parent abdda01 commit f47fc83
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 32 deletions.
6 changes: 5 additions & 1 deletion ajaxFunction/choisir-prof.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,22 @@ function ajaxAttribuerProf()

$retour->error = false;

$now = new \DateTime(null,new \DateTimeZone("Europe/Paris"));

$now = $now->add(new \DateInterval("PT30M"));

$refAbonnement = $_POST["refAbonnement"];
$refProf = $_POST["refProf"];

$slack = new \spamtonprof\slack\Slack();

$slack -> sendMessages("log", array('ref abo' , $refAbonnement, 'ref prof' ,$refProf));

$abonnement = new \spamtonprof\stp_api\stpAbonnement(array("ref_abonnement" => $refAbonnement, "ref_prof" => $refProf));
$abonnement = new \spamtonprof\stp_api\stpAbonnement(array("ref_abonnement" => $refAbonnement, "ref_prof" => $refProf, "date_attribution_prof" => $now ));

$abonnementMg = new \spamtonprof\stp_api\stpAbonnementManager();
$abonnementMg -> updateRefProf($abonnement);
$abonnementMg -> updateDateAttributionProf($abonnement);

$profMg = new \spamtonprof\stp_api\stpProfManager();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class MerchantPreferences extends PayPalModel
* Identifier of the merchant_preferences. 128 characters max.
*
* @param string $id
*
*
* @return $this
*/
public function setId($id)
{
$this->id = $id;
return $this;
}

/**
* Identifier of the merchant_preferences. 128 characters max.
*
Expand All @@ -47,20 +47,20 @@ public function getId()
{
return $this->id;
}

/**
* Setup fee amount. Default is 0.
*
* @param \PayPal\Api\Currency $setup_fee
*
*
* @return $this
*/
public function setSetupFee($setup_fee)
{
$this->setup_fee = $setup_fee;
return $this;
}

/**
* Setup fee amount. Default is 0.
*
Expand All @@ -70,7 +70,7 @@ public function getSetupFee()
{
return $this->setup_fee;
}

/**
* Redirect URL on cancellation of agreement request. 1000 characters max.
*
Expand All @@ -80,11 +80,13 @@ public function getSetupFee()
*/
public function setCancelUrl($cancel_url)
{
UrlValidator::validate($cancel_url, "CancelUrl");
if ($cancel_url !== null) {
UrlValidator::validate($cancel_url, "CancelUrl");
}
$this->cancel_url = $cancel_url;
return $this;
}

/**
* Redirect URL on cancellation of agreement request. 1000 characters max.
*
Expand All @@ -94,7 +96,7 @@ public function getCancelUrl()
{
return $this->cancel_url;
}

/**
* Redirect URL on creation of agreement request. 1000 characters max.
*
Expand All @@ -104,11 +106,13 @@ public function getCancelUrl()
*/
public function setReturnUrl($return_url)
{
UrlValidator::validate($return_url, "ReturnUrl");
if ($return_url!== null) {
UrlValidator::validate($return_url, "ReturnUrl");
}
$this->return_url = $return_url;
return $this;
}

/**
* Redirect URL on creation of agreement request. 1000 characters max.
*
Expand All @@ -118,7 +122,7 @@ public function getReturnUrl()
{
return $this->return_url;
}

/**
* Notify URL on agreement creation. 1000 characters max.
*
Expand All @@ -128,14 +132,13 @@ public function getReturnUrl()
*/
public function setNotifyUrl($notify_url)
{
if(!empty($notify_url)){
if ($notify_url !== null) {
UrlValidator::validate($notify_url, "NotifyUrl");
}

$this->notify_url = $notify_url;
return $this;
}

/**
* Notify URL on agreement creation. 1000 characters max.
*
Expand All @@ -145,20 +148,20 @@ public function getNotifyUrl()
{
return $this->notify_url;
}

/**
* Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts.
*
* @param string $max_fail_attempts
*
*
* @return $this
*/
public function setMaxFailAttempts($max_fail_attempts)
{
$this->max_fail_attempts = $max_fail_attempts;
return $this;
}

/**
* Total number of failed attempts allowed. Default is 0, representing an infinite number of failed attempts.
*
Expand All @@ -168,20 +171,20 @@ public function getMaxFailAttempts()
{
return $this->max_fail_attempts;
}

/**
* Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`.
*
* @param string $auto_bill_amount
*
*
* @return $this
*/
public function setAutoBillAmount($auto_bill_amount)
{
$this->auto_bill_amount = $auto_bill_amount;
return $this;
}

/**
* Allow auto billing for the outstanding amount of the agreement in the next cycle. Allowed values: `YES`, `NO`. Default is `NO`.
*
Expand All @@ -191,20 +194,20 @@ public function getAutoBillAmount()
{
return $this->auto_bill_amount;
}

/**
* Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue.
*
* @param string $initial_fail_amount_action
*
*
* @return $this
*/
public function setInitialFailAmountAction($initial_fail_amount_action)
{
$this->initial_fail_amount_action = $initial_fail_amount_action;
return $this;
}

/**
* Action to take if a failure occurs during initial payment. Allowed values: `CONTINUE`, `CANCEL`. Default is continue.
*
Expand All @@ -214,20 +217,20 @@ public function getInitialFailAmountAction()
{
return $this->initial_fail_amount_action;
}

/**
* Payment types that are accepted for this plan.
*
* @param string $accepted_payment_type
*
*
* @return $this
*/
public function setAcceptedPaymentType($accepted_payment_type)
{
$this->accepted_payment_type = $accepted_payment_type;
return $this;
}

/**
* Payment types that are accepted for this plan.
*
Expand All @@ -237,20 +240,20 @@ public function getAcceptedPaymentType()
{
return $this->accepted_payment_type;
}

/**
* char_set for this plan.
*
* @param string $char_set
*
*
* @return $this
*/
public function setCharSet($char_set)
{
$this->char_set = $char_set;
return $this;
}

/**
* char_set for this plan.
*
Expand All @@ -260,5 +263,5 @@ public function getCharSet()
{
return $this->char_set;
}

}

0 comments on commit f47fc83

Please sign in to comment.