From 6e695031d5c11b805cb0b5c2e61f5f30e3b73c92 Mon Sep 17 00:00:00 2001 From: Iulian Masar Date: Thu, 28 Mar 2024 11:04:16 +0200 Subject: [PATCH] added new params --- MangoPay/ApiCards.php | 2 +- MangoPay/CardValidation.php | 6 + MangoPay/LineItem.php | 5 + MangoPay/PayInPaymentDetailsPaypal.php | 49 ++- MangoPay/PayPalWebTracking.php | 26 ++ demos/api/config.php | 13 - demos/api/demo.css | 25 -- demos/api/demo.js | 5 - demos/api/form.php | 213 ----------- demos/api/htmlHelper.php | 335 ------------------ demos/api/index.php | 21 -- demos/api/menu.php | 160 --------- demos/paymentDirect/config.php | 12 - demos/paymentDirect/index.php | 45 --- demos/paymentDirect/js/script.js | 100 ------ demos/paymentDirect/non_js.php | 78 ---- demos/paymentDirect/payment.php | 90 ----- demos/paymentDirect/with_js.php | 105 ------ demos/transaction_report_for_cron.php | 59 --- demos/users_all.php | 30 -- demos/users_create.php | 50 --- demos/users_get.php | 37 -- demos/workflow/inc/config.php | 12 - demos/workflow/inc/mockStorage.php | 24 -- demos/workflow/index.php | 162 --------- demos/workflow/logo.png | Bin 5382 -> 0 bytes demos/workflow/scripts/bankaccount.php | 21 -- demos/workflow/scripts/card-reg-put.php | 10 - demos/workflow/scripts/card-reg.php | 34 -- demos/workflow/scripts/client.php | 17 - demos/workflow/scripts/end.php | 31 -- demos/workflow/scripts/intro.php | 26 -- demos/workflow/scripts/kyc.php | 21 -- .../scripts/payin-applepay-direct.php | 23 -- demos/workflow/scripts/payin-card-direct.php | 24 -- demos/workflow/scripts/payin-card-preauth.php | 20 -- .../scripts/payin-card-web-review.php | 5 - demos/workflow/scripts/payin-card-web.php | 25 -- .../scripts/payin-googlepay-direct.php | 23 -- demos/workflow/scripts/payout.php | 19 - demos/workflow/scripts/preauth.php | 18 - demos/workflow/scripts/refund-payin.php | 16 - demos/workflow/scripts/refund-transfer.php | 16 - demos/workflow/scripts/transfer.php | 17 - demos/workflow/scripts/user-create-legal.php | 15 - .../workflow/scripts/user-create-natural.php | 13 - demos/workflow/scripts/wallet-create.php | 10 - demos/workflow/scripts/wallet-create2.php | 11 - demos/workflow/style.css | 212 ----------- .../workflow/syntaxhighlighter/shBrushPhp.js | 88 ----- demos/workflow/syntaxhighlighter/shCore.js | 17 - .../syntaxhighlighter/shThemeDefault.css | 109 ------ tests/Cases/CardsTest.php | 2 + 53 files changed, 84 insertions(+), 2423 deletions(-) create mode 100644 MangoPay/PayPalWebTracking.php delete mode 100644 demos/api/config.php delete mode 100644 demos/api/demo.css delete mode 100644 demos/api/demo.js delete mode 100644 demos/api/form.php delete mode 100644 demos/api/htmlHelper.php delete mode 100644 demos/api/index.php delete mode 100644 demos/api/menu.php delete mode 100644 demos/paymentDirect/config.php delete mode 100644 demos/paymentDirect/index.php delete mode 100644 demos/paymentDirect/js/script.js delete mode 100644 demos/paymentDirect/non_js.php delete mode 100644 demos/paymentDirect/payment.php delete mode 100644 demos/paymentDirect/with_js.php delete mode 100644 demos/transaction_report_for_cron.php delete mode 100644 demos/users_all.php delete mode 100644 demos/users_create.php delete mode 100644 demos/users_get.php delete mode 100644 demos/workflow/inc/config.php delete mode 100644 demos/workflow/inc/mockStorage.php delete mode 100644 demos/workflow/index.php delete mode 100644 demos/workflow/logo.png delete mode 100644 demos/workflow/scripts/bankaccount.php delete mode 100644 demos/workflow/scripts/card-reg-put.php delete mode 100644 demos/workflow/scripts/card-reg.php delete mode 100644 demos/workflow/scripts/client.php delete mode 100644 demos/workflow/scripts/end.php delete mode 100644 demos/workflow/scripts/intro.php delete mode 100644 demos/workflow/scripts/kyc.php delete mode 100644 demos/workflow/scripts/payin-applepay-direct.php delete mode 100644 demos/workflow/scripts/payin-card-direct.php delete mode 100644 demos/workflow/scripts/payin-card-preauth.php delete mode 100644 demos/workflow/scripts/payin-card-web-review.php delete mode 100644 demos/workflow/scripts/payin-card-web.php delete mode 100644 demos/workflow/scripts/payin-googlepay-direct.php delete mode 100644 demos/workflow/scripts/payout.php delete mode 100644 demos/workflow/scripts/preauth.php delete mode 100644 demos/workflow/scripts/refund-payin.php delete mode 100644 demos/workflow/scripts/refund-transfer.php delete mode 100644 demos/workflow/scripts/transfer.php delete mode 100644 demos/workflow/scripts/user-create-legal.php delete mode 100644 demos/workflow/scripts/user-create-natural.php delete mode 100644 demos/workflow/scripts/wallet-create.php delete mode 100644 demos/workflow/scripts/wallet-create2.php delete mode 100644 demos/workflow/style.css delete mode 100644 demos/workflow/syntaxhighlighter/shBrushPhp.js delete mode 100644 demos/workflow/syntaxhighlighter/shCore.js delete mode 100644 demos/workflow/syntaxhighlighter/shThemeDefault.css diff --git a/MangoPay/ApiCards.php b/MangoPay/ApiCards.php index 19900d5e..33e3f484 100644 --- a/MangoPay/ApiCards.php +++ b/MangoPay/ApiCards.php @@ -70,7 +70,7 @@ public function GetTransactions($cardId, & $pagination = null, $filter = null, $ /** * Validate a card * @param $cardId - * @return \MangoPay\Card + * @return \MangoPay\CardValidation * @throws Libraries\Exception */ public function ValidateCard($cardId, $cardValidation) diff --git a/MangoPay/CardValidation.php b/MangoPay/CardValidation.php index 2c138cb1..e005a124 100644 --- a/MangoPay/CardValidation.php +++ b/MangoPay/CardValidation.php @@ -29,6 +29,12 @@ class CardValidation extends Libraries\EntityBase */ public $SecureModeNeeded; + /** + * The mode applied for the 3DS2 protocol for CB, Visa, and Mastercard + * @var string + */ + public $SecureMode; + /** * Ip Address * @var string diff --git a/MangoPay/LineItem.php b/MangoPay/LineItem.php index f3f01c8a..3b00a8fd 100644 --- a/MangoPay/LineItem.php +++ b/MangoPay/LineItem.php @@ -38,4 +38,9 @@ class LineItem extends Libraries\Dto * @var string */ public $Description; + + /** + * @var string + */ + public $Category; } diff --git a/MangoPay/PayInPaymentDetailsPaypal.php b/MangoPay/PayInPaymentDetailsPaypal.php index 2080f5aa..1f6cb221 100644 --- a/MangoPay/PayInPaymentDetailsPaypal.php +++ b/MangoPay/PayInPaymentDetailsPaypal.php @@ -14,17 +14,15 @@ class PayInPaymentDetailsPaypal extends Libraries\Dto implements PayInPaymentDet */ public $ShippingAddress; + + /// V2 /// + /** * PayPal buyer's email account * @var string - * @deprecated This property will be removed in the future due to the introduction of a new way to create PayPal PayIns */ public $PaypalBuyerAccountEmail; - - - /// V2 /// - /** * Custom description of the payment shown to the consumer when making payments and on the bank statement * @var string @@ -54,6 +52,47 @@ class PayInPaymentDetailsPaypal extends Libraries\Dto implements PayInPaymentDet */ public $Reference; + /** + * @var string + */ + public $CancelURL; + + /** + * @var string + */ + public $PaypalPayerID; + + /** + * @var string + */ + public $BuyerCountry; + + /** + * @var string + */ + public $BuyerFirstname; + + /** + * @var string + */ + public $BuyerLastname; + + /** + * @var string + */ + public $BuyerPhone; + + /** + * @var string + */ + public $PaypalOrderID; + + /** + * @var array + */ + public $Trackings; + + public function GetSubObjects() { $subObjects = parent::GetSubObjects(); diff --git a/MangoPay/PayPalWebTracking.php b/MangoPay/PayPalWebTracking.php new file mode 100644 index 00000000..ecc9303e --- /dev/null +++ b/MangoPay/PayPalWebTracking.php @@ -0,0 +1,26 @@ += 0 ? selectedModuleIndex : false, collapsible : true, heightStyle: "content" } ); - -}); \ No newline at end of file diff --git a/demos/api/form.php b/demos/api/form.php deleted file mode 100644 index a57d1f28..00000000 --- a/demos/api/form.php +++ /dev/null @@ -1,213 +0,0 @@ -Config->BaseUrl = MangoPayDemo_BaseUrl; - $api->Config->ClientId = MangoPayDemo_ClientId; - $api->Config->ClientPassword = MangoPayDemo_ClientPassword; - $api->Config->TemporaryFolder = MangoPayDemo_TemporaryFolder; - - $module = @$_GET['module']; - if (isset($module) && strpos($module, '$Sort') !== false) { - if (isset($_POST["_sort_"]) && !empty($_POST["_sort_"])){ - $sortFieldName = $_POST["_sort_"]; - $sortDirection = $_POST["_sort_direction_"]; - if (!isset($sortDirection)) { - $sortDirection = \MangoPay\SortDirection::ASC; - } - - $sorting = new \MangoPay\Sorting(); - $sorting->AddField($sortFieldName, $sortDirection); - } - } - - // normal cases - switch ($operation) { - case '|NoParams|': - $methodName = $subEntityName; - $apiResult = $api->$subApiName->$methodName(); - break; - case '|GetWalletTransactions|': - $pagination = HtmlHelper::getEntity('Pagination'); - $filter = null; - if (isset($filterName) && $filterName != ""){ - $filter = HtmlHelper::getEntity($filterName); - } - $apiResult = $api->$subApiName->GetWalletTransactions(null, null, $pagination, $filter); - - print '
';print_r($pagination);print '
'; - - break; - case '|EnumParams|': - $methodName = $subEntityName; - $enums = explode('$', $subSubEntityName); - if (count($enums) == 1){ - $apiResult = $api->$subApiName->$methodName($_POST[$enums[0]]); - } else if (count($enums) == 2) { - $apiResult = $api->$subApiName->$methodName($_POST[$enums[0]], $_POST[$enums[1]]); - } - break; - case '|EnumParamsList|': - $pagination = HtmlHelper::getEntity('Pagination'); - $filter = null; - if (isset($filterName) && $filterName != ""){ - $filter = HtmlHelper::getEntity($filterName); - } - $methodName = $subEntityName; - $enums = explode('$', $subSubEntityName); - if (count($enums) == 1){ - $apiResult = $api->$subApiName->$methodName($_POST[$enums[0]], $pagination, $filter); - } else if (count($enums) == 2) { - $apiResult = $api->$subApiName->$methodName($_POST[$enums[0]], $_POST[$enums[1]], $pagination, $filter); - } - break; - case 'Create': - $entity = HtmlHelper::getEntity($entityName); - $apiResult = $api->$subApiName->Create($entity); - break; - case 'Get': - $apiResult = $api->$subApiName->Get($entityId); - break; - case 'Save': - $entity = HtmlHelper::getEntity($entityName, $entityId); - $apiResult = $api->$subApiName->Update($entity); - break; - case 'SaveNoId': - $entity = HtmlHelper::getEntity($entityName); - $apiResult = $api->$subApiName->Update($entity); - break; - case 'All': - $pagination = HtmlHelper::getEntity('Pagination'); - $filter = null; - if (isset($filterName) && $filterName != "") - $filter = HtmlHelper::getEntity($filterName); - - if (isset($filter) && !isset($sorting)) - $apiResult = $api->$subApiName->GetAll($pagination, $filter); - else if (!isset($filter) && isset($sorting)) - $apiResult = $api->$subApiName->GetAll($pagination, $sorting); - else if (isset($filter) && isset($sorting)) - $apiResult = $api->$subApiName->GetAll($pagination, $filter, $sorting); - else - $apiResult = $api->$subApiName->GetAll($pagination); - - print '
';print_r($pagination);print '
'; - if (isset($sorting)) { - print '
Sort: ';print_r($sorting);print '
'; - } - break; - case 'CreateSubEntity': - $entity = HtmlHelper::getEntity($subEntityName); - $methodName = 'Create'. $subEntityName; - $apiResult = $api->$subApiName->$methodName($entityId, $entity); - break; - case 'CreateSubSubEntity': - $entity = HtmlHelper::getEntity($subEntityName); - $methodName = 'Create' . $subEntityName; - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId, $entity); - break; - case 'GetSubEntity': - $methodName = 'Get' . $subEntityName; - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId); - break; - case 'SaveSubEntity': - $entity = HtmlHelper::getEntity($subEntityName); - $methodName = 'Update' . $subEntityName; - $apiResult = $api->$subApiName->$methodName($subEntityId, $entity); - break; - case 'ListSubEntity': - case 'ListSubSubEntity': - $pagination = HtmlHelper::getEntity('Pagination'); - $methodName = $subEntityName; - $filter = null; - if (isset($filterName) && $filterName != "") - $filter = HtmlHelper::getEntity($filterName); - - if ($operation == 'ListSubSubEntity') { - if (isset($filter) && !isset($sorting)) - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId, $pagination, $filter); - else if (!isset($filter) && isset($sorting)) - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId, $pagination, null, $sorting); - else if (isset($filter) && isset($sorting)) - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId, $pagination, $filter, $sorting); - else - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId, $pagination); - }else{ - if (isset($filter) && !isset($sorting)) - $apiResult = $api->$subApiName->$methodName($entityId, $pagination, $filter); - else if (!isset($filter) && isset($sorting)) - $apiResult = $api->$subApiName->$methodName($entityId, $pagination, null, $sorting); - else if (isset($filter) && isset($sorting)) - $apiResult = $api->$subApiName->$methodName($entityId, $pagination, $filter, $sorting); - else - $apiResult = $api->$subApiName->$methodName($entityId, $pagination); - } - - print '
';print_r($pagination);print '
'; - if (isset($sorting)) - print '
Sort: ';print_r($_POST["_sort_"]);print '
'; - - break; - case 'CreatePageByFile': - $methodName = 'Create' . $subEntityName . 'FromFile'; - $apiResult = $api->$subApiName->$methodName($entityId, $subEntityId, $_FILES['page_file']); - break; - case 'ContestDispute': - $entity = HtmlHelper::getEntity($subEntityName); - $apiResult = $api->$subApiName->$operation($entityId, $entity); - break; - case 'CloseDispute': - $apiResult = $api->$subApiName->$operation($entityId); - break; - case 'Upload': - $entity = HtmlHelper::getEntity($subEntityName); - $apiResult = $api->$subApiName->$subSubEntityName($entity); - break; - case 'UploadFromFile': - $apiResult = $api->$subApiName->$subSubEntityName($_FILES['page_file']); - break; - } - - print '
';print_r($apiResult);print '
'; - - } catch (\MangoPay\Libraries\ResponseException $e) { - - echo '
\MangoPay\ResponseException: Code: ' . $e->getCode(); - echo '
Message: ' . $e->getMessage(); - - $details = $e->GetErrorDetails(); - if (!is_null($details)) - echo '

Details: '; print_r($details); - echo '
'; - - } catch (\MangoPay\Libraries\Exception $e) { - - echo '
\MangoPay\Exception: ' . $e->getMessage() . '
'; - - } - -} else { - HtmlHelper::renderForm($entityName, $operation, array($subEntityName, $subSubEntityName), $filterName); -} \ No newline at end of file diff --git a/demos/api/htmlHelper.php b/demos/api/htmlHelper.php deleted file mode 100644 index 022f2184..00000000 --- a/demos/api/htmlHelper.php +++ /dev/null @@ -1,335 +0,0 @@ - $subMenu) { - $key = array_search($module, $subMenu); - if ($key) { - echo '

' . $key . '

'; - return; - } - } - } - - public static function renderForm($entityName, $operation, $subEntityName, $filterName) { - - echo '
'; - echo ''; - - switch ($operation) { - case '|EnumParams|': - case '|EnumParamsList|': - $enums = explode('$', $subEntityName[1]); - foreach ($enums as $enum) { - echo ''; - echo ''; - } - if ($operation == '|EnumParams|'){ - break; - } - case 'All': - case '|GetWalletTransactions|': - if (isset($filterName) && $filterName != "") { - self::renderFormRow('Optional filters:'); - self::renderEntity($filterName); - } - - self::renderFormRow('Pagination:'); - self::renderEntity('Pagination'); - break; - case 'Create': - self::renderEntity($entityName); - break; - case 'Get': - case 'CloseDispute': - case 'Cancel': - self::renderId($entityName); - break; - case 'Save': - self::renderId($entityName); - self::renderEntity($entityName); - break; - case 'SaveNoId': - self::renderEntity($entityName); - break; - case 'CreateSubEntity': - self::renderId($entityName); - self::renderEntity($subEntityName[0]); - break; - case 'CreateSubSubEntity': - self::renderId($entityName); - self::renderId($subEntityName[1], 'IdSubEntity'); - self::renderEntity($subEntityName[0]); - break; - case 'GetSubEntity': - self::renderId($entityName); - self::renderId($subEntityName[0], 'IdSubEntity'); - break; - case 'SaveSubEntity': - self::renderId($entityName, 'IdSubEntity'); - self::renderId($subEntityName[0]); - self::renderEntity($subEntityName[0]); - break; - case 'ListSubEntity': - self::renderId($entityName); - if (isset($filterName) && $filterName != "") { - self::renderFormRow('Optional filters:'); - self::renderEntity($filterName); - } - - self::renderFormRow('Pagination:'); - self::renderEntity('Pagination'); - break; - case 'ListSubSubEntity': - self::renderId($entityName); - self::renderId($subEntityName[1], 'IdSubEntity'); - if (isset($filterName) && $filterName != "") { - self::renderFormRow('Optional filters:'); - self::renderEntity($filterName); - } - - self::renderFormRow('Pagination:'); - self::renderEntity('Pagination'); - break; - case 'CreatePageByFile': - self::renderId($entityName); - self::renderId($subEntityName[1], 'IdSubEntity'); - self::renderFormRow(''); - break; - case 'ContestDispute': - self::renderId($entityName, 'IdSubEntity'); - self::renderEntity($subEntityName[0]); - break; - case 'Upload': - self::renderEntity($subEntityName[0]); - break; - case 'UploadFromFile': - self::renderFormRow(''); - break; - } - - $module = @$_GET['module']; - if (isset($module) && strpos($module, '$Sort')) { - self::renderSort(); - } - - $buttonText = $operation; - if ($operation == "|NoParams|" || $operation == "|EnumParams|"){ - $buttonText = $subEntityName[0]; - } else if ($operation == "SaveNoId"){ - $buttonText = "Save"; - } - - echo ''; - echo '
'; - echo $enum; - echo ''; - self::renderEnum('\MangoPay\\' . $enum, $enum, ""); - echo '
'; - echo ''; - echo '
'; - } - - public static function renderEntity($entityName, $prefix = '') { - - $className = '\\MangoPay\\' . $entityName; - $entity = new $className(); - $blackList = $entity->GetReadOnlyProperties(); - $entityObject = new \ReflectionObject($entity); - - $module = @$_GET['module']; - $subObjects = $entity->GetSubObjects(); - $dependsObjects = $entity->GetDependsObjects(); - $depTypesInModule = explode(':', $module); - - $properties = $entityObject->getProperties(); - foreach ($properties as $property) { - - $name = $property->getName(); - - if (in_array($name, $blackList)) - continue; - - // is sub object? - $cls = @$subObjects[$name]; - if ($cls) { - self::renderEntity(str_replace('\\MangoPay\\', '', $cls), "$name:"); - continue; - } - - // is dependent object? - $handled = false; - foreach ($dependsObjects as $dep) { - if ($dep['_property_name'] == $name) { - foreach ($depTypesInModule as $dt) { - $cls = @$dep[$dt]; - if ($cls) { - self::renderEntity(str_replace('\\MangoPay\\', '', $cls), "$name:"); - $handled = true; - break; - } - } - break; - } - } - if ($handled) continue; - - // special fields - if ($entityName == 'Pagination' && in_array($name, array('Links', 'TotalPages', 'TotalItems'))) - continue; - - // normal fields - $value = ''; - if (isset($entity->$name)) - $value = $entity->$name; - - echo ''; - echo $prefix . $name . ':'; - if ($className == "\\MangoPay\\Hook" && $name == "EventType"){ - self::renderEnum("\\MangoPay\\EventType", $name, $prefix); - } elseif ($className == "\\MangoPay\\FilterEvents" && $name == "EventType"){ - self::renderEnum("\\MangoPay\\EventType", $name, $prefix); - } elseif ($className == "\\MangoPay\\KycDocument" && $name == "Type") { - self::renderEnum("\\MangoPay\\KycDocumentType", $name, $prefix); - } elseif ($className == "\\MangoPay\\KycDocument" && $name == "Status") { - self::renderEnum("\\MangoPay\\KycDocumentStatus", $name, $prefix); - } elseif ($className == "\\MangoPay\\Card" && $name == "Validity") { - self::renderEnum("\\MangoPay\\CardValidity", $name, $prefix); - } elseif ($className == "\\MangoPay\\DisputeDocument" && $name == "Type") { - self::renderEnum("\\MangoPay\\DisputeDocumentType", $name, $prefix); - } elseif ($className == "\\MangoPay\\DisputeDocument" && $name == "Status") { - self::renderEnum("\\MangoPay\\DisputeDocumentStatus", $name, $prefix); - } elseif ($className == "\\MangoPay\\ReportRequest" && $name == "ReportType") { - self::renderEnum("\\MangoPay\\ReportType", $name, $prefix); - } elseif ($className == "\\MangoPay\\PlatformCategorization" && $name == "BusinessType") { - self::renderEnum("\\MangoPay\\BusinessType", $name, $prefix); - } elseif ($className == "\\MangoPay\\PlatformCategorization" && $name == "Sector") { - self::renderEnum("\\MangoPay\\Sector", $name, $prefix); - } - else - echo ''; - echo ''; - } - } - - public static function renderEnum($enumClassName, $name, $prefix) { - - $enum = new $enumClassName(); - $enumObject = new \ReflectionObject($enum); - $constants = $enumObject->getConstants(); - - echo ''; - } - - public static function renderFormRow($label = null, $field = null) { - - echo ''; - echo $label ? $label : ' '; - echo ''; - echo $field ? $field : ' '; - echo ''; - } - - public static function renderId($entityName, $fieldName = 'Id') { - - $value = ''; - if (isset($_POST[$fieldName])) - $value = $_POST[$fieldName]; - - echo ''; - echo $entityName . ' Id:'; - echo ''; - } - - public static function renderSort(){ - - $value = ''; - if (isset($_POST["_sort_"])) - $value = $_POST["_sort_"]; - - echo ''; - echo 'Sort:'; - echo ''; - - echo ' '; - } - - public static function getEntity($entityName, $entityId = 0, $returnNullIfNoPropertyTouched = false, $prefix = '') { - $touchedAnyProp = false; - - $className = '\\MangoPay\\' . $entityName; - $entity = new $className($entityId); - - $entityObject = new \ReflectionObject($entity); - $properties = $entityObject->getProperties(); - - $module = @$_GET['module']; - $subObjects = $entity->GetSubObjects(); - $dependsObjects = $entity->GetDependsObjects(); - $depTypesInModule = explode(':', $module); - - foreach ($properties as $property) { - if (!$property->isPublic()) - continue; - - $name = $property->getName(); - - $frmName = $prefix . $name; - if (isset($_POST[$frmName]) && strlen($_POST[$frmName]) > 0) { - - // special fields for Owners property - if ($entityName == 'Wallet' && $name == 'Owners' - || $entityName == 'Client' && $name == 'TechEmails' - || $entityName == 'Client' && $name == 'AdminEmails' - || $entityName == 'Client' && $name == 'FraudEmails' - || $entityName == 'Client' && $name == 'BillingEmails'){ - - $entity->$name = explode(';', $_POST[$frmName]); - } - // special cast to int for Birthday property in UserNatural - // and UserLegal class - elseif (($entityName == 'UserNatural' && $name == 'Birthday') - || ($entityName == 'UserLegal' && $name == 'LegalRepresentativeBirthday')) - { - $entity->$name = (float)$_POST[$frmName]; - } - // normal fields - else - $entity->$name = $_POST[$frmName]; - - $touchedAnyProp = true; - } - } - - // sub objects - foreach ($subObjects as $name => $cls) { - $entity->$name = self::getEntity(str_replace('\\MangoPay\\', '', $cls), 0, true, "$name:"); - } - - // dependent objects - foreach ($dependsObjects as $dep) { - $name = $dep['_property_name']; - foreach ($depTypesInModule as $dt) { - $cls = @$dep[$dt]; - if ($cls) { - $entity->$name = self::getEntity(str_replace('\\MangoPay\\', '', $cls), 0, false, "$name:"); - break; - } - } - } - - if ($returnNullIfNoPropertyTouched && !$touchedAnyProp) - return null; - - return $entity; - } -} \ No newline at end of file diff --git a/demos/api/index.php b/demos/api/index.php deleted file mode 100644 index b1237ab3..00000000 --- a/demos/api/index.php +++ /dev/null @@ -1,21 +0,0 @@ - - - - - MangoPay API - demo - - - - - - - - - - - - - -
- - diff --git a/demos/api/menu.php b/demos/api/menu.php deleted file mode 100644 index 68ef5e78..00000000 --- a/demos/api/menu.php +++ /dev/null @@ -1,160 +0,0 @@ - array( - 'Create natural user' => 'UserNatural_Users_Create', - 'Create legal user' => 'UserLegal_Users_Create', - 'Get user' => 'User_Users_Get', - 'Get all users' => 'User_Users_All___$Sort', - 'Save natural user' => 'UserNatural_Users_Save', - 'Save legal user' => 'UserLegal_Users_Save', - 'Save legal user' => 'UserLegal_Users_Save', - ), - 'Bank accounts' => array( - 'Create IBAN account' => 'User_Users_CreateSubEntity_BankAccount_:IBAN', - 'Create GB account' => 'User_Users_CreateSubEntity_BankAccount_:GB', - 'Create US account' => 'User_Users_CreateSubEntity_BankAccount_:US', - 'Create CA account' => 'User_Users_CreateSubEntity_BankAccount_:CA', - 'Create OTHER account' => 'User_Users_CreateSubEntity_BankAccount_:OTHER', - 'Get bank account for user' => 'User_Users_GetSubEntity_BankAccount', - 'List bank accounts for user' => 'User_Users_ListSubEntity_GetBankAccounts__$Sort', - ), - 'Wallets' => array( - 'Create wallet' => 'Wallet_Wallets_Create', - 'Get wallet' => 'Wallet_Wallets_Get', - 'Save wallet' => 'Wallet_Wallets_Save', - 'List wallets for user' => 'User_Users_ListSubEntity_GetWallets__$Sort', - ), - 'Transactions' => array( - 'List transactions for user' => 'User_Users_ListSubEntity_GetTransactions_FilterTransactions__$Sort', - 'List transactions for wallet' => 'Wallet_Wallets_ListSubEntity_GetTransactions_FilterTransactions__$Sort', - ), - 'Transfers' => array( - 'Create transfer' => 'Transfer_Transfers_Create', - 'Get transfer' => 'Transfer_Transfers_Get', - ), - 'Pay-ins' => array( - 'Create pay-in web card' => 'PayIn_PayIns_Create_:CARD:WEB', - 'Create pay-in direct card' => 'PayIn_PayIns_Create_:CARD:DIRECT', - 'Create pay-in direct pre-authorized' => 'PayIn_PayIns_Create_:PREAUTHORIZED:DIRECT', - 'Create pay-in direct bank wire' => 'PayIn_PayIns_Create_:BANK_WIRE:DIRECT', - 'Create pay-in direct debit web' => 'PayIn_PayIns_Create_:DIRECT_DEBIT:WEB', - 'Create pay-in direct debit direct' => 'PayIn_PayIns_Create_:DIRECT_DEBIT:DIRECT', - 'Create pay-in PayPal' => 'PayIn_PayIns_Create_:PAYPAL:WEB', - 'Get pay-in' => 'PayIn_PayIns_Get', - ), - 'Pay-outs' => array( - 'Create pay-out bank wire' => 'PayOut_PayOuts_Create_:BANK_WIRE', - 'Get pay-out bank wire' => 'PayOut_PayOuts_Get_:BANK_WIRE', - ), - 'Refunds' => array( - 'Create refund for transfer' => 'Transfer_Transfers_CreateSubEntity_Refund', - 'Create refund for pay-in' => 'PayIn_PayIns_CreateSubEntity_Refund', - 'Get refund' => 'Refund_Refunds_Get', - ), - 'Card registration' => array( - 'Create card registration' => 'CardRegistration_CardRegistrations_Create', - 'Get card registration' => 'CardRegistration_CardRegistrations_Get', - 'Update card registration' => 'CardRegistration_CardRegistrations_Save', - ), - 'Card pre-authorization' => array( - 'Create pre-authorization' => 'CardPreAuthorization_CardPreAuthorizations_Create', - 'Get pre-authorization' => 'CardPreAuthorization_CardPreAuthorizations_Get', - 'Update pre-authorization' => 'CardPreAuthorization_CardPreAuthorizations_Save', - ), - 'Card' => array( - 'Get card' => 'Card_Cards_Get', - 'Save card' => 'Card_Cards_Save', - 'List cards for user' => 'User_Users_ListSubEntity_GetCards__$Sort', - ), - 'Event' => array( - 'List events' => 'Event_Events_All__FilterEvents__$Sort', - ), - 'Hooks' => array( - 'Create hook' => 'Hook_Hooks_Create', - 'Get hook' => 'Hook_Hooks_Get', - 'Save hook' => 'Hook_Hooks_Save', - 'List of hooks' => 'Hook_Hooks_All', - ), - 'KYC' => array( - 'Create KYC document' => 'User_Users_CreateSubEntity_KycDocument', - 'Get KYC document' => 'User_Users_GetSubEntity_KycDocument', - 'Save KYC document' => 'User_Users_SaveSubEntity_KycDocument', - 'Create page for KYC from base64' => 'User_Users_CreateSubSubEntity_KycPage__KycDocument', - 'Create page for KYC from file' => 'User_Users_CreatePageByFile_KycPage__KycDocument', - 'List KYC documents for user' => 'User_Users_ListSubEntity_GetKycDocuments__$Sort', - 'List all KYC documents' => 'KycDocument_KycDocuments_All___$Sort', - ), - 'Disputes' => array( - 'Get dispute' => 'Dispute_Disputes_Get', - 'Get all disputes' => 'Dispute_Disputes_All___$Sort', - 'Save tag disputes' => 'Dispute_Disputes_Save', - 'Save contest dispute' => 'Dispute_Disputes_ContestDispute_Money', - 'Close dispute' => 'Dispute_Disputes_CloseDispute', - 'Get transactions' => 'Dispute_Disputes_ListSubEntity_GetTransactions__$Sort', - 'Get disputes for wallet' => 'Wallet_Disputes_ListSubEntity_GetDisputesForWallet__$Sort', - 'Get disputes for user' => 'User_Disputes_ListSubEntity_GetDisputesForUser__$Sort', - ), - 'Dispute documents' => array( - 'Create dispute document' => 'Dispute_Disputes_CreateSubEntity_DisputeDocument', - 'Get dispute document' => 'DisputeDocument_DisputeDocuments_Get', - 'Save dispute document' => 'Dispute_Disputes_SaveSubEntity_DisputeDocument', - 'Create page for dispute document from base64' => 'Dispute_Disputes_CreateSubSubEntity_DisputeDocumentPage__DisputeDocument', - 'Create page for dispute document from file' => 'Dispute_Disputes_CreatePageByFile_DisputeDocumentPage__DisputeDocument', - 'List all dispute documents' => 'DisputeDocument_DisputeDocuments_All___$Sort', - 'List dispute documents for dispute' => 'Dispute_Disputes_ListSubEntity_GetDocumentsForDispute__$Sort', - ), - 'Mandates' => array( - 'Create mandate' => 'Mandate_Mandates_Create', - 'Get mandate' => 'Mandate_Mandates_Get', - 'Cancel mandate' => 'Mandate_Mandates_Cancel', - 'List of mandates' => 'Mandate_Mandates_All__FilterTransactions___$Sort', - 'List mandate for user' => 'User_Users_ListSubEntity_GetMandates_FilterTransactions_$Sort', - 'List mandate for user and for bank account' => 'User_Users_ListSubSubEntity_GetMandatesForBankAccount_FilterTransactions_BankAccount___$Sort', - ), - 'Client' => array( - 'Get client information' => 'Client_Clients_|NoParams|_Get', - 'Update client' => 'Client_Clients_SaveNoId', - 'Upload logo from base64' => 'Client_Clients_Upload_ClientLogoUpload__UploadLogo', - 'Upload logo from file' => 'Client_Clients_UploadFromFile___UploadLogoFromFile', - 'View your client wallets' => 'Wallet_Clients_|NoParams|_GetWallets', - 'View your fees/credit wallets for each currency' => 'Wallet_Clients_|EnumParams|_GetWallets__FundsType', - 'View one wallets (fees or credit) with a particular currency' => 'Wallet_Clients_|EnumParams|_GetWallet__FundsType$CurrencyIso', - 'View the transactions linked to your client wallets (fees and credit)' => 'Wallet_Clients_|GetWalletTransactions|', - 'View the transactions linked to one of your client wallets (fees or credit) with a particular currency' => 'Wallet_Clients_|EnumParamsList|_GetWalletTransactions_FilterTransactions_FundsType$CurrencyIso', - ), - 'Reports' => array( - 'Create report request' => 'ReportRequest_Reports_Create', - 'Get report request' => 'ReportRequest_Reports_Get', - 'List all report request' => 'ReportRequest_Reports_All__FilterReports__$Sort', - //'List transactions for wallet' => 'Wallet_Wallets_ListSubEntity_GetTransactions_FilterTransactions__$Sort', - ), - 'Responses' => array( - 'Get responses' => 'Response_Responses_Get' - ), -); - -?> - - - \ No newline at end of file diff --git a/demos/paymentDirect/config.php b/demos/paymentDirect/config.php deleted file mode 100644 index 03414c8b..00000000 --- a/demos/paymentDirect/config.php +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - Payment Direct - demo - - - - - Using JavaScript Kit     - Without JavaScript -
- - Without JavaSctipt'; - include "non_js.php"; - } elseif($_GET['mode'] == 'JS') { - print '

Using JavaSctipt Kit

'; - include "with_js.php"; - } - } - ?> - - diff --git a/demos/paymentDirect/js/script.js b/demos/paymentDirect/js/script.js deleted file mode 100644 index cae035e8..00000000 --- a/demos/paymentDirect/js/script.js +++ /dev/null @@ -1,100 +0,0 @@ -$(document).ready(function(){ - - // Initialize mangoPay.cardRegistration object - mangoPay.cardRegistration.init({ - cardRegistrationURL : cardRegistrationURL, - preregistrationData : preregistrationData, - accessKey : accessKey, - Id : cardRegistrationId - }); - - // Action for button "Pay with Ajax" - $("#payAjax").click(function() { - - // Disable button to prevent double click while waiting - $("#payAjax").attr("disabled", true).val("Please wait..."); - - runCardRegAjax(); - - }); - - // Action for button "Pay with Ajax or Redirect" - $("#payAjaxOrRedirect").click(function(){ - - // Disable button to prevent double click while waiting - $("#payAjaxOrRedirect").attr("disabled", true).val("Please wait..."); - - if(mangoPay.browser.corsSupport()) { - runCardRegAjax(); - return; - } - - runCardRegReturnUrl(); - - }); - - // Action for button "Pay with Redirect" - $("#payRedirect").click(function() { - - runCardRegReturnUrl(); - - }); -}); - - -function runCardRegAjax() { - // Collect sensitive card data from the form - var cardData = getCardData(); - - // Process data - mangoPay.cardRegistration.registerCard(cardData, - function(res) { - var message = 'Card has been succesfully registered under the Card Id ' + res.CardId + '.
'; - message += 'Card is now ready to use e.g. in a «Direct PayIn» Object.'; - $("#divForm").html(message); - }, - function(res){ - alert("Error occured while registering the card: " + "ResultCode: " + res.ResultCode + ", ResultMessage: " + res.ResultMessage); - } - ); -} - -function runCardRegReturnUrl() { - - var cardData = getCardData(); - - // Build the form and append to the document - var form = document.createElement('form'); - form.setAttribute('action', cardRegistrationURL); - form.setAttribute('method', 'post'); - form.setAttribute('style', 'display: none'); - document.getElementsByTagName('body')[0].appendChild(form); - - // Add card registration data to the form - form.appendChild(getInputElement('data', preregistrationData)); - form.appendChild(getInputElement('accessKeyRef', accessKey)); - form.appendChild(getInputElement('cardNumber', cardData.cardNumber)); - form.appendChild(getInputElement('cardExpirationDate', cardData.cardExpirationDate)); - form.appendChild(getInputElement('cardCvx', cardData.cardCvx)); - form.appendChild(getInputElement('returnURL', redirectUrl)); - - // Submit the form - form.submit(); -} - -function getCardData() { - return { - cardNumber : $("#paymentForm").find("input[name$='cardNumber']").val(), - cardExpirationDate : $("#paymentForm").find("input[name$='cardExpirationDate']").val(), - cardCvx : $("#paymentForm").find("input[name$='cardCvx']").val(), - cardType : cardType - }; -} - -function getInputElement(name, value) { - var input = document.createElement('input'); - input.setAttribute('type', 'hidden'); - input.setAttribute('name', name); - input.setAttribute('value', value); - return input; -} \ No newline at end of file diff --git a/demos/paymentDirect/non_js.php b/demos/paymentDirect/non_js.php deleted file mode 100644 index 15295be3..00000000 --- a/demos/paymentDirect/non_js.php +++ /dev/null @@ -1,78 +0,0 @@ -Config->ClientId = MangoPayDemo_ClientId; -$mangoPayApi->Config->ClientPassword = MangoPayDemo_ClientPassword; -$mangoPayApi->Config->TemporaryFolder = MangoPayDemo_TemporaryFolder; - -// create user for payment -$user = new MangoPay\UserNatural(); -$user->FirstName = 'John'; -$user->LastName = 'Smith'; -$user->Email = 'email@domain.com'; -$user->Birthday = time(); -$user->Nationality = 'FR'; -$user->CountryOfResidence = 'FR'; -$user->Occupation = "programmer"; -$user->IncomeRange = 3; -$createdUser = $mangoPayApi->Users->Create($user); - -// register card -$cardRegister = new \MangoPay\CardRegistration(); -$cardRegister->UserId = $createdUser->Id; -$cardRegister->Currency = $_SESSION['currency']; -$cardRegister->CardType = $_SESSION['cardType']; -$createdCardRegister = $mangoPayApi->CardRegistrations->Create($cardRegister); -$_SESSION['cardRegisterId'] = $createdCardRegister->Id; - -// build the return URL to capture token response -$returnUrl = 'http' . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST']; -$returnUrl .= substr($_SERVER['REQUEST_URI'], 0, strripos($_SERVER['REQUEST_URI'], '/') + 1); -$returnUrl .= 'payment.php'; - -?> - -

