recurring billing in php application using braintree payment gateway? -


if can implemented braintree payment gateway in php me recurring billing in php application using braintree payment gateway

my code follows:

<?php function braintree_text_field($label, $name, $result) {  echo('<div>' . $label . '</div>');  $fieldvalue = isset($result) ? $result->valueforhtmlfield($name) : '';  echo('<div><input type="text" name="' . $name .'" value="' . $fieldvalue . '" /></div>');  $errors = isset($result) ? $result->errors->onhtmlfield($name) : array();  foreach($errors $error) {      echo('<div style="color: red;">' . $error->message . '</div>');  }  echo("\n");  }c  ?> 

<head>      <title>braintree payment - debt relief</title>  </head>  <body>      <?php      if (isset($_get["id"])) {          $result = braintree_transparentredirect::confirm($_server['query_string']);      }      if (isset($result) && $result->success) { ?>          <h1>braintree payment -debt relief</h1>          <?php $transaction = $result->transaction; ?>          <table>              <tr><td>transaction id</td><td><?php echo htmlentities($transaction->id); ?></td></tr>              <tr><td>transaction status</td><td><?php echo htmlentities($transaction->status); ?></td></tr>              <tr><td>transaction amount</td><td><?php echo htmlentities($transaction->amount); ?></td></tr>              <tr><td>customer first name</td><td><?php echo htmlentities($transaction->customerdetails->firstname); ?></td></tr>              <tr><td>customer last name</td><td><?php echo htmlentities($transaction->customerdetails->lastname); ?></td></tr>              <tr><td>customer email</td><td><?php echo htmlentities($transaction->customerdetails->email); ?></td></tr>              <tr><td>credit card number</td><td><?php echo htmlentities($transaction->creditcarddetails->maskednumber); ?></td></tr>              <tr><td>expiration date</td><td><?php echo htmlentities($transaction->creditcarddetails->expirationdate); ?></td></tr>          </table>      <?php      } else {          if (!isset($result)) { $result = null; } ?>          <h1>braintree payment -debt relief</h1>          <?php if (isset($result)) { ?>              <div style="color: red;"><?php echo $result->errors->deepsize(); ?> error(s)</div>          <?php } ?>          <form method="post" action="<?php echo braintree_transparentredirect::url() ?>" autocomplete="off">              <fieldset>                  <legend>customer</legend>                  <?php braintree_text_field('first name', 'transaction[customer][first_name]', $result); ?>                  <?php braintree_text_field('last name', 'transaction[customer][last_name]', $result); ?>                  <?php braintree_text_field('email', 'transaction[customer][email]', $result); ?>              </fieldset>                <fieldset>                  <legend>payment information</legend>                    <?php braintree_text_field('credit card number', 'transaction[credit_card][number]', $result); ?>                  <?php braintree_text_field('expiration date (mm/yy)', 'transaction[credit_card][expiration_date]', $result); ?>                  <?php braintree_text_field('cvv', 'transaction[credit_card][cvv]', $result); ?>              </fieldset>                <?php                  define('transaction_path',base_url.'admin/single_transactions');              $tr_data = braintree_transparentredirect::transactiondata(                  array('redirecturl' => transaction_path,                 /* array('redirecturl' => base_path.'admin/single_transactions'. parse_url($_server["request_uri"], php_url_path),*/                  'transaction' => array('amount' => '10.00', 'type' => 'sale'))) ?>              <input type="hidden" name="tr_data" value="<?php echo $tr_data ?>" />                <br />              <input type="submit" value="submit" />          </form>      <?php } ?>  </body> 

full disclosure: work @ braintree. if have further questions, feel free contact support.

transparent redirect not support recurring billing, cannot create subscriptions it. please follow our recurring billing guide more information on how use it.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -