Can create card from dolibarr

This commit is contained in:
Laurent Destailleur 2018-03-15 00:40:29 +01:00
parent cca1a58249
commit 87bbb4ef87
3 changed files with 21 additions and 3 deletions

View File

@ -140,7 +140,7 @@ class Form
* @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value * @param string $editvalue When in edit mode, use this value as $value instead of value (for example, you can provide here a formated price instead of value). Use '' to use same than $value
* @param object $extObject External object * @param object $extObject External object
* @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage') * @param mixed $custommsg String or Array of custom messages : eg array('success' => 'MyMessage', 'error' => 'MyMessage')
* @param string $moreparam More param to add on a href URL * @param string $moreparam More param to add on the form action href URL
* @param int $notabletag Do no output table tags * @param int $notabletag Do no output table tags
* @param string $formatfunc Call a specific function to output field * @param string $formatfunc Call a specific function to output field
* @param string $paramid Key of parameter for id ('id', 'socid') * @param string $paramid Key of parameter for id ('id', 'socid')

View File

@ -753,6 +753,15 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print '</td><td>'; print '</td><td>';
//print $stripecu; //print $stripecu;
print $form->editfieldval("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontowrite, 'string', '', null, null, '', 2, '', 'socid'); print $form->editfieldval("StripeCustomerId", 'key_account', $stripecu, $object, $permissiontowrite, 'string', '', null, null, '', 2, '', 'socid');
if ($stripecu)
{
$url='https://dashboard.stripe.com/test/customers/'.$stripecu;
if ($servicestatus)
{
$url='https://dashboard.stripe.com/customers/'.$stripecu;
}
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').'</a>';
}
print '</td><td align="right">'; print '</td><td align="right">';
if (empty($stripecu)) if (empty($stripecu))
{ {
@ -850,6 +859,15 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard'
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print $companypaymentmodetemp->stripe_card_ref; print $companypaymentmodetemp->stripe_card_ref;
/*if ($companypaymentmodetemp->stripe_card_ref)
{
$url='https://dashboard.stripe.com/test/card/'.$companypaymentmodetemp->stripe_card_ref;
if ($servicestatus)
{
$url='https://dashboard.stripe.com/card/'.$companypaymentmodetemp->stripe_card_ref;
}
print ' <a href="'.$url.'" target="_stripe">'.img_picto($langs->trans('ShowInStripe'), 'object_globe').'</a>';
}*/
print '</td>'; print '</td>';
print '<td>'; print '<td>';
print img_credit_card($companypaymentmodetemp->type); print img_credit_card($companypaymentmodetemp->type);

View File

@ -146,7 +146,7 @@ class Stripe extends CommonObject
} }
catch(Exception $e) catch(Exception $e)
{ {
$this->error = $e->getMessage();
} }
} }
elseif ($createifnotlinkedtostripe) elseif ($createifnotlinkedtostripe)
@ -230,7 +230,7 @@ class Stripe extends CommonObject
} }
catch(Exception $e) catch(Exception $e)
{ {
$this->error = $e->getMessage();
} }
} }
elseif ($createifnotlinkedtostripe) elseif ($createifnotlinkedtostripe)