Closed Sjors closed 11 years ago
Someone (perhaps you?) would need to contribute the code for this. See https://github.com/Shopify/active_merchant/wiki/contributing
I have contributed the Migs gateway and you can message me for advice if you want. When doing my contribution I found the best was to look at other gateways and see how it was done. I generally followed the standards as determined by looking at other gateways.
I'm happy to guide you via email if you have questions along the way.
Ultimately a gateway class looks something like:
class MyGateway
self.url = 'http://theurl.com'
self.supported_countries = %w(AU CA US)
self.supported_cardtypes = [:visa, :master, :american_express, :diners_club, :jcb]
self.money_format = :cents
def initialize(options = {})
requires!(options, :login, :password)
super
end
def purchase(money, creditcard, options = {})
requires!(options, :order_id)
post = {:amount => money.format}
add_creditcard(post, creditcard)
data = ssl_post self.url, post_data(post)
response_hash = parse(data)
response_object(response_hash)
end
def response_object(response)
Response.new(success?(response), response[:message], response,
:authorization => response[:transaction_no]
)
end
end
@mnoack thanks. I sent bitpay.com an application to open an account with them. Once I have figured out if that works and if I have the time, I'll try to contribute a gateway. Should we keep this ticket open so that other people who are interested can find each other?
https://coinbase.com/ would be another option.
I'd prefer to close this out, as Issues doesn't work well for tracking speculative work. Folks can still find it via search, and you'll still get notifications if people post to it.
Ok, that's fine.
Coinbase doesn't do bank transfers outside the USA, but that's not necessarily a problem. I'll see which API I like best.
Any progress on this at all? Would love to get Bitcoin processing on my site!
What would be involved to allow an active_merchant powered rails app to accept bitcoin payments? At minimum it should be able to create a payment request and verify that the transaction took place.
The most lazy variant would generate a link with the shop's bitcoin address and a unique invoice number, which then opens the user's bitcoin wallet client. It then checks blockhain.info every 10 seconds or so to see if the transaction has been received.
A less lazy variant would offer several ways to pay depending on the different clients out there and run it's own bitcoin node (perhaps using bitcoin-ruby) to verify receiving the transaction.
Another approach would be to integrate with a service like BitPay.