예제 #1
0
     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':
     $pagination = HtmlHelper::getEntity('Pagination');
     $methodName = $subEntityName;
     $filter = null;
     if (isset($filterName) && $filterName != "") {
         $filter = HtmlHelper::getEntity($filterName);
     }
     if (isset($filter) && !isset($sorting)) {
         $apiResult = $api->{$subApiName}->{$methodName}($entityId, $pagination, $filter);
     } else {
         if (!isset($filter) && isset($sorting)) {
             $apiResult = $api->{$subApiName}->{$methodName}($entityId, $pagination, $sorting);
         } else {
             if (isset($filter) && isset($sorting)) {
                 $apiResult = $api->{$subApiName}->{$methodName}($entityId, $pagination, $filter, $sorting);
             } else {
                 $apiResult = $api->{$subApiName}->{$methodName}($entityId, $pagination);
             }
         }
     }
     print '<pre>';
예제 #2
0
             }
             print '<pre>';
             print_r($pagination);
             print '</pre>';
             if (isset($sorting)) {
                 print '<pre>Sort: ';
             }
             print_r($_POST["_sort_"]);
             print '</pre>';
             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;
     }
     print '<pre>';
     print_r($apiResult);
     print '</pre>';
 } catch (\MangoPay\Libraries\ResponseException $e) {
     echo '<div style="color: red;">\\MangoPay\\ResponseException: Code: ' . $e->getCode();
     echo '<br/>Message: ' . $e->getMessage();
     $details = $e->GetErrorDetails();
     if (!is_null($details)) {
         echo '<br/><br/>Details: ';