-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpayments.php
40 lines (32 loc) · 1.28 KB
/
payments.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
require_once('../../../wp-load.php') ;
define('TOKEN', get_option('dbem_payments_token')) ;
require_once('payments_callback.php') ;
function retorno_automatico ( $VendedorEmail, $TransacaoID, $Referencia, $TipoFrete, $ValorFrete, $Anotacao, $DataTransacao, $TipoPagamento, $StatusTransacao, $CliNome, $CliEmail, $CliEndereco, $CliNumero, $CliComplemento, $CliBairro, $CliCidade, $CliEstado, $CliCEP, $CliTelefone, $produtos, $NumItens) {
$payment = new Payment($Referencia) ;
$payment->update($TipoPagamento , $StatusTransacao) ;
}
if( $_GET['id']) {
$payment = new Payment($_GET['id']) ;
switch ( $payment->status )
{
case Payment::unpaid :
$payment->send_request();
break;
case Payment::paid :
_e("You have already paid your reservation.") ;
break;
case Payment::validating :
_e("Your payment is currently being validated. During this time, you may receive mail and phone calls from PagSeguro or your credit card operator, so pay attention.") ;
break ;
case Payment::failed :
$payment->send_request();
break;
default: #ERROR
_e("This reservation link is invalid. Please use the payment link sent to you by e-mail.") ;
break;
}
} else {
require('views/payment_return_page.php') ;
}
?>