This commit is contained in:
mynah
2020-01-29 03:13:02 -06:00
parent 174f4b0756
commit 57f19e749d
7 changed files with 208 additions and 205 deletions

View File

@@ -61,10 +61,7 @@ sub intentConfirm{
# cliente_nombre,cliente_correo,cliente_comentario,tienda_evento_id,talla_id,cantidad(1),monto,etapa_id(4),entrega(3),pago_clave,plazo,fecha_pago
my $mq = $data->{'mq'};
my $students = $data->{'students'};
my $plan = 0;
if (defined $data->{'selected_plan'}){
$plan = $data->{'selected_plan'}->{'count'};
}
my $plan = $r->{'payment_method_options'}->{'card'}->{'installments'}->{'plan'}->{'count'} // 0;
for (1..$mq){
_write (
$data_path->child("/spay/qIntentConfirm.q")->slurp,
@@ -88,19 +85,20 @@ sub notify{
my ($c,$d,$r) = @_;
my $t =shift @{ _read ($data_path->child("spay/qNotify.q")->slurp,$d->{'tid'})};
my @ra;
my %h=qw/0 na 1 ch 2 m 3 g/;
my $plazo= defined( $d->{'selected_plan'})?
$d->{'selected_plan'}->{'count'} : "0";
my %h=qw/0 na 1 CH 2 M 3 G/;
my $plazo = $r->{'payment_method_options'}->{'card'}->{'installments'}->{'plan'}->{'count'};
my $students = $d->{'students'};
my $basetxta = "$t->{'cnombre'}
clave de pago stripe: $d->{'payment_intent_id'}
my $basetxta = "$t->{'cnombre'}
clave de pago stripe: $r->{'id'}
plazo: $plazo meses
cantidad: $t->{'cantidad'}
";
my $basetxtu = $t->{'cnombre'}//""."
".$t->{'subnombre'}//""."
";
my $basetxtu = "
$t->{'cnombre'}
============================================
".$t->{'subnombre'}//""."
/////////////////////////////////////////////
";
foreach(1 .. $d->{'mq'}) {
push (@ra, ["
@@ -110,9 +108,9 @@ $$students[$_ -1][0]
tu clave de pago es la sigiente. Tenla a la mano para cualquier aclaración
==========================
$d->{'payment_intent_id'}
===========================
==================================
$r->{'id'}
==================================
", " Inscripción ", $$students[$_ -1][1]]);
$basetxta .= "
Nombre: $$students[$_ -1][0]
@@ -125,6 +123,9 @@ $$students[$_ -1][0]
}
push (@ra, [$basetxta,"Inscripciones",'david@chaos.foundation']);
push (@ra, [$basetxta,"Inscripciones",'benjamuga@gmail.com']);
push (@ra, [$basetxta,"Inscripciones",'mmunoz@harvest.com']);
return @ra;
}
@@ -139,19 +140,6 @@ $$students[$_ -1][0]
#'students' => [ [ 'User', 'me@me.com', 'obs', 'M' ], [ 'usr2', 'mail2', 'obs', 'G' ], undef, undef, undef, undef, undef, undef, undef, undef ] #arr(10)
# ===============
sub intentSanity{
my ($c,$d)=@_;
if (defined $d->{'selected_plan'} ){
return -1 unless defined ($d->{'selected_plan'}{'type'});
return -1 unless defined ($d->{'selected_plan'}{'count'});
return -1 unless defined ($d->{'selected_plan'}{'interval'});
}
return -1 unless defined ($d->{'tid'}) && $d->{'tid'} =~ /^\d+$/ ;
return -1 unless defined ($d->{'req'}) && $d->{'req'} eq 'check';
return -1 unless defined ($d->{'payment_intent_id'});
return userDataSanity($c,$d) ;
}
sub userDataSanity{
my ($c,$d) = @_;
return -1 unless (
@@ -160,6 +148,7 @@ sub userDataSanity{
$d->{'mq'} =~/^\d+$/ &&
$d->{'mq'} < 10
);
my %h=qw(n 0 CH 1 M 2 G 3);
my $mq = $d->{'mq'};
my $students = $d->{'students'};