Bitcoin Forum
May 21, 2024, 04:23:55 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [HELP] Blockchain.info API  (Read 515 times)
apoorvlathey (OP)
Hero Member
*****
Offline Offline

Activity: 1162
Merit: 547


CryptoTalk.Org - Get Paid for every Post!


View Profile WWW
April 02, 2016, 07:23:22 AM
 #1

I have decided to use blockcahin.info API for payment integration. I created a php to generate new address to send the BTC to. But this new generated address is not showing in my blockchain.info wallet. Is this normal?

Here are the codes for the two :

New address Generator :

Code:
<?php
$secret 
'abc';

$my_xpub 'xpub123';
$my_api_key 'api123';

$my_callback_url 'http://yoyobtcrotator.cf/callback.php?&secret='.$secret;

$root_url 'https://api.blockchain.info/v2/receive';

$parameters 'xpub=' .$my_xpub'&callback=' .urlencode($my_callback_url). '&key=' .$my_api_key;

$response file_get_contents($root_url '?' $parameters);

$object json_decode($response);

echo 
'Send Payment To : ' $object->address;
?>

Callback.php :

Code:
<?php
$real_secret 
'abc';
$transaction_hash $_GET['transaction_hash'];
$value_in_satoshi $_GET['value'];
$value_in_btc $value_in_satoshi 100000000;

if (
$_GET['test'] == true) {
    return;
}


if (
$_GET['confirmations'] >= && $_GET['value'] >=10000) {
    
    echo 
'*ok*';
} else {
   
}
?>

The secret, api, xpub are imaginary.

Working : New address is generated for each user, the user needs to pay 10k or above and the callback.php displays *ok*.
Are these codes correct ?

Monnt
Legendary
*
Offline Offline

Activity: 938
Merit: 1002


View Profile
April 03, 2016, 03:06:13 AM
 #2

From what I can see, they are. Your code is echoeing *OK* back to you, so everything is going as you want it to, based on your parameters.
apoorvlathey (OP)
Hero Member
*****
Offline Offline

Activity: 1162
Merit: 547


CryptoTalk.Org - Get Paid for every Post!


View Profile WWW
April 03, 2016, 07:59:52 AM
 #3

I want that after receiving the payment then the user should be redirected to another url automatically. How should i edit the code to achieve it ?
Would this work ?

Code:
$URL = 'http://example.com/proceed.php';
if ($_GET['value'] >=1000) {
        echo '*ok*';
header('Location: '.$URL);
} else {
   
}

hoop
Legendary
*
Offline Offline

Activity: 1523
Merit: 1001


NOBT - WNOBT your saving bank◕◡◕


View Profile WWW
April 03, 2016, 12:46:06 PM
 #4

 Your site on shared hosting or VPS/Server

            ██████████  ██████████▄▄
         █████████████  ██████████████▄▄
   ▄███  █████▄                  ▀▀███████▄
  ██████   ▀█████▄          ████     ▀▀█████
 █████        ▀█████▄       ████        █████
 ████            ▀████      ████         ████
 ████         ██▄   ▀█  ██▄ ████         ████
 ████▌        █████▄    ████████        ▐████
 ▐████        ████████    ▀█████        ████▌
  █████       ████ ▀██  █▄   ▀██       █████
   █████      ████      ████▄         █████
    █████▄    ████       ▀█████▄    ▄█████
     ▀█████▄  ████          ▀█████▄   ██▀
       ▀█████▄                 ▀█████
         ▀██████▄▄          ▄▄██████▀
            ▀▀████████  ████████▀▀
                ▀▀████  ████▀▀
Take care of your financial privacy
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
A blockchain loyalty scheme and more
██
██
██
██
██
██
██
██
██
██
██
██


███████████████
███          ██████████████████
████████████████████████████████
███                          ███
███                          ███
███             ██           ███
███       ██   ██   ██       ███
███      ██    ██    ██      ███
███       ██  ██    ██       ███
███                          ███
███                          ███
████████████████████████████████


           ████    ████
       █████████ ████████
                           
████████████████████████████
█████████████████████████████
██████████████████
██████████████████ ███████████
██████████████████ ██    █████
██████████████████ ███████████
██████████████████
█████████████████████████████
████████████████████████████


        ▄█████▄
      ▄█████████
     ████    ███▌
    ███       ██▌
   ▐██ ███  ████
   ▄███████████
  ███████████▀
 ████  ███ ██▌
▐██       ███
▐███    ████
 █████████▀
  ▀█████▀
██
██
██
██
██
██
██
██
██
██
██
██
ANN         Discord
Twitter    Telegram
Nobt-plataform
apoorvlathey (OP)
Hero Member
*****
Offline Offline

Activity: 1162
Merit: 547


CryptoTalk.Org - Get Paid for every Post!


View Profile WWW
April 03, 2016, 12:51:57 PM
 #5

Your site on shared hosting or VPS/Server
Yes my site is on a hosting provide. I don't have my own dedicated server.
The hosting provider is currently free one but i would upgrade soon.

hoop
Legendary
*
Offline Offline

Activity: 1523
Merit: 1001


NOBT - WNOBT your saving bank◕◡◕


View Profile WWW
April 04, 2016, 12:38:32 AM
 #6

Your site on shared hosting or VPS/Server
Yes my site is on a hosting provide. I don't have my own dedicated server.
The hosting provider is currently free one but i would upgrade soon.
You need VPS or Server.

  more info in this topic  https://bitcointalk.org/index.php?topic=1391888.msg14150323#msg14150323 

            ██████████  ██████████▄▄
         █████████████  ██████████████▄▄
   ▄███  █████▄                  ▀▀███████▄
  ██████   ▀█████▄          ████     ▀▀█████
 █████        ▀█████▄       ████        █████
 ████            ▀████      ████         ████
 ████         ██▄   ▀█  ██▄ ████         ████
 ████▌        █████▄    ████████        ▐████
 ▐████        ████████    ▀█████        ████▌
  █████       ████ ▀██  █▄   ▀██       █████
   █████      ████      ████▄         █████
    █████▄    ████       ▀█████▄    ▄█████
     ▀█████▄  ████          ▀█████▄   ██▀
       ▀█████▄                 ▀█████
         ▀██████▄▄          ▄▄██████▀
            ▀▀████████  ████████▀▀
                ▀▀████  ████▀▀
Take care of your financial privacy
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
A blockchain loyalty scheme and more
██
██
██
██
██
██
██
██
██
██
██
██


███████████████
███          ██████████████████
████████████████████████████████
███                          ███
███                          ███
███             ██           ███
███       ██   ██   ██       ███
███      ██    ██    ██      ███
███       ██  ██    ██       ███
███                          ███
███                          ███
████████████████████████████████


           ████    ████
       █████████ ████████
                           
████████████████████████████
█████████████████████████████
██████████████████
██████████████████ ███████████
██████████████████ ██    █████
██████████████████ ███████████
██████████████████
█████████████████████████████
████████████████████████████


        ▄█████▄
      ▄█████████
     ████    ███▌
    ███       ██▌
   ▐██ ███  ████
   ▄███████████
  ███████████▀
 ████  ███ ██▌
▐██       ███
▐███    ████
 █████████▀
  ▀█████▀
██
██
██
██
██
██
██
██
██
██
██
██
ANN         Discord
Twitter    Telegram
Nobt-plataform
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!