Skip to content

Instantly share code, notes, and snippets.

@appsgenii
Last active December 26, 2015 12:52
Show Gist options
  • Select an option

  • Save appsgenii/aeb4f955c53b2a6a9716 to your computer and use it in GitHub Desktop.

Select an option

Save appsgenii/aeb4f955c53b2a6a9716 to your computer and use it in GitHub Desktop.
stripe_bitcoin_receiver = Stripe::BitcoinReceiver.create(
{
amount: dollar_to_cents(amount),
currency: currency,
description: charge_description,
refund_mispayments: true,
email: user.email,
metadata: charge_metadata
},
merchant_stripe_access_token
)
# "{"id":"btcrcv_17MHRCDtBWPHkYdT2Cte9Oay","object":"bitcoin_receiver","active":false,"amount":2845,"amount_received":0,"bitcoin_amount":28450000,"bitcoin_amount_received":0,"bitcoin_uri":"bitcoin:test_3Bb3YdEqU6Xmqb141YleVZ2BqhYk9?amount=0.28450000","created":1451133982,"currency":"usd","customer":null,"description":"Charge for Invoice #166B","email":"[email protected]","filled":false,"inbound_address":"test_3Bb3YdEqU6Xmqb141YleVZ2BqhYk9","livemode":false,"metadata":{"First Name":"Najeeb","Last Name":"Idrees","Email":"[email protected]"},"payment":null,"refund_address":null,"transactions":{"object":"list","data":[],"has_more":false,"total_count":0,"url":"/v1/bitcoin/receivers/btcrcv_17MHRCDtBWPHkYdT2Cte9Oay/transactions"},"uncaptured_funds":false,"used_for_payment":false}"
# After its filled successufully.
stripe_charge = Stripe::Charge.create(
{
amount: dollar_to_cents(amount),
currency: currency,
# customer: member_profile.stripe_customer_id,
source: stripe_bitcoin_receiver.id,
description: charge_description,
application_fee: dollar_to_cents(application_fee),
capture: is_captured,
statement_descriptor: statement_descriptor,
metadata: charge_metadata
},
merchant_stripe_access_token
)
# Getting this error.
# Stripe::InvalidRequestError: (Status 404) No such bitcoin receiver: btcrcv_17MHRCDtBWPHkYdT2Cte9Oay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment