Author

Topic: blockchain.info receive payments API problem (Read 6772 times)

full member
Activity: 216
Merit: 100
November 25, 2012, 09:10:52 AM
#10
WordPress: I use the TRUEedit WordPress plugin (prevents WP from editing your page code).

QR Code: The documentation for blockchain.info's receive API is a bit lacking. The PHP example code includes the following, which gets turned into the QR code:

Code:


Anonymous: I don't think the anonymous feature works the way you want. I think it's meant for you to receive an anonymous payment, rather than the sender paying to an anonymous address. However, that doesn't seem very useful... not sure what their intent is.

BTW, I decided to scrap the JS button code and implemented my own PHP processing. It still calls the blockchain.info API to create addresses and set the callback, but it does not rely on any JS. All the logic is server-side.
hero member
Activity: 614
Merit: 500
November 23, 2012, 05:05:58 PM
#9
Okay, I've fixed half of my problems. My stupid page editor for Wordpress was inserting
Code:

breaks in places it shouldn't have, and causing errors.

After removing those breaks the button now works. However, the QR code is not showing up. It gives me a new address, which is nice, but not the QR part, which is essential.

Also, when setting the anonymous address to "true," I still don't see how it's that anonymous if any old bloke can just view the page source and see the final address that the donation will be going to. Any way to conceal that a little better?
hero member
Activity: 614
Merit: 500
November 23, 2012, 02:41:49 PM
#8
Nope. I'm still getting the same problem. Even after using the code from the donate button instead of just manually editing it, it still fails.

The real potential problem I see is that I'm using this code:

Code:

For a donate button. Shouldn't there be some unique javascript for a donate button. Or are we really just using the same javascript for a donate button as the pay now button?
full member
Activity: 216
Merit: 100
November 23, 2012, 09:59:33 AM
#7
Well, I thought I had figured it out. I realized that I had two instances of script linking to the jquery library, and older version and the newer version. I thought, and hoped, that that was the problem. So, I removed the instance of the older jquery library( and edited all of the links in my website to the newer library) but it didn't fix anything. I still get errors.

Now, when I load the page I get plain text of data address and data anonymous and then below that is the donate image. But when I click on the donate image I get this:

data-address="1JoyZBGXKdSSeTpLHMLGTSLUDKbLLjWqjt"
data-anonymous="true">
Error Invalid Destination Bitcoin Address

What browsers are you using? Clicking the Donation button on may be easier than using the API docs  http://blockchain.info/address/1JoyZBGXKdSSeTpLHMLGTSLUDKbLLjWqjt


Two of us reported FF 16.0.2 above. Today I'm running FF 17.0 with the same problem. There are two sample buttons on the API docs page that fail this way: http://blockchain.info/api/api_receive

Update: The buttons work in Chrome! Thanks for your attention to this.

UPDATE: I just noticed that it works now in FF! I look forward to hearing the fix. Thanks!
hero member
Activity: 910
Merit: 1005
November 23, 2012, 06:24:54 AM
#6
Well, I thought I had figured it out. I realized that I had two instances of script linking to the jquery library, and older version and the newer version. I thought, and hoped, that that was the problem. So, I removed the instance of the older jquery library( and edited all of the links in my website to the newer library) but it didn't fix anything. I still get errors.

Now, when I load the page I get plain text of data address and data anonymous and then below that is the donate image. But when I click on the donate image I get this:

data-address="1JoyZBGXKdSSeTpLHMLGTSLUDKbLLjWqjt"
data-anonymous="true">
Error Invalid Destination Bitcoin Address

What browsers are you using? Clicking the Donation button on may be easier than using the API docs  http://blockchain.info/address/1JoyZBGXKdSSeTpLHMLGTSLUDKbLLjWqjt
hero member
Activity: 614
Merit: 500
November 21, 2012, 10:55:10 PM
#5
Well, I thought I had figured it out. I realized that I had two instances of script linking to the jquery library, and older version and the newer version. I thought, and hoped, that that was the problem. So, I removed the instance of the older jquery library( and edited all of the links in my website to the newer library) but it didn't fix anything. I still get errors.

Now, when I load the page I get plain text of data address and data anonymous and then below that is the donate image. But when I click on the donate image I get this:

data-address="1JoyZBGXKdSSeTpLHMLGTSLUDKbLLjWqjt"
data-anonymous="true">
Error Invalid Destination Bitcoin Address
full member
Activity: 216
Merit: 100
November 21, 2012, 09:51:43 AM
#4
I was just trying to integrate blockchain.info receive payments as well, and discovered this same problem: "Unknown Error" when you click their JS button. Even the buttons on their own page fail the same way: http://blockchain.info/api/api_receive

I'm also in FF 16.0.2. I tested with jQuery 1.7.1, 1.8.0, and 1.8.2. jQuery 1.7.x does not work at all. The 1.8.x fail with "Unknown Error".

I read the JS and it appears to be constructing a valid URL to the receive api. Constructing my own URL (https://blockchain.info/api/receive?method=create&address...) woks fine and a JSON object is returned, which appears to have the input_address field the JS is expecting.

The failure is that the "response" variable is not set after the URL call in the JS code. I have no further information why.

I hope this helps someone identify the issue. Thanks for any feedback. In the meantime, maybe I'll just implement a non-JS approach.
hero member
Activity: 614
Merit: 500
November 20, 2012, 03:17:23 PM
#3
what browser are you using to test the code?

FF 16.0.2
hero member
Activity: 686
Merit: 500
Shame on everything; regret nothing.
November 20, 2012, 03:15:05 PM
#2
what browser are you using to test the code?
hero member
Activity: 614
Merit: 500
November 17, 2012, 11:05:00 PM
#1
I currently have a donation page on my website here:

http://dailyanarchist.com/contribute/

It's using a static address and it looks hokey. Needless to say the donate bitcoin button javascript offered by blockchain.info is pretty badass. So, I tried to implement it. But I ran into problems.

First thing I did was copy this:

Code:


into my header.php. That's where my head tag is.

Then I went into my word press page that allows me to put in HTML in to the contributor page I have set up. So, I copied this:
Code:
[code]
     data-address="1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq"
     data-anonymous="false"
     data-callback="https://mydomain.com/callback_url">
    

        
    

    

        
    

    

        Please send payment to bitcoin address [[address]]
    

    

        Payment Received [[value]] BTC. Thank You.
    

    

        [[error]]
    

[/code]

Then I modified the data-address to one of my own. I also toggled the false to true and I removed the callback command since it's just a donation button.

Then I previewd the changes and I got the pay now button, with other problems. No problem. With a little playing around I switched the .png to the donate bitcoin .png. Then I previewed again. For some reason the div style, class, address etc were appearing in plain text. Long story short: I'm still having difficulties. I got it to show the right donation image, but when I click the button it gives me an error code. Is there something I'm missing? Also, is there a .js for the donate bitcoin? Because what is offered looks like it's pay with bitcoin specific javascript.
Jump to: