This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Payment: $<%= h @amount %></h1> | |
<%= form_for :transaction, | |
:params => @result && @result.params[:transaction], | |
:builder => ApplicationHelper::BraintreeFormBuilder, | |
:url => Braintree::TransparentRedirect.url, | |
:html => {:autocomplete => "off"} do |f| -%> | |
<% if @result && @result.errors -%> | |
<div style="color: red;"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
// we want to run this code once the browser is ready and has rendered the DOM. | |
// If you are using a javascript framework like jquery or prototype, you should | |
// change this to use the framework-specific event callback. | |
window.onload = function() { | |
// customerID, ddlCardType, etc are the names of the controls on your page | |
// the ClientId property will give you the id on the page, name spaced with | |
// the master page. | |
document.getElementById("<%= customerID.ClientId %>").setAttribute("name", "credit_card[number]"); | |
document.getElementById("<%= ddlCardType.ClientId %>").setAttribute("name", "credit_card[card_type]"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Partial Class WebUserControl1 | |
Inherits System.Web.UI.WebControls.DropDownList | |
Public Overrides ReadOnly Property UniqueId() As String | |
Get | |
Return "credit_card__expiration_month" | |
End Get | |
End Property | |
End Class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Finding active subscriptions from a set of transactions returned from a search. | |
# | |
found_transactions = Braintree::Transaction.search do |search| | |
search.type.is "sale" | |
search.source.is Braintree::Transaction::Source::Recurring | |
search.status.is "settled" | |
search.created_at.between 2.days.ago.utc.beginning_of_day, 2.days.ago.utc.end_of_day | |
end |
NewerOlder