- - Shows how to register the card without using JavaScript
- and process payments with page reload. -
-

- - - -
- - - -
- -
- - - - - - -
- - - -
- - - -
- - -
diff --git a/demos/paymentDirect/payment.php b/demos/paymentDirect/payment.php deleted file mode 100644 index b35e0ec1..00000000 --- a/demos/paymentDirect/payment.php +++ /dev/null @@ -1,90 +0,0 @@ -No payment has been started
'); -} - -// create instance of MangoPayApi -$mangoPayApi = new \MangoPay\MangoPayApi(); -$mangoPayApi->Config->ClientId = MangoPayDemo_ClientId; -$mangoPayApi->Config->ClientPassword = MangoPayDemo_ClientPassword; -$mangoPayApi->Config->TemporaryFolder = MangoPayDemo_TemporaryFolder; - -try { - // update register card with registration data from Payline service - $cardRegister = $mangoPayApi->CardRegistrations->Get($_SESSION['cardRegisterId']); - $cardRegister->RegistrationData = isset($_GET['data']) ? 'data=' . $_GET['data'] : 'errorCode=' . $_GET['errorCode']; - $updatedCardRegister = $mangoPayApi->CardRegistrations->Update($cardRegister); - - if ($updatedCardRegister->Status != \MangoPay\CardRegistrationStatus::Validated || !isset($updatedCardRegister->CardId)) - die('
Cannot create card. Payment has not been created.
'); - - // get created virtual card object - $card = $mangoPayApi->Cards->Get($updatedCardRegister->CardId); - - // create temporary wallet for user - $wallet = new \MangoPay\Wallet(); - $wallet->Owners = array( $updatedCardRegister->UserId ); - $wallet->Currency = $_SESSION['currency']; - $wallet->Description = 'Temporary wallet for payment demo'; - $createdWallet = $mangoPayApi->Wallets->Create($wallet); - - // create pay-in CARD DIRECT - $payIn = new \MangoPay\PayIn(); - $payIn->CreditedWalletId = $createdWallet->Id; - $payIn->AuthorId = $updatedCardRegister->UserId; - $payIn->DebitedFunds = new \MangoPay\Money(); - $payIn->DebitedFunds->Amount = $_SESSION['amount']; - $payIn->DebitedFunds->Currency = $_SESSION['currency']; - $payIn->Fees = new \MangoPay\Money(); - $payIn->Fees->Amount = 0; - $payIn->Fees->Currency = $_SESSION['currency']; - - // payment type as CARD - $payIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsCard(); - $payIn->PaymentDetails->CardType = $card->CardType; - $payIn->PaymentDetails->CardId = $card->Id; - - // execution type as DIRECT - $payIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect(); - $payIn->ExecutionDetails->SecureModeReturnURL = 'http://test.com'; - - // create Pay-In - $createdPayIn = $mangoPayApi->PayIns->Create($payIn); - - // if created Pay-in object has status SUCCEEDED it's mean that all is fine - if ($createdPayIn->Status == \MangoPay\PayInStatus::Succeeded) { - print '
'. - 'Pay-In has been created successfully. ' - .'Pay-In Id = ' . $createdPayIn->Id - . ', Wallet Id = ' . $createdWallet->Id - . '
'; - } - else { - // if created Pay-in object has status different than SUCCEEDED - // that occurred error and display error message - print '
'. - 'Pay-In has been created with status: ' - . $createdPayIn->Status . ' (result code: ' - . $createdPayIn->ResultCode . ')' - .'
'; - } - -} catch (\MangoPay\Libraries\ResponseException $e) { - - print '
' - .'\MangoPay\ResponseException: Code: ' - . $e->getCode() . '
Message: ' . $e->getMessage() - .'

Details: '; print_r($e->GetErrorDetails()) - .'
'; -} - -// clear data in session to protect against double processing -$_SESSION = array(); diff --git a/demos/paymentDirect/with_js.php b/demos/paymentDirect/with_js.php deleted file mode 100644 index 36fcaec6..00000000 --- a/demos/paymentDirect/with_js.php +++ /dev/null @@ -1,105 +0,0 @@ -Config->ClientId = MangoPayDemo_ClientId; -$mangoPayApi->Config->ClientPassword = MangoPayDemo_ClientPassword; -$mangoPayApi->Config->TemporaryFolder = MangoPayDemo_TemporaryFolder; - -// create user for payment -$user = new MangoPay\UserNatural(); -$user->FirstName = 'John'; -$user->LastName = 'Smith'; -$user->Email = 'email@domain.com'; -$user->Birthday = time(); -$user->Nationality = 'FR'; -$user->CountryOfResidence = 'FR'; -$user->Occupation = "programmer"; -$user->IncomeRange = 3; -$createdUser = $mangoPayApi->Users->Create($user); - -// register card -$cardRegister = new \MangoPay\CardRegistration(); -$cardRegister->UserId = $createdUser->Id; -$cardRegister->Currency = $_SESSION['currency']; -$cardRegister->CardType = $_SESSION['cardType']; -$createdCardRegister = $mangoPayApi->CardRegistrations->Create($cardRegister); -$_SESSION['cardRegisterId'] = $createdCardRegister->Id; - -// build the return URL to capture token response if browser does not support cross-domain Ajax requests -$returnUrl = 'http' . ( isset($_SERVER['HTTPS']) ? 's' : '' ) . '://' . $_SERVER['HTTP_HOST']; -$returnUrl .= substr($_SERVER['REQUEST_URI'], 0, strripos($_SERVER['REQUEST_URI'], '/') + 1); -$returnUrl .= 'payment.php'; - -?> - - - - - - - -

- - Shows how to register the card using JavaScript Kit
- and process payments asynchronously or with page reload. -
-

