Move code around to make Stripe happy

This commit is contained in:
Skylar Ittner 2025-11-08 13:27:41 -07:00
parent 3e98332dbe
commit e8ef31d86f

View File

@ -40,7 +40,26 @@ try {
'statement_descriptor' => "CrtfdFrmHome", 'statement_descriptor' => "CrtfdFrmHome",
'payment_method_types' => ['card', 'link'], 'payment_method_types' => ['card', 'link'],
'capture_method' => 'manual', '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') { if ($intent->status == 'requires_capture') {
@ -62,25 +81,6 @@ try {
"from_email" => (empty($shipment->from_address->email) ? "None" : $shipment->from_address->email . ""), "from_email" => (empty($shipment->from_address->email) ? "None" : $shipment->from_address->email . ""),
"rate" => number_format($cost, 2), "rate" => number_format($cost, 2),
"label" => $pdffile "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) { } catch (Exception $exx) {