mirror of
https://gitlab.com/t6353/sharee.bike.git
synced 2025-05-10 05:56:27 +02:00
checking payment data after changing the payment typ
This commit is contained in:
parent
5044e9bfe8
commit
b2dce25de8
18 changed files with 209 additions and 123 deletions
|
@ -539,15 +539,10 @@ sub save_account(){
|
|||
$ctadr = $dbt->fetch_record($dbh,$authref);
|
||||
}
|
||||
|
||||
#payone only if SEPA Mandat checked
|
||||
#Testbuchhung mit 1 € preauthorization and 0 € capture
|
||||
#print FILE "+++ $R::request && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id} \n" if($debug);
|
||||
#if($R::request eq "managemandate" && $ctadr->{int03} == 1 && $ctadr->{ct_name} eq $ctadr->{c_id})
|
||||
#fraud workaround
|
||||
my $iban = $ctadr->{txt22} || "";
|
||||
$iban =~ s/\s//g;
|
||||
my $iban_reject = 0;
|
||||
$iban_reject = 1 if($iban =~ /DE33700202700000091600/i);
|
||||
$iban_reject = 1 if($iban =~ /DE33700202700000091600/i);#fraud
|
||||
if($R::request eq "managemandate" && $ctadr->{int03} == 1 && !$iban_reject){
|
||||
|
||||
my $vde_on_fail = $ctadr->{int12} || 3;#keep last or set 3
|
||||
|
@ -569,43 +564,19 @@ sub save_account(){
|
|||
}else{
|
||||
|
||||
my $payone_mival = $payone->managemandate_main(\%varenv,$ctadr,"",$owner);
|
||||
if($payone_mival && $payone_mival =~ /\w{2}-\d+/){
|
||||
#define fictiv invoice to get 1 € test
|
||||
my $epoche = time();
|
||||
my $ctt = {
|
||||
c_id => 1,
|
||||
int01 => 0,
|
||||
int15 => 1,
|
||||
txt16 => "",
|
||||
reference => "$ctadr->{c_id}_$epoche",
|
||||
payone_reset => ''
|
||||
};
|
||||
if($payone_mival && $payone_mival =~ /\w{2}-\w+/){
|
||||
|
||||
my $payone_txid = "";
|
||||
##preauthorization and/or capture needs to much time, must be done async!
|
||||
#$payone_txid = $payone->preauthorizationSEPA_main(\%varenv,$ctadr,$ctt,$owner);
|
||||
#if($payone_txid)
|
||||
if(1==1){
|
||||
#payment_ack
|
||||
system("$dbt->{copri_conf}->{basedir}/$varenv{syshost}/src/scripts/payment_ack.pl '$varenv{syshost}' 'payment_ackSEPA' '$ctadr->{c_id}' '$owner'");
|
||||
|
||||
$ctt->{txt16} = "$payone_txid";
|
||||
$vde_on_fail = 0 if($vde_on_fail != 2);
|
||||
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||
#$payone_txid = $payone->captureSEPA_main(\%varenv,$ctadr,$ctt,$owner);
|
||||
#int12=0 should be set after capture success in payment module
|
||||
|
||||
}else{
|
||||
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||
}
|
||||
}else{
|
||||
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||
}
|
||||
}else{
|
||||
$u_rows = $dbt->update_one($dbh,$update_adr,"int12=$vde_on_fail");#Vde
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
#prepaid, will be requested in PayoneLink.pm
|
||||
#elsif($ctadr->{int03} == 3){
|
||||
# $feedb = $pl->prepaid_request($dbh,$ctadr,$owner);
|
||||
#}
|
||||
|
||||
if($R::txt04 && $R::confirm_txt04 && $R::txt04 ne $R::confirm_txt04){
|
||||
$ret = "failure::confirm_txt04#top";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue