From e8ef31d86fe8ea1a808d4a7868e26082155039b5 Mon Sep 17 00:00:00 2001 From: Skylar Ittner Date: Sat, 8 Nov 2025 13:27:41 -0700 Subject: [PATCH] Move code around to make Stripe happy --- source/static/payshipment.php | 40 +++++++++++++++++------------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/source/static/payshipment.php b/source/static/payshipment.php index b832b1d..0a65f03 100644 --- a/source/static/payshipment.php +++ b/source/static/payshipment.php @@ -40,7 +40,26 @@ try { 'statement_descriptor' => "CrtfdFrmHome", 'payment_method_types' => ['card', 'link'], 'capture_method' => 'manual', - 'confirm' => true + 'confirm' => true, + "amount_details" => [ + "line_items" => [ + [ + "product_name" => "Shipping Label", + "quantity" => 1, + "unit_cost" => $price * 100, + "unit_of_measure" => "each", + "product_code" => "CRTFIEDMAIL", + "tax" => [ + "total_tax_amount" => 0 + ], + "payment_method_options" => [ + "card" => [ + "commodity_code" => "43231515" // UNSPSC: Mailing and shipping software / Software that offices can use as an alternative to postage meters to print postage stamps and shipping labels. + ] + ] + ] + ] + ] ]); if ($intent->status == 'requires_capture') { @@ -62,25 +81,6 @@ try { "from_email" => (empty($shipment->from_address->email) ? "None" : $shipment->from_address->email . ""), "rate" => number_format($cost, 2), "label" => $pdffile - ], - "amount_details" => [ - "line_items" => [ - [ - "product_name" => "Shipping Label", - "quantity" => 1, - "unit_cost" => $price * 100, - "unit_of_measure" => "each", - "product_code" => "CRTFIEDMAIL", - "tax" => [ - "total_tax_amount" => 0 - ], - "payment_method_options" => [ - "card" => [ - "commodity_code" => "43231515" // UNSPSC: Mailing and shipping software / Software that offices can use as an alternative to postage meters to print postage stamps and shipping labels. - ] - ] - ] - ] ] ]); } catch (Exception $exx) {