- -
- - -
- - - -
- -
- - -
- - - -
- - - -
-
- - -
-
- - -
-
- - -
- -
- -
diff --git a/demos/transaction_report_for_cron.php b/demos/transaction_report_for_cron.php deleted file mode 100644 index 56a15dcc..00000000 --- a/demos/transaction_report_for_cron.php +++ /dev/null @@ -1,59 +0,0 @@ -Reports->Get($reportId); - if ($getReportRequest->Status=="PENDING") { - - sleep(1); #TODO use the reporting `CallbackURL` functionality instead of this! - return getReportAndEmail($reportId); - - }elseif($getReportRequest->Status=="READY_FOR_DOWNLOAD") { - - mail("reporting_team@mycompany.com", "Yesterday's successful transaction report", "The report can be downloaded from ".$getReportRequest->DownloadURL.". Note that this link will expire in 24 hours."); - return true; - - }else{ - die("There was an error..."); - } - -} - -try { - - // create object to manage MangoPay API - $api = new MangoPay\MangoPayApi(); - // use test client credentails (REPLACE IT BY YOUR CLIENT ONES!) - $api->Config->ClientId = 'sdk_example'; - $api->Config->ClientPassword = 'Vfp9eMKSzGkxivCwt15wE082pTTKsx90vBenc9hjLsf5K46ciF'; - $api->Config->TemporaryFolder = '/a/writable/folder/somewhere/ideally-out-of-reach-of-your-root/'; - - - $reportRequest = new \MangoPay\ReportRequest(); - $reportRequest->ReportType = \MangoPay\ReportType::Transactions; - $reportRequest->Filters = new \MangoPay\FilterReports(); - $reportRequest->Filters->ResultCode = array("000000"); - $reportRequest->Filters->Status = array("SUCCEEDED"); - $reportRequest->Filters->BeforeDate = time(); - $reportRequest->Filters->AfterDate = strtotime("-1 day"); - $reportRequest->Filters->Type = array("PAYIN"); - $reportRequest->Columns = array("CreationDate:ISO", "ExecutionDate:ISO", "AuthorId", "CreditedWalletId", "Type", "Nature"); - - $createReportRequest = $mangoPayApi->Reports->Create($reportRequest); - - getReportAndEmail($createReportRequest->Id); - -} catch (MangoPay\Libraries\ResponseException $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\ResponseException Code', $e->GetCode()); - MangoPay\Libraries\Logs::Debug('Message', $e->GetMessage()); - MangoPay\Libraries\Logs::Debug('Details', $e->GetErrorDetails()); - -} catch (MangoPay\Libraries\Exception $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\Exception Message', $e->GetMessage()); -} diff --git a/demos/users_all.php b/demos/users_all.php deleted file mode 100644 index d6d5adbc..00000000 --- a/demos/users_all.php +++ /dev/null @@ -1,30 +0,0 @@ -Config->ClientId = 'sdk_example'; - $api->Config->ClientPassword = 'Vfp9eMKSzGkxivCwt15wE082pTTKsx90vBenc9hjLsf5K46ciF'; - $api->Config->TemporaryFolder = '/a/writable/folder/somewhere/ideally-out-of-reach-of-your-root/'; - - // GET USERS LIST: GET /users - $pagination = new MangoPay\Pagination(1, 8); - $users = $api->Users->GetAll($pagination); - - // display result on screen - MangoPay\Libraries\Logs::Debug('PAGINATION OBJECT', $pagination); - MangoPay\Libraries\Logs::Debug('LIST WITH USERS', $users); - -} catch (MangoPay\Libraries\ResponseException $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\ResponseException Code', $e->GetCode()); - MangoPay\Libraries\Logs::Debug('Message', $e->GetMessage()); - MangoPay\Libraries\Logs::Debug('Details', $e->GetErrorDetails()); - -} catch (MangoPay\Libraries\Exception $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\Exception Message', $e->GetMessage()); -} \ No newline at end of file diff --git a/demos/users_create.php b/demos/users_create.php deleted file mode 100644 index cb22bd67..00000000 --- a/demos/users_create.php +++ /dev/null @@ -1,50 +0,0 @@ -Config->ClientId = 'sdk_example'; - $api->Config->ClientPassword = 'Vfp9eMKSzGkxivCwt15wE082pTTKsx90vBenc9hjLsf5K46ciF'; - $api->Config->TemporaryFolder = '/a/writable/folder/somewhere/ideally-out-of-reach-of-your-root/'; - - // CREATE NATURAL USER - $naturalUser = new MangoPay\UserNatural(); - $naturalUser->Email = 'test_natural@testmangopay.com'; - $naturalUser->FirstName = "Bob"; - $naturalUser->LastName = "Briant"; - $naturalUser->Birthday = 121271; - $naturalUser->Nationality = "FR"; - $naturalUser->CountryOfResidence = "ZA"; - $naturalUserResult = $api->Users->Create($naturalUser); - // display result - MangoPay\Libraries\Logs::Debug('CREATED NATURAL USER', $naturalUserResult); - - // CREATE LEGAL USER - $legalUser = new MangoPay\UserLegal(); - $legalUser->Name = 'Name Legal Test'; - $legalUser->LegalPersonType = \MangoPay\LegalPersonType::Business; - $legalUser->Email = 'legal@testmangopay.com'; - $legalUser->LegalRepresentativeFirstName = "Bob"; - $legalUser->LegalRepresentativeLastName = "Briant"; - $legalUser->LegalRepresentativeBirthday = 121271; - $legalUser->LegalRepresentativeNationality = "FR"; - $legalUser->LegalRepresentativeCountryOfResidence = "ZA"; - $legalUserResult = $api->Users->Create($legalUser); - // display result - MangoPay\Libraries\Logs::Debug('CREATED LEGAL USER', $legalUserResult); - -} catch (MangoPay\Libraries\ResponseException $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\ResponseException Code', $e->GetCode()); - MangoPay\Libraries\Logs::Debug('Message', $e->GetMessage()); - MangoPay\Libraries\Logs::Debug('Details', $e->GetErrorDetails()); - -} catch (MangoPay\Libraries\Exception $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\Exception Message', $e->GetMessage()); -} - - diff --git a/demos/users_get.php b/demos/users_get.php deleted file mode 100644 index 161f310d..00000000 --- a/demos/users_get.php +++ /dev/null @@ -1,37 +0,0 @@ -Config->ClientId = 'sdk_example'; - $api->Config->ClientPassword = 'Vfp9eMKSzGkxivCwt15wE082pTTKsx90vBenc9hjLsf5K46ciF'; - $api->Config->TemporaryFolder = '/a/writable/folder/somewhere/ideally-out-of-reach-of-your-root/'; - - // GET NATURAL USER: GET /users/natural/4991600 - $naturalUserResult = $api->Users->GetNatural(4991600); - // display result on screen - MangoPay\Libraries\Logs::Debug('READ NATURAL USER', $naturalUserResult); - - // GET LEGAL USER: GET /users/legal/4991601 - $legalUserResult = $api->Users->GetLegal(4991601); - // display result on screen - MangoPay\Libraries\Logs::Debug('READ LEGAL USER', $legalUserResult); - - // GET NATURAL USER GET /users/4991600 - $userResult = $api->Users->Get(4991600); - // display result on screen - MangoPay\Libraries\Logs::Debug('READ USER', $userResult); - -} catch (MangoPay\Libraries\ResponseException $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\ResponseException Code', $e->GetCode()); - MangoPay\Libraries\Logs::Debug('Message', $e->GetMessage()); - MangoPay\Libraries\Logs::Debug('Details', $e->GetErrorDetails()); - -} catch (MangoPay\Libraries\Exception $e) { - - MangoPay\Libraries\Logs::Debug('MangoPay\Exception Message', $e->GetMessage()); -} \ No newline at end of file diff --git a/demos/workflow/inc/config.php b/demos/workflow/inc/config.php deleted file mode 100644 index 27bd6bbe..00000000 --- a/demos/workflow/inc/config.php +++ /dev/null @@ -1,12 +0,0 @@ -Config->ClientId = MangoPayAPIClientId; -$mangoPayApi->Config->ClientPassword = MangoPayAPIPassword; -//$mangoPayApi->Config->TemporaryFolder = __dir__; -$mangoPayApi->OAuthTokenManager->RegisterCustomStorageStrategy(new \MangoPay\DemoWorkflow\MockStorageStrategy()); \ No newline at end of file diff --git a/demos/workflow/inc/mockStorage.php b/demos/workflow/inc/mockStorage.php deleted file mode 100644 index 6e29114a..00000000 --- a/demos/workflow/inc/mockStorage.php +++ /dev/null @@ -1,24 +0,0 @@ -"Welcome", "file"=>"intro.php", "docsLink"=>""); -$steps[] = array("step"=>"Setup Client credentials", "file"=>"client.php", "docsLink"=>"#"); -$steps[] = array("step"=>"Create Natural User", "file"=>"user-create-natural.php", "docsLink"=>"users#e255_create-a-natural-user"); -$steps[] = array("step"=>"Create Wallet for Natural User", "file"=>"wallet-create.php", "docsLink"=>"wallets/"); -$steps[] = array("step"=>"Create Legal User", "file"=>"user-create-legal.php", "docsLink"=>"users#e259_create-a-legal-user"); -$steps[] = array("step"=>"Create Wallet for Legal User", "file"=>"wallet-create2.php", "docsLink"=>"wallets/"); -$steps[] = array("step"=>"Create PayIn Card Web", "file"=>"payin-card-web.php", "docsLink"=>"payins#e269_create-a-card-web-payin"); -$steps[] = array("step"=>"Review PayIn Card Web", "file"=>"payin-card-web-review.php", "checkResult"=>true, "docsLink"=>"payins/"); -$steps[] = array("step"=>"Create Card Registration", "file"=>"card-reg.php", "docsLink"=>"cards#e177_the-card-registration-object"); -$steps[] = array("step"=>"Finish Card Registration", "file"=>"card-reg-put.php", "checkResult"=>true, "docsLink"=>"cards#e179_update-a-card-registration"); -$steps[] = array("step"=>"Do PayIn Card Direct", "file"=>"payin-card-direct.php", "checkResult"=>true, "docsLink"=>"payins#e278_create-a-card-direct-payin"); -$steps[] = array("step"=>"Setup a PreAuth", "file"=>"preauth.php", "checkResult"=>true, "docsLink"=>"preauthorizations#e183_the-preauthorization-object"); -$steps[] = array("step"=>"Do a PayIn PreAuth", "file"=>"payin-card-preauth.php", "checkResult"=>true, "docsLink"=>"payins#e279_create-a-card-preauthorized-payin"); -$steps[] = array("step"=>"Do a PayIn Refund", "file"=>"refund-payin.php", "checkResult"=>true, "docsLink"=>"refunds#e191_create-a-payin-refund"); -$steps[] = array("step"=>"Do a Transfer", "file"=>"transfer.php", "checkResult"=>true, "docsLink"=>"transfers/"); -$steps[] = array("step"=>"Create a Bank Account (of IBAN type)", "file"=>"bankaccount.php", "docsLink"=>"bank-accounts/"); -$steps[] = array("step"=>"Do a PayOut", "file"=>"payout.php", "docsLink"=>"payouts/"); -$steps[] = array("step"=>"Submit a KYC Document", "file"=>"kyc.php", "docsLink"=>"kyc-documents/"); -$steps[] = array("step"=>"Do a Transfer Refund", "file"=>"refund-transfer.php", "checkResult"=>true, "docsLink"=>"refunds#e189_create-a-transfer-refund"); -$steps[] = array("step"=>"Finished", "file"=>"end.php", "docsLink"=>""); - -$totalStepsIndex = count($steps)-1; - -if (isset($_POST["SetUpClientCreds"])) { - $_SESSION["MangoPayDemoConfig"]["ClientId"] = $_POST["ClientId"]; - $_SESSION["MangoPayDemoConfig"]["Password"] = $_POST["Password"]; - header("Location: index.php?stepId=".($stepId+1)); - die(); -} - -function pre_dump($r) { - echo "
";
-		var_dump($r);
-	echo "
"; -} - -function getDemoScript($stepId) { - global $steps; - $script = explode("//Display",file_get_contents("scripts/".$steps[$stepId]["file"])); - //return htmlentities(trim(str_replace(" - - - - - MANGOPAY Demo workflow - - - - - - - - - -
-
-
-
-2) { - echo "
The demo has either been finished or has timed out - please start again

"; - -}elseif (in_array($stepId, array_keys($steps))) { - ?> -
- - - " class="next docs" target="_blank"> - - -

- -
- 1 && $stepId<$totalStepsIndex) { - echo "

Code example

"; - //echo "
".getDemoScript($stepId)."
"; - echo ""; - echo "
"; - echo "

Returned object

"; - } - include("scripts/".$steps[$stepId]["file"]); - - } catch (MangoPay\Libraries\ResponseException $e) { - $apiError = true; - MangoPay\Libraries\Logs::Debug('MangoPay\ResponseException Code', $e->GetCode()); - MangoPay\Libraries\Logs::Debug('Message', $e->GetMessage()); - MangoPay\Libraries\Logs::Debug('Details', $e->GetErrorDetails()); - - } catch (MangoPay\Libraries\Exception $e) { - $apiError = true; - MangoPay\Libraries\Logs::Debug('MangoPay\Exception Message', $e->GetMessage()); - } - ?> - - The API call failed :-(
"; - }else{ - if (isset($extraInfo)) { - echo "
$extraInfo
"; - } - if (isset($nextButton)) { - if (isset($nextButton["url"])) echo ""; - }elseif (isset($steps[$stepId]["checkResult"]) && !in_array($result->Status, array("VALIDATED", "SUCCEEDED"))) { - echo "
The previous call is ".$result->Status." beacuse of ".$result->ResultMessage." so you can not carry on with the demo
"; - }elseif ($stepId<$totalStepsIndex) { - echo ""; - } - } - ?> -
-
- -
-
- - - diff --git a/demos/workflow/logo.png b/demos/workflow/logo.png deleted file mode 100644 index dfc364b59b0661f6cf8cf7076ea2478d15530d5d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5382 zcmV+h75VCkP)ep$)znu5w&Kmh@W<%tjzz-z$%?z48?e;`)e=q*03WO&VO zg&{AXfILe^Nj3e-#hxBvRkmeXTEC?W zF5ina>bL5qjb&(iT86fdWoWzVrkzut6m7P*46U1GXnVQ$+;V>H<~jyZ>*e}A`Rr?C zH8nN+LYELrfqw$sO8QNSubVLVe}U^Fs;Toj4u~DKXjtO~#CQT2nW(L66P496v@?NQ zfX&jQVsZa{?_yKb9{}73Y*UQkJl(XfiO`2i-~{P*18_C4BINxK0eyh9hmpPyR07*o zbuB~d4?GBL@!a03oAyZo@7WJH1Gog}t0*!Tcn)|$H|?*&7NsD*oq&PBWxy%Gu2Rt& z;2Gd0-L$`T7qk3LmZ6OYP6Qf5*7OEoiCCu#bkqLE+n)dex*a%9dbAR_7WhtLMu!7; z0Xs?Wejb?UGamqZ01p8@q{m+rXGw^?aJ;77-9^!P^vvtmO&GiqxF@8U&wp;hXp{Wr_dV!CN(eA+w|_!}@Npv`h| z-C!Bo-MVQ%=t@axQ6B~zoyDC00kADYs{+QzeUz{lFcc_N%@6RMbT28^)M3*7-GFB- zLt8Hsq!^Df-~z=v{t-z{6@++*;EMYxirfd>7|_HL;E0mpHQyZ(zQ{==5{r8gwcLk_MnXq;|L^A?-JcJOv=mJc%4DC|gv@`Pi zMVp5R=`<)}o85s2EJK^9o3=`dZO>ueHQ;8z6zZ|x{Ok=J?9;}v3c}h3JfJ9h7@#Yp zy8G*uiaI~(raiGJOd^V(rNCQ~NZx_Yqi3c&kDhtAAj)Q{DR5-T@R~-SkVX-3KQPLb zj%{H_N;m@O7(h(>3n`Nm#Kas5bn+=OtOd5ld6uCaEEa#(_LQjCADHY@Y#p!+SnKor zam&ySR4l$?Arbdg)Y&ZBZ18FGa?8+$=Gj(07q~_>PNMJqfp!6!ld9emz#2vQ8+~l$ zU4U~G<;Mg%a6GE%A;23!9MjE9?L2zsb&~y<1Wqd%Ub8+`RgRm5w6v{>@!S9v^H89qh2FfOAw`WA^!+%?(2mHl?m$3SsJCN)J9N{YtDCl^n|6(E z+7I|F^dl`p>mo6Pdlm0`K{xG-bkqJsH|-_5Y0uY9`%&ObMcKoF0TCF?Lfy1q(@pzj z-Lzj8@3>Xieky{z**h0U&)Gia%S*s=MfvL_?IR`}STgJo&u)2s+1;CB080lZBCm{0CUegEt=mTRt*>uu zV)T<-#lV1;sHnmd+aaXr#VzRjosY~`gB%UdL_xq0D%!AC3D1+chj~g0m7k`{s=9YM;*o#XC zCgMG-lTpX=+0EP2BY;Qdl$KTkZ7CslvkdJZg;a|xJd)W;#Y?3}TNMtOQp?b~wxIui z0(QY5nigE5>8QQ+m z{ESdAj;+$YV=P1Kpm5}*g>+n}7?YDc_VWlNx!N$ z1vl9eK{5^#9dlK>Gl8d<4oq~2AR(tGYU?gYXEIxanlx@sY3UU^dfhfedAwqw>`r*z zZI~xkR)N0&K9cUmgS@&CunTZamUW7NeH8b<2&s20PCU-NjsX^UKV4C01+X!IS;C=QU2QxmmyDhd1u@H>E3Qd<{D ze-BcWk!`(ig=!L2`jpe$3%x?2+Qf+-0&pR7{o5@=>)Zm*talLyd0=aF)2{YhAM2*Q zAwr*=kY_W1qY3XIHpt7zNQp!aS zpu3d$;Z-j-19bsRN9LME!ucaFsJC^~UZape35DY$2p<9ON%tx&L+g<*qG{tK?pVGW z5=`}c#Uooc?F}NsrvpyrkNn=(b<_Tm=3yM&T^~NUUU9FA=2=%spjyr_Dy~cRJ`|Xa ze?Z!mj4naGnVNm!$QV4b_WDx?;lz2O;^HkowckjL1!Q1ZQD&G$;=zHD6!3mi=vsXTCHUrS}W1J>Edr^FEam4n! z(mciLBTvZS?}|ESXVL$-$V+`fx<5M4>f~v_Oq{%A)%6ZJdYtosQGy6Q6jwD)3Z5#6 zKU+8L=RE3V4~28?HP7$QDB2ht;K5A^1{;(EyApU+6*ejoHqm#H43t?{@Wa3{%$RjW z#nVw_V9_+y%WI^| ziP=vJ=^Uy~iOE)FpgiZ{q;(3X*jZWhKO=(4_tMlAf1qV(2F=~`xuOG30<_=N0smC8 zR+o&zHrr2Jzw*)Y)+)w!u;2U$ycxlv*KB=DHmQt{Rg%@U8CT$>6DGAWQEl5O5}1g|AHPt{1y0jV zdzrLnQe{)l^f1(nkhWg@$}+Sbe)F!I_EH}rc5#cJEnWmrmiT-gPM~&m2q6v?-p>+` zH?<0%_=|*>`FECyE21w0UJ6JIaLe7?x4!YX#87GPHzy0beSb7?F+hL^tiN!lq73jOKTF8mCWjaz$^$Nr!7}C8Ei+ z0ui1EoTQufEDsZOnXMcTT?Fj!nV(+r+7P%ju=ZdDI zQ{)oj5Fvt_a7dAP^S%(@e(|?gdR8Zg`Ap)Oz{750fWo^rwr_p?U4jtvJ^7lCI&!Xf z=1pIELHyh~qEs||B=JJ&x>`~09KQ(*AjlaC$It04^=b-kKSww1@w#b`6M3K8@;M1& z%!+*+W9g9U598#ax_csz#M#0W(@ndtZraa#%@EK03|F+(3n%vM&P`I-q%!_HfC;0U z_DW#AqR5>=AL2?zmmt3tdh`w(vQJ`uMiAmud7^}5bbn40Dyuwr&jQ0j)X-7D!|99k zSUSC#phh1tCsoCDqgqPf34!HxqvzA>GT1;}p)5 zMxidr*BXU-AIC{d&Ls%`=PZagjXDo?f6LJJ^;yhO7-O~K-eHK8FqgO_B2#G+Z)K~l zN5s)I56Lx(xlqkdN-;mjwU(NOS3=e$d(*qu7hkSU=?@Fe8EH|p-)}_>po8}PfxGDY z#v4Xfbk*LfrBkm%A{+4WICJ~f*Z;W{RZ~Aa8=%I0kY!tg6vX(Eu*nBVS6`eR7cvef z%MHz9anHg@^pA=fn(sK+0~qa7zHgXkRX6PZ;tWMquw7P04FJj%aS6ha*faVz)+fnB!`n9#Qa3sih!|&iIkuCG6 zf*3nlhPFDYWDw;xhy$38Bw9Rlwqlz-kV!_eGp`or zjm)HymZ6QqIsCc@&Y@AN1Da-|-pSF@x!y&XVKS!arv0r?oxjukz_r7Hy(~jpn=i>7 znARmi8Y{#^1;!yuhS!j)D!)VGs0RVl8%9=i1!x#q5!A%kp4G`av)PE8N1M_8^;N~= z#ky&)$>QwP-ElVT%6Kz?5j6TNypwa8Xt5*z$1EH_m!Lj^@>s!$e!y}2Pei?~>0=@J zy&lDveVEuGI6ER5a8e6LC{)I+z-=OAlW*+i!z^D9n4j-)cI$Z25h%~63LQv{BBa3? z10G$1b12Ub3W*pKKPwRdO@&G@y}}uzZ(geBn??bPb7*t4 zZrZQ5(i|T~^BwnV{LX;&e2dDAIV*yLDL=&M5~TP!Pk7l@OA;}Ysw$sA@YbFFz=y7c zlyGa$>g3%3J*$(MpNk5`fG)w=%hrq-vw$kM^tA|+_MDF+C|4;z8FfN|A3?r>v+ph& zR(~6Crf%A{>f3bF{#vNZ(<8RG2^gfC_I>$W!nFriF1U+d`~&=qCY@-z66nQ9CDiV3Zd#P@YJ=$=2yf!KKDGUCtwq>Naea+sF(Al z{`wK*0^PLt7pmh&IJ-f<7b<0gnD@mv=c^tpk^oYE-zL86C*8D%;Do&129|o-TqW9E zDEit}H|-DnP81i6Vxi|-7OS+i5F8|pdNf^nV<>Hm4k-$F<;*-*Rc$3Pn^SwJ9rq{a<^^((FFBtSDZ|w4uXNN z(M@}KSii%L=8rl@e&g7}`H{yhr}yN%nRC`V=j~Uv(wgmK(EAf3kWQy>?mBt;1Pb^? zq9qG6*EU<@o&Rab>7S+6zB!Zuzj^K(oGn7jvZ$H?ZtXgG`h-=N4T%+&{Vx-(c(g{F zzVkl~EhdOmRr%pK+km=6kc>BVnKbRLhLIHncvcH2pdcBuBtig6hS$u;iL0#+sZ!Zx z(zLsP0wESqKt74lJ+5D5-h3}q*5!VxX_raU#y5sd0i(N2n)a81YFa=6Z2<4TdP`N6cS}{3uUhkm!I_4U6_th2DWHI#ktjDl(eIcw ke>&}2fP!jTKmpP4e@gn6lXF9q^8f$<07*qoM6N<$f)kgGuK)l5 diff --git a/demos/workflow/scripts/bankaccount.php b/demos/workflow/scripts/bankaccount.php deleted file mode 100644 index bff8e2c8..00000000 --- a/demos/workflow/scripts/bankaccount.php +++ /dev/null @@ -1,21 +0,0 @@ -Type = "IBAN"; -$BankAccount->Details = new MangoPay\BankAccountDetailsIBAN(); -$BankAccount->Details->IBAN = "FR7630004000031234567890143"; -$BankAccount->Details->BIC = "BNPAFRPP"; -$BankAccount->OwnerName = "Joe Bloggs"; -$BankAccount->OwnerAddress = new \MangoPay\Address(); -$BankAccount->OwnerAddress->AddressLine1 = 'Address line 1'; -$BankAccount->OwnerAddress->AddressLine2 = 'Address line 2'; -$BankAccount->OwnerAddress->City = 'City'; -$BankAccount->OwnerAddress->Country = 'FR'; -$BankAccount->OwnerAddress->PostalCode = '11222'; -$BankAccount->OwnerAddress->Region = 'Region'; -$result = $mangoPayApi->Users->CreateBankAccount($UserId, $BankAccount); - -//Display result -pre_dump($result); - -$_SESSION["MangoPayDemo"]["BankAccount"] = $result->Id; diff --git a/demos/workflow/scripts/card-reg-put.php b/demos/workflow/scripts/card-reg-put.php deleted file mode 100644 index 909387fd..00000000 --- a/demos/workflow/scripts/card-reg-put.php +++ /dev/null @@ -1,10 +0,0 @@ -CardRegistrations->Get($_SESSION["MangoPayDemo"]["CardReg"]); -$cardRegisterPut->RegistrationData = isset($_GET['data']) ? 'data=' . $_GET['data'] : 'errorCode=' . $_GET['errorCode']; -$result = $mangoPayApi->CardRegistrations->Update($cardRegisterPut); - -//Display result -pre_dump($result); - -$extraInfo = "Remember that you have 30 minutes to either do a PayIn Direct or setup a PreAuth with this card, otherwise it will become unsuable"; -$_SESSION["MangoPayDemo"]["Card"] = $result->CardId; \ No newline at end of file diff --git a/demos/workflow/scripts/card-reg.php b/demos/workflow/scripts/card-reg.php deleted file mode 100644 index 157d156f..00000000 --- a/demos/workflow/scripts/card-reg.php +++ /dev/null @@ -1,34 +0,0 @@ -UserId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$cardRegister->Currency = "EUR"; -$result = $mangoPayApi->CardRegistrations->Create($cardRegister); - -//Display result -pre_dump($result); - ?> -
-
- - - - - - - - - - - - - - - - -
Card number:
Expiry date:
CVV:
- " class="next" onclick="addActive(this)"> -
- -Id; - $nextButton=array(); diff --git a/demos/workflow/scripts/client.php b/demos/workflow/scripts/client.php deleted file mode 100644 index f25285fa..00000000 --- a/demos/workflow/scripts/client.php +++ /dev/null @@ -1,17 +0,0 @@ -To run these examples, we need a ClientId and Password. You can either provide your own below (that you created for the Sandbox environment or get one here), or you can just use the demo ones below if you prefer.

