agreements.phtml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // @codingStandardsIgnoreFile
  7. /**
  8. * @var \Magento\Paypal\Block\Billing\Agreements $block
  9. */
  10. $billingAgreements = $block->getBillingAgreements();
  11. $paymentMethods = $block->getWizardPaymentMethodOptions();
  12. ?>
  13. <div class="account-billing-agreements">
  14. <?php if (count($billingAgreements) > 0): ?>
  15. <?= $block->getChildHtml('pager') ?>
  16. <div class="table-wrapper billing-agreements">
  17. <table id="billing-agreements" class="data table table-billing-agreements">
  18. <caption class="table-caption"><?= $block->escapeHtml(__('Billing Agreements')) ?></caption>
  19. <thead>
  20. <tr>
  21. <th scope="col" class="col id"><?= $block->escapeHtml(__('Reference ID')) ?></th>
  22. <th scope="col" class="col status"><?= $block->escapeHtml(__('Status')) ?></th>
  23. <th scope="col" class="col created"><?= $block->escapeHtml(__('Created At')) ?></th>
  24. <th scope="col" class="col updated"><?= $block->escapeHtml(__('Updated At')) ?></th>
  25. <th scope="col" class="col payment"><?= $block->escapeHtml(__('Payment Method')) ?></th>
  26. <th scope="col" class="col actions">&nbsp;</th>
  27. </tr>
  28. </thead>
  29. <tbody>
  30. <?php foreach ($billingAgreements as $item): ?>
  31. <tr>
  32. <td data-th="<?= $block->escapeHtml(__('Reference ID')) ?>" class="col id">
  33. <?= $block->escapeHtml($block->getItemValue($item, 'reference_id')) ?>
  34. </td>
  35. <td data-th="<?= $block->escapeHtml(__('Status')) ?>" class="col status">
  36. <?= $block->escapeHtml($block->getItemValue($item, 'status')) ?>
  37. </td>
  38. <td data-th="<?= $block->escapeHtml(__('Created At')) ?>" class="col created">
  39. <?= $block->escapeHtml($block->getItemValue($item, 'created_at')) ?>
  40. </td>
  41. <td data-th="<?= $block->escapeHtml(__('Updated At')) ?>" class="col updated">
  42. <?= $block->escapeHtml($block->getItemValue($item, 'updated_at')) ?>
  43. </td>
  44. <td data-th="<?= $block->escapeHtml(__('Payment Method')) ?>" class="col payment">
  45. <?= $block->escapeHtml($block->getItemValue($item, 'payment_method_label')) ?>
  46. </td>
  47. <td data-th="" class="col actions">
  48. <a href="<?= $block->escapeUrl($block->getItemValue($item, 'edit_url')) ?>"
  49. class="action view">
  50. <span><?= $block->escapeHtml(__('View')) ?></span>
  51. </a>
  52. </td>
  53. </tr>
  54. <?php endforeach; ?>
  55. </tbody>
  56. </table>
  57. </div>
  58. <?php else: ?>
  59. <div class="message info empty">
  60. <span><?= $block->escapeHtml(__('There are no billing agreements yet.')) ?></span>
  61. </div>
  62. <?php endif; ?>
  63. <?php if ($paymentMethods): ?>
  64. <form action="<?= $block->escapeUrl($block->getCreateUrl()) ?>" method="post"
  65. class="form form-new-agreement">
  66. <fieldset class="fieldset">
  67. <legend class="legend">
  68. <span><?= $block->escapeHtml(__('New Billing Agreement')) ?></span>
  69. </legend>
  70. <br />
  71. <p class="note">
  72. <?= $block->escapeHtml(__('You will be redirected to the payment system website.')) ?>
  73. </p>
  74. <div class="field payment method">
  75. <div class="control">
  76. <select id="payment_method" name="payment_method">
  77. <option value=""><?= $block->escapeHtml(__('-- Please Select --')) ?></option>
  78. <?php foreach ($paymentMethods as $code => $title): ?>
  79. <option value="<?= $block->escapeHtml($code) ?>">
  80. <?= $block->escapeHtml($title) ?>
  81. </option>
  82. <?php endforeach; ?>
  83. </select>
  84. </div>
  85. </div>
  86. <div class="actions-toolbar">
  87. <div class="primary">
  88. <button type="submit" class="primary action create">
  89. <span><?= $block->escapeHtml(__('Create...')) ?></span>
  90. </button>
  91. </div>
  92. <div class="secondary">
  93. <a href="<?= $block->escapeUrl($block->getBackUrl()) ?>" class="action back">
  94. <span><?= $block->escapeHtml(__('Back')) ?></span>
  95. </a>
  96. </div>
  97. </div>
  98. </fieldset>
  99. </form>
  100. <?php else: ?>
  101. <div class="actions-toolbar">
  102. <div class="secondary">
  103. <a href="<?= $block->escapeUrl($block->getBackUrl()) ?>" class="action back">
  104. <span><?= $block->escapeHtml(__('Back')) ?></span>
  105. </a>
  106. </div>
  107. </div>
  108. <?php endif; ?>
  109. </div>