#max-auth-capture

1 messages ยท Page 1 of 1 (latest)

lone quest
#

hi! depends on the bank and how they show authorisations on their statements

#

but the money is 'held' yes, that's how it works

#

ahh okie dokes....if the uncaptured payment is cancelled is there bank balance updated straight away? or do they have to wait 5-7 days for a standard refund?
depends on the bank but releasing an auth is generally much faster than a full refund yep

sinful sandal
#

brill...as some customers are complaining that they have been charged..although they are not technically...trying to give peace of mind that they have been charged especially if its been cancelled so they can order straight away

lone quest
#

yeah they're not charged per se but the money is held(for example if it's a debit card that is money they can't spend on other things until you refund the authorised payment)

sinful sandal
#

ahh i see....many thanks for this, it has been a big help ๐Ÿ™‚ ๐Ÿ™‚

sinful sandal
#

hey there i have another question if possible

median grail
#

๐Ÿ‘‹ taking over for my colleague. Let me know if there's any follow-up Qs I can answer!

sinful sandal
#

Im trying to use 'capture_method' => 'manual', for customers who manually enter their card details. but there seems to be a problem. it authorieses the payment and appears uncaptured on stripe dashboard but it doesn't return a response status e.g. success so on the customer side it doesn't look like anything is prosessing

#

$intent = \Stripe\PaymentIntent::create([
'payment_method' => $json_obj->payment_method_id,
'amount' => $amount,
'currency' => 'gbp',
'capture_method' => 'manual',
'confirmation_method' => 'manual',
'confirm' => true],
["idempotency_key" => $idempotency,]);

median grail
#

capture_method manual doesn't mean that the customer is manually entering their card details

sinful sandal
#

i know that lol

#

it puts a hold on the payment

#

but adding 'capture_method' => 'manual', seems to break my code

#

full code:

$idempotency = preg_replace('/[^a-z\d]/im', '', $_POST['idempotency']);
$intent = null;
try {

if (isset($json_obj->payment_method_id)) {

# Create the PaymentIntent
$intent = \Stripe\PaymentIntent::create([
  'payment_method' => $json_obj->payment_method_id,
  'amount' => $amount,
  'currency' => 'gbp',
//'capture_method' => 'manual',
  'confirmation_method' => 'manual',
  'confirm' => true], 
  ["idempotency_key" => $idempotency,]);

} else {

}

if (isset($json_obj->payment_intent_id)) {
$intent = \Stripe\PaymentIntent::retrieve(
$json_obj->payment_intent_id
);
$intent->confirm();
}
generatePaymentResponse($intent, $payment_id);
} catch (\Stripe\Exception\ApiErrorException $e) {

Display error on client

echo json_encode([
'error' => $e->getMessage()
]);
}

function generatePaymentResponse($intent, $payment_id) {
if ($intent->status == 'requires_action' &&
$intent->next_action->type == 'use_stripe_sdk') {
# Tell the client to handle the action
echo json_encode([
'requires_action' => true,
'payment_intent_client_secret' => $intent->client_secret
]);
} else if ($intent->status == 'succeeded') {
# The payment didnโ€™t need any additional actions and completed!
# Handle post-payment fulfillment

$pid=$intent->id;
$brand=$intent->charges->data['0']->payment_method_details->card['network'];
$last4=$intent->charges->data['0']->payment_method_details->card['last4'];
$country=$intent->charges->data['0']->payment_method_details->card['country'];


success($pid,$brand,$last4,$country);

} else {

echo json_encode([
    'success' => false, 
    'amount'=>0,
    'order_id'=>'cancelled'
]);

# Invalid status
http_response_code(500);
echo json_encode(['error' => 'Invalid PaymentIntent status']);

}
}

#

serverside code

#

frontend:

median grail
#

use 'capture_method' => 'manual', for customers who manually enter their card details
this was a bit odd for me so I preferred to explain it

sinful sandal
#

if i remove 'capture_method' => 'manual' customers can manaully add their card details to do a one-time checkout and it fully works

#

do i need to change function handleAction(response) ? on the fontend?

#

or handleServerResponse()

median grail
#

I'm really not following

sinful sandal
#

lol

median grail
#

could you please explain what you're trying to do

#

let's put aside what you've already have for a sec

sinful sandal
#

so a customer goes to checkout they enter their card details annd submit the order...on the serverside it should authorise the payment and send a response to say it succeeded

#

but as soon as i add 'capture_method' => 'manual' on serverside it breaks the code

past terrace
#

What specifically is breaking in your code when you put 'capture_method' => 'manual'?