diff --git a/nbproject/project.properties b/nbproject/project.properties index 938d784..f8e5c91 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -10,6 +10,8 @@ auxiliary.org-netbeans-modules-javascript-nodejs.node_2e_default=true auxiliary.org-netbeans-modules-javascript-nodejs.run_2e_enabled=false auxiliary.org-netbeans-modules-javascript-nodejs.sync_2e_enabled=true browser.run=true +file.reference.certifiedfromhome.com-source=source +file.reference.certifiedfromhome.com-web=web file.reference.helena.express-source=source file.reference.helena.express-web=web file.reference.new.ship.netsyms.com-public_html=public_html @@ -19,7 +21,7 @@ file.reference.new.ship.netsyms.com-web=web file.reference.ship.netsyms.com-source=source file.reference.ship.netsyms.com-web=web files.encoding=UTF-8 -site.root.folder=${file.reference.helena.express-web} -source.folder=${file.reference.helena.express-source} +site.root.folder=${file.reference.certifiedfromhome.com-web} +source.folder=${file.reference.certifiedfromhome.com-source} start.file=index.html web.context.root=/ diff --git a/source/static/payshipment.php b/source/static/payshipment.php index 60212f5..318e731 100644 --- a/source/static/payshipment.php +++ b/source/static/payshipment.php @@ -45,6 +45,13 @@ try { $shipment->buy(['rate' => ['id' => $_REQUEST["rateid"]]]); } + try { + $stripe = new \Stripe\StripeClient($_SETTINGS["stripe_sk"]); + $stripe->paymentIntents->update($intent->id, ["metadata" => ["tracking_number" => "$shipment->tracking_code", "rate" => $price - 1.00]]); + } catch (Exception $exx) { + + } + $labelurl = $shipment->postage_label->label_url; // load postage image @@ -82,22 +89,24 @@ try { // get paid $intent->capture(); - try { - $mail = new Email(); - $emailsettings = $_SETTINGS["email"]; - $mail->setSMTP($emailsettings["server"], $emailsettings["port"], true, $emailsettings["user"], $emailsettings["password"], $emailsettings["security"]); - $mail->setFrom("certifiedfromhome@helena.express", "CertifiedFromHome.com"); - $mail->addTo($shipment->from_address->email); - $mail->setSubject("Your CertifiedFromHome Receipt"); - $body = "Thanks for using CertifiedFromHome.com!\r\nYour card has been charged a total of $" . number_format($price, 2) . ".\r\n"; - if (!empty($shipment->options->certified_mail)) { - $body .= "You can track your letter with this tracking code: " . $shipment->tracking_code . "\r\n"; + if (!empty($shipment->from_address->email)) { + try { + $mail = new Email(); + $emailsettings = $_SETTINGS["email"]; + $mail->setSMTP($emailsettings["server"], $emailsettings["port"], true, $emailsettings["user"], $emailsettings["password"], $emailsettings["security"]); + $mail->setFrom("certifiedfromhome@helena.express", "CertifiedFromHome.com"); + $mail->addTo($shipment->from_address->email); + $mail->setSubject("Your CertifiedFromHome Receipt"); + $body = "Thanks for using CertifiedFromHome.com!\r\nYour card has been charged a total of $" . number_format($price, 2) . ".\r\n"; + if (!empty($shipment->options->certified_mail)) { + $body .= "You can track your letter with this tracking code: " . $shipment->tracking_code . "\r\n"; + } + $body .= "If you need any help, just reply to this email. Thanks again!"; + $mail->setBody($body); + $mail->send(); + } catch (Exception $ex) { + } - $body .= "If you need any help, just reply to this email. Thanks again!"; - $mail->setBody($body); - $mail->send(); - } catch (Exception $ex) { - } header("Content-Type: application/json");