- -
- - - - - - - - - - -
ClientId
Password
- " class="next" onclick="addActive(this)"> -
- diff --git a/demos/workflow/scripts/end.php b/demos/workflow/scripts/end.php deleted file mode 100644 index dd2332bf..00000000 --- a/demos/workflow/scripts/end.php +++ /dev/null @@ -1,31 +0,0 @@ -All done :-)
-Why don't you check out this activity on the Mangopay Dashboard - you can use the following info: - - - - - - - - - - - - - -
ClientId:
Email:
Password:
-

- -For your reference, here are the IDs you generated:

- -$v) { - echo ""; - echo ""; - echo ""; - echo ""; -} -unset($_SESSION["MangoPayDemo"]); ?> -
".$k.":".$v."
-

- diff --git a/demos/workflow/scripts/intro.php b/demos/workflow/scripts/intro.php deleted file mode 100644 index 450a93f6..00000000 --- a/demos/workflow/scripts/intro.php +++ /dev/null @@ -1,26 +0,0 @@ -This demo will take you through a "typical" workflow of creating Users, doing PayIns, transfering from one Wallet to another and then doing a PayOut. You are of course free to design any workflow you like though! Some very basic examples of the SDK are shown for each example. This is the full program:
-
    -$s) { - $showingScript = $i>1 && $i<$totalStepsIndex; - if ($i>0) { - echo "
  • "; - echo $showingScript ? "".$s["step"]."" : $s["step"]; - if ($showingScript) echo ""; - echo "
  • "; - } - } -?> -
-
-For each example given in this demo, you'll also need to include the PHP SDK, and initiate the API call: - -
-Do not use the "Back" button in your browser, or "Refresh" at any point, otherwise you risk breaking this very basic demo :-) diff --git a/demos/workflow/scripts/kyc.php b/demos/workflow/scripts/kyc.php deleted file mode 100644 index 74e6d863..00000000 --- a/demos/workflow/scripts/kyc.php +++ /dev/null @@ -1,21 +0,0 @@ -Type = "IDENTITY_PROOF"; -$result = $mangoPayApi->Users->CreateKycDocument($_SESSION["MangoPayDemo"]["UserNatural"], $KycDocument); -$KycDocumentId = $result->Id; - -//add a page to this doc -$result2 = $mangoPayApi->Users->CreateKycPageFromFile($_SESSION["MangoPayDemo"]["UserNatural"], $KycDocumentId, "logo.png"); - -//submit the doc for validation -$KycDocument = new MangoPay\KycDocument(); -$KycDocument->Id = $KycDocumentId; -$KycDocument->Status = \MangoPay\KycDocumentStatus::ValidationAsked; -$result3 = $mangoPayApi->Users->UpdateKycDocument($_SESSION["MangoPayDemo"]["UserNatural"], $KycDocument); - - -//Display result -pre_dump($result3); - -$_SESSION["MangoPayDemo"]["KYC"] = $KycDocumentId; diff --git a/demos/workflow/scripts/payin-applepay-direct.php b/demos/workflow/scripts/payin-applepay-direct.php deleted file mode 100644 index 4d079648..00000000 --- a/demos/workflow/scripts/payin-applepay-direct.php +++ /dev/null @@ -1,23 +0,0 @@ -CreditedWalletId = $_SESSION["MangoPayDemo"]["WalletForNaturalUser"]; -$PayInApplePay->AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$PayInApplePay->DebitedFunds = new \MangoPay\Money(); -$PayInApplePay->DebitedFunds->Currency = "EUR"; -$PayInApplePay->DebitedFunds->Amount = 599; -$PayInApplePay->Fees = new \MangoPay\Money(); -$PayInApplePay->Fees->Currency = "EUR"; -$PayInApplePay->Fees->Amount = 0; -$PayInApplePay->PaymentDetails = new MangoPay\PayInPaymentDetailsApplePay(); -$PayInApplePay->PaymentDetails->PaymentData = new \MangoPay\PaymentData(); -$PayInApplePay->PaymentDetails->PaymentData->TransactionId = '061EB32181A2D9CA42AD16031B476EEBAA62A9A095AD660E2759FBA52B51A61'; -$PayInApplePay->PaymentDetails->PaymentData->Network = 'VISA'; -$PayInApplePay->PaymentDetails->PaymentData->TokenData = "{\"version\":\"EC_v1\",\"data\":\"w4HMBVqNC9ghPP4zncTA\/0oQAsduERfsx78oxgniynNjZLANTL6+0koEtkQnW\/K38Zew8qV1GLp+fLHo+qCBpiKCIwlz3eoFBTbZU+8pYcjaeIYBX9SOxcwxXsNGrGLk+kBUqnpiSIPaAG1E+WPT8R1kjOCnGvtdombvricwRTQkGjtovPfzZo8LzD3ZQJnHMsWJ8QYDLyr\/ZN9gtLAtsBAMvwManwiaG3pOIWpyeOQOb01YcEVO16EZBjaY4x4C\/oyFLWDuKGvhbJwZqWh1d1o9JT29QVmvy3Oq2JEjq3c3NutYut4rwDEP4owqI40Nb7mP2ebmdNgnYyWfPmkRfDCRHIWtbMC35IPg5313B1dgXZ2BmyZRXD5p+mr67vAk7iFfjEpu3GieFqwZrTl3\/pI5V8Sxe3SIYKgT5Hr7ow==\",\"signature\":\"MIAGCSqGSIb3DQEHAqCAMIACAQExDzANBglghkgBZQMEAgEFADCABgkqhkiG9w0BBwEAAKCAMIID5jCCA4ugAwIBAgIIaGD2mdnMpw8wCgYIKoZIzj0EAwIwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMB4XDTE2MDYwMzE4MTY0MFoXDTIxMDYwMjE4MTY0MFowYjEoMCYGA1UEAwwfZWNjLXNtcC1icm9rZXItc2lnbl9VQzQtU0FOREJPWDEUMBIGA1UECwwLaU9TIFN5c3RlbXMxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgjD9q8Oc914gLFDZm0US5jfiqQHdbLPgsc1LUmeY+M9OvegaJajCHkwz3c6OKpbC9q+hkwNFxOh6RCbOlRsSlaOCAhEwggINMEUGCCsGAQUFBwEBBDkwNzA1BggrBgEFBQcwAYYpaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZWFpY2EzMDIwHQYDVR0OBBYEFAIkMAua7u1GMZekplopnkJxghxFMAwGA1UdEwEB\/wQCMAAwHwYDVR0jBBgwFoAUI\/JJxE+T5O8n5sT2KGw\/orv9LkswggEdBgNVHSAEggEUMIIBEDCCAQwGCSqGSIb3Y2QFATCB\/jCBwwYIKwYBBQUHAgIwgbYMgbNSZWxpYW5jZSBvbiB0aGlzIGNlcnRpZmljYXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJsZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRlIHBvbGljeSBhbmQgY2VydGlmaWNhdGlvbiBwcmFjdGljZSBzdGF0ZW1lbnRzLjA2BggrBgEFBQcCARYqaHR0cDovL3d3dy5hcHBsZS5jb20vY2VydGlmaWNhdGVhdXRob3JpdHkvMDQGA1UdHwQtMCswKaAnoCWGI2h0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlYWljYTMuY3JsMA4GA1UdDwEB\/wQEAwIHgDAPBgkqhkiG92NkBh0EAgUAMAoGCCqGSM49BAMCA0kAMEYCIQDaHGOui+X2T44R6GVpN7m2nEcr6T6sMjOhZ5NuSo1egwIhAL1a+\/hp88DKJ0sv3eT3FxWcs71xmbLKD\/QJ3mWagrJNMIIC7jCCAnWgAwIBAgIISW0vvzqY2pcwCgYIKoZIzj0EAwIwZzEbMBkGA1UEAwwSQXBwbGUgUm9vdCBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwHhcNMTQwNTA2MjM0NjMwWhcNMjkwNTA2MjM0NjMwWjB6MS4wLAYDVQQDDCVBcHBsZSBBcHBsaWNhdGlvbiBJbnRlZ3JhdGlvbiBDQSAtIEczMSYwJAYDVQQLDB1BcHBsZSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTETMBEGA1UECgwKQXBwbGUgSW5jLjELMAkGA1UEBhMCVVMwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATwFxGEGddkhdUaXiWBB3bogKLv3nuuTeCN\/EuT4TNW1WZbNa4i0Jd2DSJOe7oI\/XYXzojLdrtmcL7I6CmE\/1RFo4H3MIH0MEYGCCsGAQUFBwEBBDowODA2BggrBgEFBQcwAYYqaHR0cDovL29jc3AuYXBwbGUuY29tL29jc3AwNC1hcHBsZXJvb3RjYWczMB0GA1UdDgQWBBQj8knET5Pk7yfmxPYobD+iu\/0uSzAPBgNVHRMBAf8EBTADAQH\/MB8GA1UdIwQYMBaAFLuw3qFYM4iapIqZ3r6966\/ayySrMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly9jcmwuYXBwbGUuY29tL2FwcGxlcm9vdGNhZzMuY3JsMA4GA1UdDwEB\/wQEAwIBBjAQBgoqhkiG92NkBgIOBAIFADAKBggqhkjOPQQDAgNnADBkAjA6z3KDURaZsYb7NcNWymK\/9Bft2Q91TaKOvvGcgV5Ct4n4mPebWZ+Y1UENj53pwv4CMDIt1UQhsKMFd2xd8zg7kGf9F3wsIW2WT8ZyaYISb1T4en0bmcubCYkhYQaZDwmSHQAAMYIBizCCAYcCAQEwgYYwejEuMCwGA1UEAwwlQXBwbGUgQXBwbGljYXRpb24gSW50ZWdyYXRpb24gQ0EgLSBHMzEmMCQGA1UECwwdQXBwbGUgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkxEzARBgNVBAoMCkFwcGxlIEluYy4xCzAJBgNVBAYTAlVTAghoYPaZ2cynDzANBglghkgBZQMEAgEFAKCBlTAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwGCSqGSIb3DQEJBTEPFw0xOTA1MjMxMTA1MDdaMCoGCSqGSIb3DQEJNDEdMBswDQYJYIZIAWUDBAIBBQChCgYIKoZIzj0EAwIwLwYJKoZIhvcNAQkEMSIEIIvfGVQYBeOilcB7GNI8m8+FBVZ28QfA6BIXaggBja2PMAoGCCqGSM49BAMCBEYwRAIgU01yYfjlx9bvGeC5CU2RS5KBEG+15HH9tz\/sg3qmQ14CID4F4ZJwAz+tXAUcAIzoMpYSnM8YBlnGJSTSp+LhspenAAAAAAAA\",\"header\":{\"ephemeralPublicKey\":\"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE0rs3wRpirXjPbFDQfPRdfEzRIZDWm0qn7Y0HB0PNzV1DDKfpYrnhRb4GEhBF\/oEXBOe452PxbCnN1qAlqcSUWw==\",\"publicKeyHash\":\"saPRAqS7TZ4bAYwzBj8ezDDC55ZolyH1FL+Xc8fd93o=\",\"transactionId\":\"b061eb32181a2d9ca42ad16031b476eebaa62a9a095ad660e2759fba52b51a61\"}}"; - -$PayInApplePay->StatementDescriptor = 'Mar2019'; -$PayInApplePay->Tag = 'custom meta'; -$result = $mangoPayApi->PayIns->Create($PayInApplePay); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["PayInCardDirect"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/payin-card-direct.php b/demos/workflow/scripts/payin-card-direct.php deleted file mode 100644 index 08c30466..00000000 --- a/demos/workflow/scripts/payin-card-direct.php +++ /dev/null @@ -1,24 +0,0 @@ -CreditedWalletId = $_SESSION["MangoPayDemo"]["WalletForNaturalUser"]; -$PayIn->AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$PayIn->PaymentType = \MangoPay\PayInPaymentType::Card; -$PayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsCard(); -$PayIn->DebitedFunds = new \MangoPay\Money(); -$PayIn->DebitedFunds->Currency = "EUR"; -$PayIn->DebitedFunds->Amount = 599; -$PayIn->Fees = new \MangoPay\Money(); -$PayIn->Fees->Currency = "EUR"; -$PayIn->Fees->Amount = 0; -$PayIn->ExecutionType = \MangoPay\PayInExecutionType::Direct; -$PayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect(); -$PayIn->ExecutionDetails->SecureModeReturnURL = "http".(isset($_SERVER['HTTPS']) ? "s" : null)."://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]."?stepId=".($stepId+1); -$PayIn->ExecutionDetails->CardId = $_SESSION["MangoPayDemo"]["Card"]; -$result = $mangoPayApi->PayIns->Create($PayIn); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["PayInCardDirect"] = $result->Id; -if ($result->ExecutionDetails->SecureModeNeeded && $result->Status!=\MangoPay\PayInStatus::Failed) { - $nextButton = array("url"=>$result->ExecutionDetails->SecureModeRedirectURL, "text"=>"Go to 3DS payment page"); -} diff --git a/demos/workflow/scripts/payin-card-preauth.php b/demos/workflow/scripts/payin-card-preauth.php deleted file mode 100644 index 7511857e..00000000 --- a/demos/workflow/scripts/payin-card-preauth.php +++ /dev/null @@ -1,20 +0,0 @@ -CreditedWalletId = $_SESSION["MangoPayDemo"]["WalletForNaturalUser"]; -$PayIn->AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$PayIn->PaymentType = \MangoPay\PayInPaymentType::Card; -$PayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsPreAuthorized(); -$PayIn->PaymentDetails->PreauthorizationId = $_SESSION["MangoPayDemo"]["PreAuth"]; -$PayIn->DebitedFunds = new \MangoPay\Money(); -$PayIn->DebitedFunds->Currency = "EUR"; -$PayIn->DebitedFunds->Amount = 950; -$PayIn->Fees = new \MangoPay\Money(); -$PayIn->Fees->Currency = "EUR"; -$PayIn->Fees->Amount = 550; -$PayIn->ExecutionType = \MangoPay\PayInExecutionType::Direct; -$PayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsDirect(); -$result = $mangoPayApi->PayIns->Create($PayIn); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["PayInCardPreAuth"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/payin-card-web-review.php b/demos/workflow/scripts/payin-card-web-review.php deleted file mode 100644 index 3a9ebb6b..00000000 --- a/demos/workflow/scripts/payin-card-web-review.php +++ /dev/null @@ -1,5 +0,0 @@ -PayIns->Get($_SESSION["MangoPayDemo"]["PayInCardWeb"]); - -//Display result -pre_dump($result); \ No newline at end of file diff --git a/demos/workflow/scripts/payin-card-web.php b/demos/workflow/scripts/payin-card-web.php deleted file mode 100644 index 46e14f4d..00000000 --- a/demos/workflow/scripts/payin-card-web.php +++ /dev/null @@ -1,25 +0,0 @@ -CreditedWalletId = $_SESSION["MangoPayDemo"]["WalletForNaturalUser"]; -$PayIn->AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$PayIn->PaymentType = \MangoPay\PayInPaymentType::Card; -$PayIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsCard(); -$PayIn->PaymentDetails->CardType = "CB_VISA_MASTERCARD"; -$PayIn->DebitedFunds = new \MangoPay\Money(); -$PayIn->DebitedFunds->Currency = "EUR"; -$PayIn->DebitedFunds->Amount = 2500; -$PayIn->Fees = new \MangoPay\Money(); -$PayIn->Fees->Currency = "EUR"; -$PayIn->Fees->Amount = 150; -$PayIn->ExecutionType = \MangoPay\PayInExecutionType::Web; -$PayIn->ExecutionDetails = new \MangoPay\PayInExecutionDetailsWeb(); -$PayIn->ExecutionDetails->ReturnURL = "http".(isset($_SERVER['HTTPS']) ? "s" : null)."://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]."?stepId=".($stepId+1); -$PayIn->ExecutionDetails->Culture = "EN"; -$result = $mangoPayApi->PayIns->Create($PayIn); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["PayInCardWeb"] = $result->Id; - -$extraInfo = "You can use the test card 4970101122334414 with any expiry date in the future and a CVV of 123 (or any of these other cards)"; -$nextButton = array("url"=>$result->ExecutionDetails->RedirectURL, "text"=>"Go to Payment page"); diff --git a/demos/workflow/scripts/payin-googlepay-direct.php b/demos/workflow/scripts/payin-googlepay-direct.php deleted file mode 100644 index 5bdaa20d..00000000 --- a/demos/workflow/scripts/payin-googlepay-direct.php +++ /dev/null @@ -1,23 +0,0 @@ -AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$PayInGooglePay->CreditedWalletId = $_SESSION["MangoPayDemo"]["WalletForNaturalUser"]; -$PayInGooglePay->DebitedFunds = new \MangoPay\Money(); -$PayInGooglePay->DebitedFunds->Currency = "EUR"; -$PayInGooglePay->DebitedFunds->Amount = 599; -$PayInGooglePay->Fees = new \MangoPay\Money(); -$PayInGooglePay->Fees->Currency = "EUR"; -$PayInGooglePay->Fees->Amount = 0; -$PayInGooglePay->PaymentDetails = new MangoPay\PayInPaymentDetailsGooglePay(); -$PayInGooglePay->PaymentDetails->PaymentData = new \MangoPay\PaymentData(); -$PayInGooglePay->PaymentDetails->PaymentData->TransactionId = 'placeholder'; -$PayInGooglePay->PaymentDetails->PaymentData->Network = 'placeholder'; -$PayInGooglePay->PaymentDetails->PaymentData->TokenData = 'placeholder'; - -$PayInGooglePay->StatementDescriptor = 'Mar2020'; -$PayInGooglePay->Tag = 'custom meta'; -$result = $mangoPayApi->PayIns->Create($PayInGooglePay); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["PayInCardDirect"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/payout.php b/demos/workflow/scripts/payout.php deleted file mode 100644 index 8c3c0df0..00000000 --- a/demos/workflow/scripts/payout.php +++ /dev/null @@ -1,19 +0,0 @@ -AuthorId = $_SESSION["MangoPayDemo"]["UserLegal"]; -$PayOut->DebitedWalletId = $_SESSION["MangoPayDemo"]["WalletForLegalUser"]; -$PayOut->DebitedFunds = new \MangoPay\Money(); -$PayOut->DebitedFunds->Currency = "EUR"; -$PayOut->DebitedFunds->Amount = 610; -$PayOut->Fees = new \MangoPay\Money(); -$PayOut->Fees->Currency = "EUR"; -$PayOut->Fees->Amount = 125; -$PayOut->PaymentType = \MangoPay\PayOutPaymentType::BankWire; -$PayOut->MeanOfPaymentDetails = new \MangoPay\PayOutPaymentDetailsBankWire(); -$PayOut->MeanOfPaymentDetails->BankAccountId = $_SESSION["MangoPayDemo"]["BankAccount"]; -$result = $mangoPayApi->PayOuts->Create($PayOut); - -//Display result -pre_dump($result); - -$_SESSION["MangoPayDemo"]["PayOut"] = $result->Id; diff --git a/demos/workflow/scripts/preauth.php b/demos/workflow/scripts/preauth.php deleted file mode 100644 index 3c978590..00000000 --- a/demos/workflow/scripts/preauth.php +++ /dev/null @@ -1,18 +0,0 @@ -AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$CardPreAuthorization->DebitedFunds = new \MangoPay\Money(); -$CardPreAuthorization->DebitedFunds->Currency = "EUR"; -$CardPreAuthorization->DebitedFunds->Amount = 1500; -$CardPreAuthorization->SecureMode = "DEFAULT"; -$CardPreAuthorization->CardId = $_SESSION["MangoPayDemo"]["Card"]; -$CardPreAuthorization->SecureModeReturnURL = "http".(isset($_SERVER['HTTPS']) ? "s" : null)."://".$_SERVER["HTTP_HOST"].$_SERVER["SCRIPT_NAME"]."?stepId=".($stepId+1); -$result = $mangoPayApi->CardPreAuthorizations->Create($CardPreAuthorization); - - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["PreAuth"] = $result->Id; -if ($result->SecureModeNeeded && $result->Status!=\MangoPay\CardPreAuthorizationStatus::Failed) { - $nextButton = array("url"=>$result->SecureModeRedirectURL, "text"=>"Go to 3DS payment page"); -} diff --git a/demos/workflow/scripts/refund-payin.php b/demos/workflow/scripts/refund-payin.php deleted file mode 100644 index fbbc6959..00000000 --- a/demos/workflow/scripts/refund-payin.php +++ /dev/null @@ -1,16 +0,0 @@ -AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$Refund->DebitedFunds = new \MangoPay\Money(); -$Refund->DebitedFunds->Currency = "EUR"; -$Refund->DebitedFunds->Amount = 650; -$Refund->Fees = new \MangoPay\Money(); -$Refund->Fees->Currency = "EUR"; -$Refund->Fees->Amount = -50; -$result = $mangoPayApi->PayIns->CreateRefund($PayInId, $Refund); - -//Display result -pre_dump($result); - -$_SESSION["MangoPayDemo"]["Refund"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/refund-transfer.php b/demos/workflow/scripts/refund-transfer.php deleted file mode 100644 index fedf9b3e..00000000 --- a/demos/workflow/scripts/refund-transfer.php +++ /dev/null @@ -1,16 +0,0 @@ -AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$Refund->DebitedFunds = new \MangoPay\Money(); -$Refund->DebitedFunds->Currency = "EUR"; -$Refund->DebitedFunds->Amount = 760;//Note that partial Refunds for Transfers are not possible -$Refund->Fees = new \MangoPay\Money(); -$Refund->Fees->Currency = "EUR"; -$Refund->Fees->Amount = -150; -$result = $mangoPayApi->Transfers->CreateRefund($TransferId, $Refund); - -//Display result -pre_dump($result); - -$_SESSION["MangoPayDemo"]["RefundTransfer"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/transfer.php b/demos/workflow/scripts/transfer.php deleted file mode 100644 index 7f007d05..00000000 --- a/demos/workflow/scripts/transfer.php +++ /dev/null @@ -1,17 +0,0 @@ -AuthorId = $_SESSION["MangoPayDemo"]["UserNatural"]; -$Transfer->DebitedFunds = new \MangoPay\Money(); -$Transfer->DebitedFunds->Currency = "EUR"; -$Transfer->DebitedFunds->Amount = 760; -$Transfer->Fees = new \MangoPay\Money(); -$Transfer->Fees->Currency = "EUR"; -$Transfer->Fees->Amount = 150; -$Transfer->DebitedWalletID = $_SESSION["MangoPayDemo"]["WalletForNaturalUser"]; -$Transfer->CreditedWalletId = $_SESSION["MangoPayDemo"]["WalletForLegalUser"]; -$result = $mangoPayApi->Transfers->Create($Transfer); - -//Display result -pre_dump($result); - -$_SESSION["MangoPayDemo"]["Transfer"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/user-create-legal.php b/demos/workflow/scripts/user-create-legal.php deleted file mode 100644 index 28e96211..00000000 --- a/demos/workflow/scripts/user-create-legal.php +++ /dev/null @@ -1,15 +0,0 @@ -Name = "Name Legal Test"; -$User->LegalPersonType = \MangoPay\LegalPersonType::Business; -$User->Email = "legal@testmangopay.com"; -$User->LegalRepresentativeFirstName = "Bob"; -$User->LegalRepresentativeLastName = "Briant"; -$User->LegalRepresentativeBirthday = 121271; -$User->LegalRepresentativeNationality = "FR"; -$User->LegalRepresentativeCountryOfResidence = "ZA"; -$result = $mangoPayApi->Users->Create($User); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["UserLegal"] = $result->Id; diff --git a/demos/workflow/scripts/user-create-natural.php b/demos/workflow/scripts/user-create-natural.php deleted file mode 100644 index c99a0bc4..00000000 --- a/demos/workflow/scripts/user-create-natural.php +++ /dev/null @@ -1,13 +0,0 @@ -Email = "test_natural@testmangopay.com"; -$User->FirstName = "Bob"; -$User->LastName = "Briant"; -$User->Birthday = 121271; -$User->Nationality = "FR"; -$User->CountryOfResidence = "ZA"; -$result = $mangoPayApi->Users->Create($User); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["UserNatural"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/wallet-create.php b/demos/workflow/scripts/wallet-create.php deleted file mode 100644 index 7726cfb6..00000000 --- a/demos/workflow/scripts/wallet-create.php +++ /dev/null @@ -1,10 +0,0 @@ -Owners = array($_SESSION["MangoPayDemo"]["UserNatural"]); -$Wallet->Description = "Demo wallet for User 1"; -$Wallet->Currency = "EUR"; -$result = $mangoPayApi->Wallets->Create($Wallet); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["WalletForNaturalUser"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/scripts/wallet-create2.php b/demos/workflow/scripts/wallet-create2.php deleted file mode 100644 index a5dfa49e..00000000 --- a/demos/workflow/scripts/wallet-create2.php +++ /dev/null @@ -1,11 +0,0 @@ -Owners = array($_SESSION["MangoPayDemo"]["UserLegal"]); -$Wallet->Description = "Demo wallet for User 2"; -$Wallet->Currency = "EUR"; -$result = $mangoPayApi->Wallets->Create($Wallet); - -//Display result -pre_dump($result); -$_SESSION["MangoPayDemo"]["WalletForLegalUser"] = $result->Id; \ No newline at end of file diff --git a/demos/workflow/style.css b/demos/workflow/style.css deleted file mode 100644 index 669ea19c..00000000 --- a/demos/workflow/style.css +++ /dev/null @@ -1,212 +0,0 @@ -body { - margin:0; - padding: 0; - background-color: #fafafa; - color: #555; -} -body, input { - font-size: 16px; - font-family: 'PT Sans', sans-serif; - font-weight: 400; - line-height: 1.2em; -} -input[type="text"] { - padding: 2px 5px; -} -a:link, a:visited { - color:#428bca; -} -#main { - padding: 25px 0; -} -#main > .container { - background-color: #fff; - box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.25); - margin: 0 auto; - max-width: 100%; - width: 660px; -} -.containerInner { - padding:20px; -} -pre, .syntaxhighlighter { - overflow-x: auto; - font-size: 12px; - line-height: 1.3; - padding: 4px 6px; - background: rgb(245, 245, 245); - box-shadow: inset 0 1px 4px 0 rgba(0, 0, 0, 0.25); - margin:12px 0; -} -.syntaxhighlighter table .container > div { - white-space:nowrap; -} -ul li pre { - margin-top: 4px; -} -ul li { - margin-bottom:2px; -} -h1 { - border-bottom: 1px dotted #b7b7b2; - display: block; - font-size: 24px; - line-height: 1.2em; - padding: 24px 20px; - margin: 0; - font-weight:normal; - color: #428bca; -} -h2 { - font-weight: normal; - color: #f78153; - margin: 0; -} -a.next, .next { - margin-top: 30px; - text-decoration: none !important; - outline: none !important; - color: #fff; - background: #f78153; - display: inline-block; - font-weight: normal; - text-align: center; - vertical-align: middle; - cursor: pointer; - border: 1px solid #eea236; - white-space: nowrap; - padding: 6px 12px; - border-radius: 3px; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - float:right; -} -.next.customButton { - background: #51d466; - border: 1px solid #4cae4c; -} -.next:hover { - background: #eb6c3a; -} -.next.customButton:hover { - background: #42c557;; -} -.next.clicked, #main.clicked { - opacity:0.3; - cursor:wait; -} -.next.back { - float:none; -} -.next.docs { - margin-top: 27px; - margin-right: 22px; - padding: 4px 6px; - font-size: 14px; -} -.next.docs, .next.back { - background: #428bca; - border: 1px solid #357ebd; -} -.next.back:hover, .next.docs:hover { - background: #528fe2; -} -.clear { - clear:both; -} -.notice { - border-radius: 5px; - background-color: #f2dede; - border: 1px solid #ebccd1; - color: #a94442; - padding: 10px 15px; -} -.notice.helper { - background-color: #d9edf7; - border-color: #bce8f1; - color: #31708f; -} -.container > .notice { - margin:0 20px; -} -.flyer { - background: #609cec; -} -.flyer span { - -webkit-animation: progressBar 1s ease forwards; - -moz-animation: progressBar 1s ease forwards; - animation: progressBar 1s ease forwards; - display:block; - background: #51d466; - border-top-right-radius: 10px; - border-bottom-right-radius: 10px; -} -.flyer, .flyer span { - height:7px; - -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); - box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); -} -table { - width: 100%; -} -table th { - text-align:right; - width:50%; - padding-right:10px; -} - .header { - background: url('logo.png') no-repeat center center; - height: 45px; - margin-bottom: 20px; -} -#loading { - z-index: 10; - position: fixed; - top:0; - display:none; - height:5px; - width:0; -} -#loading div { - height:6px; - width: 100%; - background: #f78153; - background-image: -webkit-linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(45deg, rgba(255,255,255,0.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.15) 50%, rgba(255,255,255,0.15) 75%, transparent 75%, transparent); - background-size: 40px 40px; - -webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); - box-shadow: inset 0 -1px 0 rgba(0,0,0,0.15); - -webkit-animation: progress-bar-stripes 1s linear infinite; - animation: progress-bar-stripes 1s linear infinite; -} -#loading.active { - display:block; - -webkit-animation: loading-bar 2s ease forwards; - animation: loading-bar 2s ease forwards; -} -@-webkit-keyframes loading-bar { - to { - width: 100%; - } -} -@keyframes loading-bar { - to { - width: 100%; - } -} -@-moz-keyframes loading-bar { - to { - width: 100%; - } -} -@-webkit-keyframes progress-bar-stripes { - from { background-position: 40px 0; } - to { background-position: 0 0; } -} - -@keyframes progress-bar-stripes { - from { background-position: 40px 0; } - to { background-position: 0 0; } -} \ No newline at end of file diff --git a/demos/workflow/syntaxhighlighter/shBrushPhp.js b/demos/workflow/syntaxhighlighter/shBrushPhp.js deleted file mode 100644 index 95e6e432..00000000 --- a/demos/workflow/syntaxhighlighter/shBrushPhp.js +++ /dev/null @@ -1,88 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -;(function() -{ - // CommonJS - typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; - - function Brush() - { - var funcs = 'abs acos acosh addcslashes addslashes ' + - 'array_change_key_case array_chunk array_combine array_count_values array_diff '+ - 'array_diff_assoc array_diff_key array_diff_uassoc array_diff_ukey array_fill '+ - 'array_filter array_flip array_intersect array_intersect_assoc array_intersect_key '+ - 'array_intersect_uassoc array_intersect_ukey array_key_exists array_keys array_map '+ - 'array_merge array_merge_recursive array_multisort array_pad array_pop array_product '+ - 'array_push array_rand array_reduce array_reverse array_search array_shift '+ - 'array_slice array_splice array_sum array_udiff array_udiff_assoc '+ - 'array_udiff_uassoc array_uintersect array_uintersect_assoc '+ - 'array_uintersect_uassoc array_unique array_unshift array_values array_walk '+ - 'array_walk_recursive atan atan2 atanh base64_decode base64_encode base_convert '+ - 'basename bcadd bccomp bcdiv bcmod bcmul bindec bindtextdomain bzclose bzcompress '+ - 'bzdecompress bzerrno bzerror bzerrstr bzflush bzopen bzread bzwrite ceil chdir '+ - 'checkdate checkdnsrr chgrp chmod chop chown chr chroot chunk_split class_exists '+ - 'closedir closelog copy cos cosh count count_chars date decbin dechex decoct '+ - 'deg2rad delete ebcdic2ascii echo empty end ereg ereg_replace eregi eregi_replace error_log '+ - 'error_reporting escapeshellarg escapeshellcmd eval exec exit exp explode extension_loaded '+ - 'feof fflush fgetc fgetcsv fgets fgetss file_exists file_get_contents file_put_contents '+ - 'fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype '+ - 'floatval flock floor flush fmod fnmatch fopen fpassthru fprintf fputcsv fputs fread fscanf '+ - 'fseek fsockopen fstat ftell ftok getallheaders getcwd getdate getenv gethostbyaddr gethostbyname '+ - 'gethostbynamel getimagesize getlastmod getmxrr getmygid getmyinode getmypid getmyuid getopt '+ - 'getprotobyname getprotobynumber getrandmax getrusage getservbyname getservbyport gettext '+ - 'gettimeofday gettype glob gmdate gmmktime ini_alter ini_get ini_get_all ini_restore ini_set '+ - 'interface_exists intval ip2long is_a is_array is_bool is_callable is_dir is_double '+ - 'is_executable is_file is_finite is_float is_infinite is_int is_integer is_link is_long '+ - 'is_nan is_null is_numeric is_object is_readable is_real is_resource is_scalar is_soap_fault '+ - 'is_string is_subclass_of is_uploaded_file is_writable is_writeable mkdir mktime nl2br '+ - 'parse_ini_file parse_str parse_url passthru pathinfo print readlink realpath rewind rewinddir rmdir '+ - 'round str_ireplace str_pad str_repeat str_replace str_rot13 str_shuffle str_split '+ - 'str_word_count strcasecmp strchr strcmp strcoll strcspn strftime strip_tags stripcslashes '+ - 'stripos stripslashes stristr strlen strnatcasecmp strnatcmp strncasecmp strncmp strpbrk '+ - 'strpos strptime strrchr strrev strripos strrpos strspn strstr strtok strtolower strtotime '+ - 'strtoupper strtr strval substr substr_compare'; - - var keywords = 'abstract and array as break case catch cfunction class clone const continue declare default die do ' + - 'else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach ' + - 'function include include_once global goto if implements interface instanceof namespace new ' + - 'old_function or private protected public return require require_once static switch ' + - 'throw try use var while xor '; - - var constants = '__FILE__ __LINE__ __METHOD__ __FUNCTION__ __CLASS__'; - - this.regexList = [ - { regex: SyntaxHighlighter.regexLib.singleLineCComments, css: 'comments' }, // one line comments - { regex: SyntaxHighlighter.regexLib.multiLineCComments, css: 'comments' }, // multiline comments - { regex: SyntaxHighlighter.regexLib.doubleQuotedString, css: 'string' }, // double quoted strings - { regex: SyntaxHighlighter.regexLib.singleQuotedString, css: 'string' }, // single quoted strings - { regex: /\$\w+/g, css: 'variable' }, // variables - { regex: new RegExp(this.getKeywords(funcs), 'gmi'), css: 'functions' }, // common functions - { regex: new RegExp(this.getKeywords(constants), 'gmi'), css: 'constants' }, // constants - { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keyword - ]; - - this.forHtmlScript(SyntaxHighlighter.regexLib.phpScriptTags); - }; - - Brush.prototype = new SyntaxHighlighter.Highlighter(); - Brush.aliases = ['php']; - - SyntaxHighlighter.brushes.Php = Brush; - - // CommonJS - typeof(exports) != 'undefined' ? exports.Brush = Brush : null; -})(); diff --git a/demos/workflow/syntaxhighlighter/shCore.js b/demos/workflow/syntaxhighlighter/shCore.js deleted file mode 100644 index b47b6454..00000000 --- a/demos/workflow/syntaxhighlighter/shCore.js +++ /dev/null @@ -1,17 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ -eval(function(p,a,c,k,e,d){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c])}}return p}('K M;I(M)1S 2U("2a\'t 4k M 4K 2g 3l 4G 4H");(6(){6 r(f,e){I(!M.1R(f))1S 3m("3s 15 4R");K a=f.1w;f=M(f.1m,t(f)+(e||""));I(a)f.1w={1m:a.1m,19:a.19?a.19.1a(0):N};H f}6 t(f){H(f.1J?"g":"")+(f.4s?"i":"")+(f.4p?"m":"")+(f.4v?"x":"")+(f.3n?"y":"")}6 B(f,e,a,b){K c=u.L,d,h,g;v=R;5K{O(;c--;){g=u[c];I(a&g.3r&&(!g.2p||g.2p.W(b))){g.2q.12=e;I((h=g.2q.X(f))&&h.P===e){d={3k:g.2b.W(b,h,a),1C:h};1N}}}}5v(i){1S i}5q{v=11}H d}6 p(f,e,a){I(3b.Z.1i)H f.1i(e,a);O(a=a||0;a-1},3d:6(g){e+=g}};c1&&p(e,"")>-1){a=15(J.1m,n.Q.W(t(J),"g",""));n.Q.W(f.1a(e.P),a,6(){O(K c=1;c<14.L-2;c++)I(14[c]===1d)e[c]=1d})}I(J.1w&&J.1w.19)O(K b=1;be.P&&J.12--}H e};I(!D)15.Z.1A=6(f){(f=n.X.W(J,f))&&J.1J&&!f[0].L&&J.12>f.P&&J.12--;H!!f};1r.Z.1C=6(f){M.1R(f)||(f=15(f));I(f.1J){K e=n.1C.1p(J,14);f.12=0;H e}H f.X(J)};1r.Z.Q=6(f,e){K a=M.1R(f),b,c;I(a&&1j e.58()==="3f"&&e.1i("${")===-1&&y)H n.Q.1p(J,14);I(a){I(f.1w)b=f.1w.19}Y f+="";I(1j e==="6")c=n.Q.W(J,f,6(){I(b){14[0]=1f 1r(14[0]);O(K d=0;dd.L-3;){i=1r.Z.1a.W(g,-1)+i;g=1Q.3i(g/10)}H(g?d[g]||"":"$")+i}Y{g=+i;I(g<=d.L-3)H d[g];g=b?p(b,i):-1;H g>-1?d[g+1]:h}})})}I(a&&f.1J)f.12=0;H c};1r.Z.1e=6(f,e){I(!M.1R(f))H n.1e.1p(J,14);K a=J+"",b=[],c=0,d,h;I(e===1d||+e<0)e=5D;Y{e=1Q.3i(+e);I(!e)H[]}O(f=M.3c(f);d=f.X(a);){I(f.12>c){b.U(a.1a(c,d.P));d.L>1&&d.P=e)1N}f.12===d.P&&f.12++}I(c===a.L){I(!n.1A.W(f,"")||h)b.U("")}Y b.U(a.1a(c));H b.L>e?b.1a(0,e):b};M.1h(/\\(\\?#[^)]*\\)/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"});M.1h(/\\((?!\\?)/,6(){J.19.U(N);H"("});M.1h(/\\(\\?<([$\\w]+)>/,6(f){J.19.U(f[1]);J.2N=R;H"("});M.1h(/\\\\k<([\\w$]+)>/,6(f){K e=p(J.19,f[1]);H e>-1?"\\\\"+(e+1)+(3R(f.2S.3a(f.P+f[0].L))?"":"(?:)"):f[0]});M.1h(/\\[\\^?]/,6(f){H f[0]==="[]"?"\\\\b\\\\B":"[\\\\s\\\\S]"});M.1h(/^\\(\\?([5A]+)\\)/,6(f){J.3d(f[1]);H""});M.1h(/(?:\\s+|#.*)+/,6(f){H n.1A.W(A,f.2S.1a(f.P+f[0].L))?"":"(?:)"},M.1B,6(){H J.2K("x")});M.1h(/\\./,6(){H"[\\\\s\\\\S]"},M.1B,6(){H J.2K("s")})})();1j 2e!="1d"&&(2e.M=M);K 1v=6(){6 r(a,b){a.1l.1i(b)!=-1||(a.1l+=" "+b)}6 t(a){H a.1i("3e")==0?a:"3e"+a}6 B(a){H e.1Y.2A[t(a)]}6 p(a,b,c){I(a==N)H N;K d=c!=R?a.3G:[a.2G],h={"#":"1c",".":"1l"}[b.1o(0,1)]||"3h",g,i;g=h!="3h"?b.1o(1):b.5u();I((a[h]||"").1i(g)!=-1)H a;O(a=0;d&&a\'+c+""});H a}6 n(a,b){a.1e("\\n");O(K c="",d=0;d<50;d++)c+=" ";H a=v(a,6(h){I(h.1i("\\t")==-1)H h;O(K g=0;(g=h.1i("\\t"))!=-1;)h=h.1o(0,g)+c.1o(0,b-g%b)+h.1o(g+1,h.L);H h})}6 x(a){H a.Q(/^\\s+|\\s+$/g,"")}6 D(a,b){I(a.Pb.P)H 1;Y I(a.Lb.L)H 1;H 0}6 y(a,b){6 c(k){H k[0]}O(K d=N,h=[],g=b.2D?b.2D:c;(d=b.1I.X(a))!=N;){K i=g(d,b);I(1j i=="3f")i=[1f e.2L(i,d.P,b.23)];h=h.1O(i)}H h}6 E(a){K b=/(.*)((&1G;|&1y;).*)/;H a.Q(e.3A.3M,6(c){K d="",h=N;I(h=b.X(c)){c=h[1];d=h[2]}H\'\'+c+""+d})}6 z(){O(K a=1E.36("1k"),b=[],c=0;c<1z 4I="1Z://2y.3L.3K/4L/5L"><3J><4N 1Z-4M="5G-5M" 6K="2O/1z; 6J=6I-8" /><1t>6L 1v<3B 1L="25-6M:6Q,6P,6O,6N-6F;6y-2f:#6x;2f:#6w;25-22:6v;2O-3D:3C;">1v3v 3.0.76 (72 73 3x)1Z://3u.2w/1v70 17 6U 71.6T 6X-3x 6Y 6D.6t 61 60 J 1k, 5Z 5R 5V <2R/>5U 5T 5S!\'}},1Y:{2j:N,2A:{}},1U:{},3A:{6n:/\\/\\*[\\s\\S]*?\\*\\//2c,6m:/\\/\\/.*$/2c,6l:/#.*$/2c,6k:/"([^\\\\"\\n]|\\\\.)*"/g,6o:/\'([^\\\\\'\\n]|\\\\.)*\'/g,6p:1f M(\'"([^\\\\\\\\"]|\\\\\\\\.)*"\',"3z"),6s:1f M("\'([^\\\\\\\\\']|\\\\\\\\.)*\'","3z"),6q:/(&1y;|<)!--[\\s\\S]*?--(&1G;|>)/2c,3M:/\\w+:\\/\\/[\\w-.\\/?%&=:@;]*/g,6a:{18:/(&1y;|<)\\?=?/g,1b:/\\?(&1G;|>)/g},69:{18:/(&1y;|<)%=?/g,1b:/%(&1G;|>)/g},6d:{18:/(&1y;|<)\\s*1k.*?(&1G;|>)/2T,1b:/(&1y;|<)\\/\\s*1k\\s*(&1G;|>)/2T}},16:{1H:6(a){6 b(i,k){H e.16.2o(i,k,e.13.1x[k])}O(K c=\'\',d=e.16.2x,h=d.2X,g=0;g";H c},2o:6(a,b,c){H\'<2W>\'+c+""},2b:6(a){K b=a.1F,c=b.1l||"";b=B(p(b,".20",R).1c);K d=6(h){H(h=15(h+"6f(\\\\w+)").X(c))?h[1]:N}("6g");b&&d&&e.16.2x[d].2B(b);a.3N()},2x:{2X:["21","2P"],21:{1H:6(a){I(a.V("2l")!=R)H"";K b=a.V("1t");H e.16.2o(a,"21",b?b:e.13.1x.21)},2B:6(a){a=1E.6j(t(a.1c));a.1l=a.1l.Q("47","")}},2P:{2B:6(){K a="68=0";a+=", 18="+(31.30-33)/2+", 32="+(31.2Z-2Y)/2+", 30=33, 2Z=2Y";a=a.Q(/^,/,"");a=1P.6Z("","38",a);a.2C();K b=a.1E;b.6W(e.13.1x.37);b.6V();a.2C()}}}},35:6(a,b){K c;I(b)c=[b];Y{c=1E.36(e.13.34);O(K d=[],h=0;h(.*?))\\\\]$"),s=1f M("(?<27>[\\\\w-]+)\\\\s*:\\\\s*(?<1T>[\\\\w-%#]+|\\\\[.*?\\\\]|\\".*?\\"|\'.*?\')\\\\s*;?","g");(j=s.X(k))!=N;){K o=j.1T.Q(/^[\'"]|[\'"]$/g,"");I(o!=N&&m.1A(o)){o=m.X(o);o=o.2V.L>0?o.2V.1e(/\\s*,\\s*/):[]}l[j.27]=o}g={1F:g,1n:C(i,l)};g.1n.1D!=N&&d.U(g)}H d},1M:6(a,b){K c=J.35(a,b),d=N,h=e.13;I(c.L!==0)O(K g=0;g")==o-3){m=m.4h(0,o-3);s=R}l=s?m:l}I((i.1t||"")!="")k.1t=i.1t;k.1D=j;d.2Q(k);b=d.2F(l);I((i.1c||"")!="")b.1c=i.1c;i.2G.74(b,i)}}},2E:6(a){w(1P,"4k",6(){e.1M(a)})}};e.2E=e.2E;e.1M=e.1M;e.2L=6(a,b,c){J.1T=a;J.P=b;J.L=a.L;J.23=c;J.1V=N};e.2L.Z.1q=6(){H J.1T};e.4l=6(a){6 b(j,l){O(K m=0;md)1N;Y I(g.P==c.P&&g.L>c.L)a[b]=N;Y I(g.P>=c.P&&g.P\'+c+""},3Q:6(a,b){K c="",d=a.1e("\\n").L,h=2u(J.V("2i-1s")),g=J.V("2z-1s-2t");I(g==R)g=(h+d-1).1q().L;Y I(3R(g)==R)g=0;O(K i=0;i\'+j+"":"")+i)}H a},4f:6(a){H a?"<4a>"+a+"":""},4b:6(a,b){6 c(l){H(l=l?l.1V||g:g)?l+" ":""}O(K d=0,h="",g=J.V("1D",""),i=0;i|&1y;2R\\s*\\/?&1G;/2T;I(e.13.46==R)b=b.Q(h,"\\n");I(e.13.44==R)b=b.Q(h,"");b=b.1e("\\n");h=/^\\s*/;g=4Q;O(K i=0;i0;i++){K k=b[i];I(x(k).L!=0){k=h.X(k);I(k==N){a=a;1N a}g=1Q.4q(k[0].L,g)}}I(g>0)O(i=0;i\'+(J.V("16")?e.16.1H(J):"")+\'<3Z 5z="0" 5H="0" 5J="0">\'+J.4f(J.V("1t"))+"<3T><3P>"+(1u?\'<2d 1g="1u">\'+J.3Q(a)+"":"")+\'<2d 1g="17">\'+b+""},2F:6(a){I(a===N)a="";J.17=a;K b=J.3Y("T");b.3X=J.1H(a);J.V("16")&&w(p(b,".16"),"5c",e.16.2b);J.V("3V-17")&&w(p(b,".17"),"56",f);H b},2Q:6(a){J.1c=""+1Q.5d(1Q.5n()*5k).1q();e.1Y.2A[t(J.1c)]=J;J.1n=C(e.2v,a||{});I(J.V("2k")==R)J.1n.16=J.1n.1u=11},5j:6(a){a=a.Q(/^\\s+|\\s+$/g,"").Q(/\\s+/g,"|");H"\\\\b(?:"+a+")\\\\b"},5f:6(a){J.28={18:{1I:a.18,23:"1k"},1b:{1I:a.1b,23:"1k"},17:1f M("(?<18>"+a.18.1m+")(?<17>.*?)(?<1b>"+a.1b.1m+")","5o")}}};H e}();1j 2e!="1d"&&(2e.1v=1v);',62,441,'||||||function|||||||||||||||||||||||||||||||||||||return|if|this|var|length|XRegExp|null|for|index|replace|true||div|push|getParam|call|exec|else|prototype||false|lastIndex|config|arguments|RegExp|toolbar|code|left|captureNames|slice|right|id|undefined|split|new|class|addToken|indexOf|typeof|script|className|source|params|substr|apply|toString|String|line|title|gutter|SyntaxHighlighter|_xregexp|strings|lt|html|test|OUTSIDE_CLASS|match|brush|document|target|gt|getHtml|regex|global|join|style|highlight|break|concat|window|Math|isRegExp|throw|value|brushes|brushName|space|alert|vars|http|syntaxhighlighter|expandSource|size|css|case|font|Fa|name|htmlScript|dA|can|handler|gm|td|exports|color|in|href|first|discoveredBrushes|light|collapse|object|cache|getButtonHtml|trigger|pattern|getLineHtml|nbsp|numbers|parseInt|defaults|com|items|www|pad|highlighters|execute|focus|func|all|getDiv|parentNode|navigator|INSIDE_CLASS|regexList|hasFlag|Match|useScriptTags|hasNamedCapture|text|help|init|br|input|gi|Error|values|span|list|250|height|width|screen|top|500|tagName|findElements|getElementsByTagName|aboutDialog|_blank|appendChild|charAt|Array|copyAsGlobal|setFlag|highlighter_|string|attachEvent|nodeName|floor|backref|output|the|TypeError|sticky|Za|iterate|freezeTokens|scope|type|textarea|alexgorbatchev|version|margin|2010|005896|gs|regexLib|body|center|align|noBrush|require|childNodes|DTD|xhtml1|head|org|w3|url|preventDefault|container|tr|getLineNumbersHtml|isNaN|userAgent|tbody|isLineHighlighted|quick|void|innerHTML|create|table|links|auto|smart|tab|stripBrs|tabs|bloggerMode|collapsed|plain|getCodeLinesHtml|caption|getMatchesHtml|findMatches|figureOutLineNumbers|removeNestedMatches|getTitleHtml|brushNotHtmlScript|substring|createElement|Highlighter|load|HtmlScript|Brush|pre|expand|multiline|min|Can|ignoreCase|find|blur|extended|toLowerCase|aliases|addEventListener|innerText|textContent|wasn|select|createTextNode|removeChild|option|same|frame|xmlns|dtd|twice|1999|equiv|meta|htmlscript|transitional|1E3|expected|PUBLIC|DOCTYPE|on|W3C|XHTML|TR|EN|Transitional||configured|srcElement|Object|after|run|dblclick|matchChain|valueOf|constructor|default|switch|click|round|execAt|forHtmlScript|token|gimy|functions|getKeywords|1E6|escape|within|random|sgi|another|finally|supply|MSIE|ie|toUpperCase|catch|returnValue|definition|event|border|imsx|constructing|one|Infinity|from|when|Content|cellpadding|flags|cellspacing|try|xhtml|Type|spaces|2930402|hosted_button_id|lastIndexOf|donate|active|development|keep|to|xclick|_s|Xml|please|like|you|paypal|cgi|cmd|webscr|bin|highlighted|scrollbars|aspScriptTags|phpScriptTags|sort|max|scriptScriptTags|toolbar_item|_|command|command_|number|getElementById|doubleQuotedString|singleLinePerlComments|singleLineCComments|multiLineCComments|singleQuotedString|multiLineDoubleQuotedString|xmlComments|alt|multiLineSingleQuotedString|If|https|1em|000|fff|background|5em|xx|bottom|75em|Gorbatchev|large|serif|CDATA|continue|utf|charset|content|About|family|sans|Helvetica|Arial|Geneva|3em|nogutter|Copyright|syntax|close|write|2004|Alex|open|JavaScript|highlighter|July|02|replaceChild|offset|83'.split('|'),0,{})) diff --git a/demos/workflow/syntaxhighlighter/shThemeDefault.css b/demos/workflow/syntaxhighlighter/shThemeDefault.css deleted file mode 100644 index 22ca0b0a..00000000 --- a/demos/workflow/syntaxhighlighter/shThemeDefault.css +++ /dev/null @@ -1,109 +0,0 @@ -/** - * SyntaxHighlighter - * http://alexgorbatchev.com/SyntaxHighlighter - * - * SyntaxHighlighter is donationware. If you are using it, please donate. - * http://alexgorbatchev.com/SyntaxHighlighter/donate.html - * - * @version - * 3.0.83 (July 02 2010) - * - * @copyright - * Copyright (C) 2004-2010 Alex Gorbatchev. - * - * @license - * Dual licensed under the MIT and GPL licenses. - */ - -.syntaxhighlighter .line.highlighted.alt1, .syntaxhighlighter .line.highlighted.alt2 { - background-color: #e0e0e0 !important; -} -.syntaxhighlighter .line.highlighted.number { - color: black !important; -} -.syntaxhighlighter table caption { - color: black !important; -} -.syntaxhighlighter .gutter { - color: #afafaf !important; -} -.syntaxhighlighter .gutter .line { - border-right: 3px solid #6ce26c !important; -} -.syntaxhighlighter .gutter .line.highlighted { - background-color: #6ce26c !important; - color: white !important; -} -.syntaxhighlighter.printing .line .content { - border: none !important; -} -.syntaxhighlighter.collapsed { - overflow: visible !important; -} -.syntaxhighlighter.collapsed .toolbar { - color: blue !important; - background: white !important; - border: 1px solid #6ce26c !important; -} -.syntaxhighlighter.collapsed .toolbar a { - color: blue !important; -} -.syntaxhighlighter.collapsed .toolbar a:hover { - color: red !important; -} -.syntaxhighlighter .toolbar { - color: white !important; - background: #6ce26c !important; - border: none !important; -} -.syntaxhighlighter .toolbar a { - color: white !important; -} -.syntaxhighlighter .toolbar a:hover { - color: black !important; -} -.syntaxhighlighter .plain, .syntaxhighlighter .plain a { - color: black !important; -} -.syntaxhighlighter .comments, .syntaxhighlighter .comments a { - color: #008200 !important; -} -.syntaxhighlighter .string, .syntaxhighlighter .string a { - color: blue !important; -} -.syntaxhighlighter .keyword { - color: #006699 !important; -} -.syntaxhighlighter .preprocessor { - color: gray !important; -} -.syntaxhighlighter .variable { - color: #aa7700 !important; -} -.syntaxhighlighter .value { - color: #009900 !important; -} -.syntaxhighlighter .functions { - color: #ff1493 !important; -} -.syntaxhighlighter .constants { - color: #0066cc !important; -} -.syntaxhighlighter .script { - font-weight: bold !important; - color: #006699 !important; - background-color: none !important; -} -.syntaxhighlighter .color1, .syntaxhighlighter .color1 a { - color: gray !important; -} -.syntaxhighlighter .color2, .syntaxhighlighter .color2 a { - color: #ff1493 !important; -} -.syntaxhighlighter .color3, .syntaxhighlighter .color3 a { - color: red !important; -} - -.syntaxhighlighter .keyword { - font-weight: bold !important; -} diff --git a/tests/Cases/CardsTest.php b/tests/Cases/CardsTest.php index 53f0900c..890e036e 100644 --- a/tests/Cases/CardsTest.php +++ b/tests/Cases/CardsTest.php @@ -66,11 +66,13 @@ public function test_Card_Validate() $cardValidation->AuthorId = $john->Id; $cardValidation->SecureModeReturnUrl = "http://www.example.com/"; $cardValidation->BrowserInfo = $this->getBrowserInfo(); + $cardValidation->SecureMode = "NO_CHOICE"; try { $validatedCard = $this->_api->Cards->ValidateCard($cardRegistration->CardId, $cardValidation); $this->assertNotNull($validatedCard); $this->assertNotNull($validatedCard->Id); + $this->assertNotNull($validatedCard->SecureMode); } catch (Exception $e) { print_r("can't test due to client issues"); }