-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3ca114b
commit 4c1514f
Showing
105 changed files
with
2,209 additions
and
2,192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 34 additions & 34 deletions
68
MangoPaySDK/tools/apiCardRegistrations.inc → MangoPay/ApiCardRegistrations.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,35 @@ | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for card registrations | ||
*/ | ||
class ApiCardRegistrations extends ApiBase { | ||
|
||
/** | ||
* Create new card registration | ||
* @param \MangoPay\CardRegistration $cardRegistration Card registration object to create | ||
* @return \MangoPay\CardRegistration Card registration object returned from API | ||
*/ | ||
public function Create($cardRegistration) { | ||
return $this->CreateObject('cardregistration_create', $cardRegistration, '\MangoPay\CardRegistration'); | ||
} | ||
|
||
/** | ||
* Get card registration | ||
* @param int $cardRegistrationId Card Registration identifier | ||
* @return \MangoPay\CardRegistration Card registration object returned from API | ||
*/ | ||
public function Get($cardRegistrationId) { | ||
return $this->GetObject('cardregistration_get', $cardRegistrationId, '\MangoPay\CardRegistration'); | ||
} | ||
|
||
/** | ||
* Update card registration | ||
* @param \MangoPay\CardRegistration $cardRegistration Card registration object to save | ||
* @return \MangoPay\CardRegistration Card registration object returned from API | ||
*/ | ||
public function Update($cardRegistration) { | ||
return $this->SaveObject('cardregistration_save', $cardRegistration, '\MangoPay\CardRegistration'); | ||
} | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for card registrations | ||
*/ | ||
class ApiCardRegistrations extends Libraries\ApiBase { | ||
|
||
/** | ||
* Create new card registration | ||
* @param \MangoPay\CardRegistration $cardRegistration Card registration object to create | ||
* @return \MangoPay\CardRegistration Card registration object returned from API | ||
*/ | ||
public function Create($cardRegistration) { | ||
return $this->CreateObject('cardregistration_create', $cardRegistration, '\MangoPay\CardRegistration'); | ||
} | ||
|
||
/** | ||
* Get card registration | ||
* @param int $cardRegistrationId Card Registration identifier | ||
* @return \MangoPay\CardRegistration Card registration object returned from API | ||
*/ | ||
public function Get($cardRegistrationId) { | ||
return $this->GetObject('cardregistration_get', $cardRegistrationId, '\MangoPay\CardRegistration'); | ||
} | ||
|
||
/** | ||
* Update card registration | ||
* @param \MangoPay\CardRegistration $cardRegistration Card registration object to save | ||
* @return \MangoPay\CardRegistration Card registration object returned from API | ||
*/ | ||
public function Update($cardRegistration) { | ||
return $this->SaveObject('cardregistration_save', $cardRegistration, '\MangoPay\CardRegistration'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,52 @@ | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for cards | ||
*/ | ||
class ApiCards extends ApiBase { | ||
|
||
/** | ||
* Get card | ||
* @param int $cardId Card identifier | ||
* @return \MangoPay\Card object returned from API | ||
*/ | ||
public function Get($cardId) { | ||
return $this->GetObject('card_get', $cardId, '\MangoPay\Card'); | ||
} | ||
|
||
/** | ||
* Update card | ||
* @param \MangoPay\Card $card Card object to save | ||
* @return \MangoPay\Card Card object returned from API | ||
*/ | ||
public function Update($card) { | ||
return $this->SaveObject('card_save', $card, '\MangoPay\Card'); | ||
} | ||
|
||
/** | ||
* WARNING!! | ||
* It's temporary entity and it will be removed in the future. | ||
* Please, contact with support before using these features or if you have any questions. | ||
* | ||
* Create new temporary payment card | ||
* @param \MangoPay\TemporaryPaymentCard $paymentCard Payment card object to create | ||
* @return \MangoPay\TemporaryPaymentCard Card registration object returned from API | ||
*/ | ||
public function CreateTemporaryPaymentCard($paymentCard) { | ||
return $this->CreateObject('temp_paymentcards_create', $paymentCard, '\MangoPay\TemporaryPaymentCard'); | ||
} | ||
|
||
/** | ||
* WARNING!! | ||
* It's temporary entity and it will be removed in the future. | ||
* Please, contact with support before using these features or if you have any questions. | ||
* | ||
* Get temporary payment card | ||
* @param string $paymentCardId Card identifier | ||
* @return \MangoPay\TemporaryPaymentCard object returned from API | ||
*/ | ||
public function GetTemporaryPaymentCard($paymentCardId) { | ||
return $this->GetObject('temp_paymentcards_get', $paymentCardId, '\MangoPay\TemporaryPaymentCard'); | ||
} | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for cards | ||
*/ | ||
class ApiCards extends Libraries\ApiBase { | ||
|
||
/** | ||
* Get card | ||
* @param int $cardId Card identifier | ||
* @return \MangoPay\Card object returned from API | ||
*/ | ||
public function Get($cardId) { | ||
return $this->GetObject('card_get', $cardId, '\MangoPay\Card'); | ||
} | ||
|
||
/** | ||
* Update card | ||
* @param \MangoPay\Card $card Card object to save | ||
* @return \MangoPay\Card Card object returned from API | ||
*/ | ||
public function Update($card) { | ||
return $this->SaveObject('card_save', $card, '\MangoPay\Card'); | ||
} | ||
|
||
/** | ||
* WARNING!! | ||
* It's temporary entity and it will be removed in the future. | ||
* Please, contact with support before using these features or if you have any questions. | ||
* | ||
* Create new temporary payment card | ||
* @param \MangoPay\TemporaryPaymentCard $paymentCard Payment card object to create | ||
* @return \MangoPay\TemporaryPaymentCard Card registration object returned from API | ||
*/ | ||
public function CreateTemporaryPaymentCard($paymentCard) { | ||
return $this->CreateObject('temp_paymentcards_create', $paymentCard, '\MangoPay\TemporaryPaymentCard'); | ||
} | ||
|
||
/** | ||
* WARNING!! | ||
* It's temporary entity and it will be removed in the future. | ||
* Please, contact with support before using these features or if you have any questions. | ||
* | ||
* Get temporary payment card | ||
* @param string $paymentCardId Card identifier | ||
* @return \MangoPay\TemporaryPaymentCard object returned from API | ||
*/ | ||
public function GetTemporaryPaymentCard($paymentCardId) { | ||
return $this->GetObject('temp_paymentcards_get', $paymentCardId, '\MangoPay\TemporaryPaymentCard'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 68 additions & 68 deletions
136
MangoPaySDK/tools/apiPayIns.inc → MangoPay/ApiPayIns.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for pay-ins | ||
*/ | ||
class ApiPayIns extends ApiBase { | ||
|
||
/** | ||
* Create new pay-in object | ||
* @param \MangoPay\PayIn $payIn \MangoPay\PayIn object | ||
* @return \MangoPay\PayIn Object returned from API | ||
*/ | ||
public function Create($payIn) { | ||
$paymentKey = $this->GetPaymentKey($payIn); | ||
$executionKey = $this->GetExecutionKey($payIn); | ||
return $this->CreateObject('payins_' . $paymentKey . '-' . $executionKey . '_create', $payIn, '\MangoPay\PayIn'); | ||
} | ||
|
||
/** | ||
* Get pay-in object | ||
* @param $payInId Pay-in identifier | ||
* @return \MangoPay\PayIn Object returned from API | ||
*/ | ||
public function Get($payInId) { | ||
return $this->GetObject('payins_get', $payInId, '\MangoPay\PayIn'); | ||
} | ||
|
||
/** | ||
* Create refund for pay-in object | ||
* @param type $payInId Pay-in identifier | ||
* @param \MangoPay\Refund $refund Refund object to create | ||
* @return \MangoPay\Refund Object returned by REST API | ||
*/ | ||
public function CreateRefund($payInId, $refund) { | ||
return $this->CreateObject('payins_createrefunds', $refund, '\MangoPay\Refund', $payInId); | ||
} | ||
|
||
/** | ||
* WARNING!! | ||
* It's temporary entity and it will be removed in the future. | ||
* Please, contact with support before using these features or if you have any questions. | ||
* | ||
* Create new temporary immediate pay-in | ||
* @param \MangoPay\TemporaryImmediatePayIn $immediatePayIn Immediate pay-in object to create | ||
* @return \MangoPay\TemporaryImmediatePayIn Immediate pay-in object returned from API | ||
*/ | ||
public function CreateTemporaryImmediatePayIn($immediatePayIn) { | ||
return $this->CreateObject('temp_immediatepayins_create', $immediatePayIn, '\MangoPay\TemporaryImmediatePayIn'); | ||
} | ||
|
||
private function GetPaymentKey($payIn) { | ||
|
||
if (!isset($payIn->PaymentDetails) || !is_object($payIn->PaymentDetails)) | ||
throw new Exception ('Payment is not defined or it is not object type'); | ||
|
||
$className = str_replace('MangoPay\\PayInPaymentDetails', '', get_class($payIn->PaymentDetails)); | ||
return strtolower($className); | ||
} | ||
|
||
private function GetExecutionKey($payIn) { | ||
|
||
if (!isset($payIn->ExecutionDetails) || !is_object($payIn->ExecutionDetails)) | ||
throw new Exception ('Execution is not defined or it is not object type'); | ||
|
||
$className = str_replace('MangoPay\\PayInExecutionDetails', '', get_class($payIn->ExecutionDetails)); | ||
return strtolower($className); | ||
} | ||
<?php | ||
namespace MangoPay; | ||
|
||
/** | ||
* Class to management MangoPay API for pay-ins | ||
*/ | ||
class ApiPayIns extends Libraries\ApiBase { | ||
|
||
/** | ||
* Create new pay-in object | ||
* @param \MangoPay\PayIn $payIn \MangoPay\PayIn object | ||
* @return \MangoPay\PayIn Object returned from API | ||
*/ | ||
public function Create($payIn) { | ||
$paymentKey = $this->GetPaymentKey($payIn); | ||
$executionKey = $this->GetExecutionKey($payIn); | ||
return $this->CreateObject('payins_' . $paymentKey . '-' . $executionKey . '_create', $payIn, '\MangoPay\PayIn'); | ||
} | ||
|
||
/** | ||
* Get pay-in object | ||
* @param $payInId Pay-in identifier | ||
* @return \MangoPay\PayIn Object returned from API | ||
*/ | ||
public function Get($payInId) { | ||
return $this->GetObject('payins_get', $payInId, '\MangoPay\PayIn'); | ||
} | ||
|
||
/** | ||
* Create refund for pay-in object | ||
* @param type $payInId Pay-in identifier | ||
* @param \MangoPay\Refund $refund Refund object to create | ||
* @return \MangoPay\Refund Object returned by REST API | ||
*/ | ||
public function CreateRefund($payInId, $refund) { | ||
return $this->CreateObject('payins_createrefunds', $refund, '\MangoPay\Refund', $payInId); | ||
} | ||
|
||
/** | ||
* WARNING!! | ||
* It's temporary entity and it will be removed in the future. | ||
* Please, contact with support before using these features or if you have any questions. | ||
* | ||
* Create new temporary immediate pay-in | ||
* @param \MangoPay\TemporaryImmediatePayIn $immediatePayIn Immediate pay-in object to create | ||
* @return \MangoPay\TemporaryImmediatePayIn Immediate pay-in object returned from API | ||
*/ | ||
public function CreateTemporaryImmediatePayIn($immediatePayIn) { | ||
return $this->CreateObject('temp_immediatepayins_create', $immediatePayIn, '\MangoPay\TemporaryImmediatePayIn'); | ||
} | ||
|
||
private function GetPaymentKey($payIn) { | ||
|
||
if (!isset($payIn->PaymentDetails) || !is_object($payIn->PaymentDetails)) | ||
throw new Libraries\Exception ('Payment is not defined or it is not object type'); | ||
|
||
$className = str_replace('MangoPay\\PayInPaymentDetails', '', get_class($payIn->PaymentDetails)); | ||
return strtolower($className); | ||
} | ||
|
||
private function GetExecutionKey($payIn) { | ||
|
||
if (!isset($payIn->ExecutionDetails) || !is_object($payIn->ExecutionDetails)) | ||
throw new Libraries\Exception ('Execution is not defined or it is not object type'); | ||
|
||
$className = str_replace('MangoPay\\PayInExecutionDetails', '', get_class($payIn->ExecutionDetails)); | ||
return strtolower($className); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.