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
stage: homeassistant | |
variables: | |
PYTHONPATH: "/usr/src/app:$PYTHONPATH" | |
before_script: | |
- python -m homeassistant --version | |
- mv mock_secrets.yaml secrets.yaml | |
script: | |
- | | |
python -m homeassistant \ | |
--config . \ |
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
result = Braintree::Transaction.sale( | |
:amount => "10.00", | |
:payment_method_nonce => "nonce-from-the-client" | |
) |
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
result = Braintree::Transaction.sale( | |
:amount => "10.00", | |
:payment_method_nonce => "nonce-from-the-client", | |
:merchant_account_id => "provider_sub_merchant_account", | |
:service_fee_amount => "1.00" | |
) |
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
Braintree::Transaction.sale( | |
:payment_method_token => "the_token", | |
:amount => "10.00" | |
) |
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
result = Braintree::Customer.create( | |
:first_name => "John", | |
:last_name => "Doe", | |
:payment_method_nonce => params[:payment_method_nonce] | |
) | |
if result.success? | |
puts result.customer.id | |
puts result.customer.credit_cards[0].token | |
end |
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
Braintree::Transaction.sale( | |
:amount => "100.00", | |
:payment_method_nonce => "nonce-from-the-client", | |
:options => { | |
:store_in_vault_on_success => true | |
} | |
) |
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
.braintree-hosted-fields-focused { | |
border-color: blue; | |
} | |
.braintree-hosted-fields-invalid { | |
border-color: red; | |
} | |
.braintree-hosted-fields-valid { | |
border-color: green; |
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
React.render( | |
<HostedFields />, document.getElementById('fields') | |
); |
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 Hosted Fields with React | |
div#fields | |
script. | |
var clientToken = '#{clientToken}'; | |
script(type='text/jsx' src='javascripts/index.js') |
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
var HostedFields = React.createClass({ | |
componentDidMount: function() { | |
this.initBraintree(); | |
}, | |
initBraintree() { | |
braintree.setup(clientToken, 'custom', { | |
id: 'hosted', | |
hostedFields: { | |
onFieldEvent: function (event) { | |
if (event.type === 'fieldStateChange') { |
NewerOlder