MemHT Portal is a Free PHP CMS and Blog
It permit the creation and the management online of websites with few and easy steps.
It's completely customizable, expandable and suitable for all needs.
A2Hosting
Moderators: Moderators
Forum RSS feedReply
Help with Integration
AuthorText
slashado
Donator

Posts: 323
Contributes: 350

Gender: _MALE_
Online: No

Version: 4.0.1
Country: Brasil
Languages: Português, Inglês (via Google), e todas as outras (via google)
Date: 23/06/2009 04:59
Help with Integration
#post20818
Following staff ... Mem .. I need to do an integration to my site, is for personal use, not trade anything, is for my site "www.mscriacoes.com.br", as now I also see the hosting plan, I am trying to make this a long time integration, but I do not know how, I ask for help ...
It is the following, is like PayPal, only changing the name almost.
I need this code to save the information received in the database, the famous "Auto Return" equal to the PayPal
Is that when a customer sign a hosting plan, the payment sends the digital information directly to my site, I am saving to go to stay with it all the time!
If anyone can help me with it, be eternally grateful.
The code is:
code
<?
// variables to return

// Token's Store
$token = ### 5F5CE2E3256380EE85089 ###;


/* Mounting the variables to return */

$id_transacao = $_POST['id_transacao'];
$data_transacao = $_POST['data_transacao'];
$data_credito = $_POST['data_credito'];
$valor_original = $_POST['valor_original'];
$valor_loja = $_POST['valor_loja'];
$desconto = $_POST['desconto'];
$acrescimo = $_POST['acrescimo'];
$tipo_pagamento = $_POST['tipo_pagamento'];
$parcelas = $_POST['parcelas'];
$cliente_nome = $_POST['cliente_nome'];
$cliente_email = $_POST['cliente_email'];
$cliente_rg = $_POST['cliente_rg'];
$cliente_data_emissao_rg = $_POST['cliente_data_emissao_rg'];
$cliente_orgao_emissor_rg = $_POST['cliente_orgao_emissor_rg'];
$cliente_estado_emissor_rg = $_POST['cliente_estado_emissor_rg'];
$cliente_cpf = $_POST['cliente_cpf'];
$cliente_sexo = $_POST['cliente_sexo'];
$cliente_data_nascimento = $_POST['cliente_data_nascimento'];
$cliente_endereco = $_POST['cliente_endereco'];
$cliente_complemento = $_POST['cliente_complemento'];
$status = $_POST['status'];
$cod_status = $_POST['cod_status'];
$cliente_bairro = $_POST['cliente_bairro'];
$cliente_cidade = $_POST['cliente_cidade'];
$cliente_estado = $_POST['cliente_estado'];
$cliente_cep = $_POST['cliente_cep'];
$frete = $_POST['frete'];
$tipo_frete = $_POST['tipo_frete'];
$informacoes_loja = $_POST['informacoes_loja'];
$id_pedido = $_POST['id_pedido'];
$free = $_POST['free'];

/* This variable indicates the amount of returned products */
$qtde_produtos = $_POST['qtde_produtos'];

/ * Checking ID of the transaction * /
/ * Checking status of the transaction * /
/ * Checking original value * /
/ * Checking the store value * /

$post = "transacao=$id_transacao" .
"&status=$status" .
"&valor_original=$valor_original" .
"&valor_loja=$valor_loja" .
"&token=$token";
$enderecoPost = "https://www.pagamentodigital.com.br/checkout/verify/";

ob_start();
$ch = curl_init();
curl_setopt ($ch, CURLOPT_URL, $enderecoPost);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $post);
curl_exec ($ch);
$resposta = ob_get_contents();
ob_end_clean();

if(trim($resposta)=="VERIFICADO"){

// Loop to return data products
for ($x=1; $x <= $qtde_produtos; $x++) {

$produto_codigo = $_POST['produto_codigo_'.$x];
$produto_descricao = $_POST['produto_descricao_'.$x];
$produto_qtde = $_POST['produto_qtde_'.$x];
$produto_valor = $_POST['produto_valor_'.$x];
$produto_extra = $_POST['produto_extra_'.$x];

/ *
After obtaining the variables of the products, records in the database.
If product already exists, updates the data, but creates new application.
* /

}
}

?>
..::MS Criações::.. - Criação e Hospedagem de Websites!
..::Memht BRASIL::.. - Comunidade brasileira do MemHT!
Soon, Virtual Store with Modules and Templates for MemHT!
Eager for MemHT 5
Delete Edit Quote
 
mem
MemHT's Dad
Admin & Developer

mem

Posts: 7243
Contributes: 4800

Gender: _MALE_
Online: No

Languages: English, Italiano, Македонски, Српски
Date: 23/06/2009 13:19
Re: Help with Integration
#post20821
I don't know exactly how the PayPal API works, so you should check the PayPal tutorial, there are plenty of them.
Follow me on twitter if you want to be updated on the MemHT 5 development.
Delete Edit Quote
 
slashado
Donator

Posts: 323
Contributes: 350

Gender: _MALE_
Online: No

Version: 4.0.1
Country: Brasil
Languages: Português, Inglês (via Google), e todas as outras (via google)
Date: 24/06/2009 02:37
Re: Help with Integration
#post20828
In this case it's not PayPal, it is the "Pagamento Digital", which is equal to the payment system PayPal.
In the tutorial to use, do not explain in any way, as do the integration with the database, and why not do it because there are no tutorials, no one teaches, only want to sell and sell! But thanks Mem, I will give them a way to make me talk about how the structure of the database.
..::MS Criações::.. - Criação e Hospedagem de Websites!
..::Memht BRASIL::.. - Comunidade brasileira do MemHT!
Soon, Virtual Store with Modules and Templates for MemHT!
Eager for MemHT 5
Delete Edit Quote
 
Reply
Tags Cloud
Twitter updates...
Help MemHT Portal
Navigator
Users Block
Hi Guest
IP: 38.107.179.232

Username
Password
MemHT Wiki
Language
MemHT Portal is a free software released under the GNU/GPL License by Miltenovik Manojlo