Merge pull request #8386 from ptibogxiv/patch-21

FIX support for stripeconnect mode
This commit is contained in:
Laurent Destailleur 2018-03-15 00:40:52 +01:00 committed by GitHub
commit f75334f131
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,7 +79,7 @@ if (! empty($conf->stripe->enabled))
if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha')) if (! empty($conf->global->STRIPE_LIVE) && ! GETPOST('forcesandbox','alpha'))
{ {
$service = 'StripeLive'; $service = 'StripeLive';
$servicestatus = 0; $servicestatus = 1;
} }
$stripe = new Stripe($db); $stripe = new Stripe($db);
@ -602,7 +602,7 @@ if (empty($reshook))
elseif ($action == 'setassourcedefault') elseif ($action == 'setassourcedefault')
{ {
try { try {
$cu = \Stripe\Customer::retrieve($stripecu); $cu=$stripe->customerStripe($object->id, $stripeacc, $servicestatus);
$cu->default_source = (string) $source; $cu->default_source = (string) $source;
$result = $cu->save(); $result = $cu->save();
@ -618,7 +618,7 @@ if (empty($reshook))
elseif ($action == 'deletecard') elseif ($action == 'deletecard')
{ {
try { try {
$cu = \Stripe\Customer::retrieve($stripecu); $cu=$stripe->customerStripe($object->id, $stripeacc, $servicestatus);
$cu->sources->retrieve("$source")->detach(); $cu->sources->retrieve("$source")->detach();