Fix error management in Stripe
This commit is contained in:
parent
bc7b5b1468
commit
6e2a9dc0c9
@ -39,6 +39,8 @@ if (!empty($conf->commande->enabled))
|
|||||||
{
|
{
|
||||||
$langs->load("orders");
|
$langs->load("orders");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'#order" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'#order" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Order")).': ';
|
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Order")).': ';
|
||||||
print '<input type="text class="flat" id="generate_order_ref" name="generate_order_ref" value="'.GETPOST('generate_order_ref', 'alpha').'" size="10">';
|
print '<input type="text class="flat" id="generate_order_ref" name="generate_order_ref" value="'.GETPOST('generate_order_ref', 'alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none button" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none button" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
@ -62,6 +64,8 @@ if (!empty($conf->facture->enabled))
|
|||||||
{
|
{
|
||||||
$langs->load("bills");
|
$langs->load("bills");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'#invoice" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'#invoice" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Invoice")).': ';
|
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Invoice")).': ';
|
||||||
print '<input type="text class="flat" id="generate_invoice_ref" name="generate_invoice_ref" value="'.GETPOST('generate_invoice_ref', 'alpha').'" size="10">';
|
print '<input type="text class="flat" id="generate_invoice_ref" name="generate_invoice_ref" value="'.GETPOST('generate_invoice_ref', 'alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none button" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none button" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
@ -85,6 +89,8 @@ if (!empty($conf->contrat->enabled))
|
|||||||
{
|
{
|
||||||
$langs->load("contracts");
|
$langs->load("contracts");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'#contractline" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'#contractline" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("ContractLine")).': ';
|
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("ContractLine")).': ';
|
||||||
print '<input type="text class="flat" id="generate_contract_ref" name="generate_contract_ref" value="'.GETPOST('generate_contract_ref', 'alpha').'" size="10">';
|
print '<input type="text class="flat" id="generate_contract_ref" name="generate_contract_ref" value="'.GETPOST('generate_contract_ref', 'alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none button" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none button" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
@ -108,6 +114,8 @@ if (!empty($conf->adherent->enabled))
|
|||||||
{
|
{
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'#membersubscription" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'#membersubscription" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Member")).': ';
|
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Member")).': ';
|
||||||
print '<input type="text class="flat" id="generate_member_ref" name="generate_member_ref" value="'.GETPOST('generate_member_ref', 'alpha').'" size="10">';
|
print '<input type="text class="flat" id="generate_member_ref" name="generate_member_ref" value="'.GETPOST('generate_member_ref', 'alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none reposition button" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none reposition button" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
@ -131,6 +139,8 @@ if (!empty($conf->don->enabled))
|
|||||||
{
|
{
|
||||||
$langs->load("members");
|
$langs->load("members");
|
||||||
print '<form action="'.$_SERVER["PHP_SELF"].'#donation" method="POST">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'#donation" method="POST">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Don")).': ';
|
print $langs->trans("EnterRefToBuildUrl", $langs->transnoentitiesnoconv("Don")).': ';
|
||||||
print '<input type="text class="flat" id="generate_donation_ref" name="generate_donation_ref" value="'.GETPOST('generate_donation_ref', 'alpha').'" size="10">';
|
print '<input type="text class="flat" id="generate_donation_ref" name="generate_donation_ref" value="'.GETPOST('generate_donation_ref', 'alpha').'" size="10">';
|
||||||
print '<input type="submit" class="none reposition button" value="'.$langs->trans("GetSecuredUrl").'">';
|
print '<input type="submit" class="none reposition button" value="'.$langs->trans("GetSecuredUrl").'">';
|
||||||
|
|||||||
@ -110,7 +110,7 @@ $head[$h][1] = $langs->trans("PayBox");
|
|||||||
$head[$h][2] = 'payboxaccount';
|
$head[$h][2] = 'payboxaccount';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setvalue">';
|
print '<input type="hidden" name="action" value="setvalue">';
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ print load_fiche_titre($langs->trans("ModuleSetup").' Stripe', $linkback);
|
|||||||
|
|
||||||
$head = stripeadmin_prepare_head();
|
$head = stripeadmin_prepare_head();
|
||||||
|
|
||||||
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
print '<input type="hidden" name="action" value="setvalue">';
|
print '<input type="hidden" name="action" value="setvalue">';
|
||||||
|
|
||||||
|
|||||||
@ -79,7 +79,11 @@ $stripeacc = $stripe->getStripeAccount($service);
|
|||||||
if (!$rowid)
|
if (!$rowid)
|
||||||
{
|
{
|
||||||
$option = array('limit' => $limit + 1);
|
$option = array('limit' => $limit + 1);
|
||||||
|
$num = 0;
|
||||||
|
|
||||||
if (GETPOSTISSET('starting_after_'.$page)) $option['starting_after'] = GETPOST('starting_after_'.$page, 'alphanohtml');
|
if (GETPOSTISSET('starting_after_'.$page)) $option['starting_after'] = GETPOST('starting_after_'.$page, 'alphanohtml');
|
||||||
|
|
||||||
|
try {
|
||||||
if ($stripeacc)
|
if ($stripeacc)
|
||||||
{
|
{
|
||||||
$list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc));
|
$list = \Stripe\Charge::all($option, array("stripe_account" => $stripeacc));
|
||||||
@ -88,6 +92,7 @@ if (!$rowid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$num = count($list->data);
|
$num = count($list->data);
|
||||||
|
|
||||||
$totalnboflines = '';
|
$totalnboflines = '';
|
||||||
|
|
||||||
$param = '';
|
$param = '';
|
||||||
@ -269,6 +274,13 @@ if (!$rowid)
|
|||||||
|
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print '</table>';
|
||||||
|
print '</div>';
|
||||||
|
print '</form>';
|
||||||
|
} catch(Exception $e) {
|
||||||
|
print $e->getMessage();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// End of page
|
// End of page
|
||||||
|
|||||||
@ -109,6 +109,7 @@ if (!$rowid) {
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
try {
|
||||||
if ($stripeacc)
|
if ($stripeacc)
|
||||||
{
|
{
|
||||||
$payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
|
$payout = \Stripe\Payout::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
|
||||||
@ -215,6 +216,9 @@ if (!$rowid) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
} catch(Exception $e) {
|
||||||
|
print '<tr><td colspan="6">'.$e->getMessage().'</td></td>';
|
||||||
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -108,6 +108,7 @@ if (!$rowid) {
|
|||||||
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
try {
|
||||||
if ($stripeacc)
|
if ($stripeacc)
|
||||||
{
|
{
|
||||||
$txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
|
$txn = \Stripe\BalanceTransaction::all(array("limit" => $limit), array("stripe_account" => $stripeacc));
|
||||||
@ -220,6 +221,9 @@ if (!$rowid) {
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
print '<tr><td colspan="6">'.$e->getMessage().'</td></td>';
|
||||||
|
}
|
||||||
print "</table>";
|
print "</table>";
|
||||||
print '</div>';
|
print '</div>';
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|||||||
@ -50,7 +50,9 @@ print load_fiche_titre($title, $linkback, 'title_setup');
|
|||||||
|
|
||||||
dol_fiche_head(array(), 'general', $tab, 0, 'product');
|
dol_fiche_head(array(), 'general', $tab, 0, 'product');
|
||||||
|
|
||||||
print '<form method="post">';
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||||
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||||
|
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<th>'.$langs->trans("Parameters").'</td>'."\n";
|
print '<th>'.$langs->trans("Parameters").'</td>'."\n";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user