Exemple #1
0
 /**
  * Constructs a new Stripe instance
  * @param string $environment		'sandbox' or 'production'
  * @param mixed $merchant_attr		Account ID, ElggEntity or entity guid of the merchant on whose behalf the requests are to be made
  * @return StripeClient
  */
 function __construct($environment = null, $merchant_attr = null)
 {
     StripeClientFactory::stageEnvironment($environment);
     $merchant = new StripeMerchant($merchant_attr);
     $access_token = $merchant->getAccessToken();
     $this->setAccessToken($access_token);
 }
Exemple #2
0
<?php

/**
 * Add new card form
 *
 * @uses boolean $vars['show_footer']	Whether or not the form button bank should be displayed
 * @uses boolean $vars['show_remember'] Whether to display a checkbox to toggle remember option
 * @uses boolean $vars['zip_check']		Whether the zip code field should be included in the form
 * @uses boolean $vars['address_check'] Whether the address_line1 field should be included in the form
 */
$required = elgg_echo('required');
$merchant = new StripeMerchant();
$brands = $merchant->getSupportedCards();
foreach ($brands as $brand) {
    $supported_brands .= '<li class="stripe-accepted-card">' . elgg_view('output/img', array('src' => elgg_get_site_url() . 'mod/stripe/graphics/credit_card/' . strtolower(str_replace(' ', '', $brand)) . '.png'));
}
$supported_brands = '<ul class="stripe-accepted-cards">' . $supported_brands . '</ul>';
?>
<fieldset class="stripe-row" data-stripe>
	<div class="small-12 columns">
		<label><?php 
echo elgg_echo('stripe:cards:accepted_cards');
?>
</label>
		<?php 
echo $supported_brands;
?>
	</div>
	<div class="small-12 columns">
		<label title="<?php 
echo $required;