Proven Expertise
Our team brings years of experience in the digital payments industry to provide reliable services.
<?php
namespace Illuminate\Mail;
use Illuminate\Contracts\Mail\Attachable;
use Illuminate\Support\Str;
use Illuminate\Support\Traits\ForwardsCalls;
use Symfony\Component\Mime\Address;
use Symfony\Component\Mime\Email;
/**
* @mixin \Symfony\Component\Mime\Email
*/
class Message
{
use ForwardsCalls;
/**
* The Symfony Email instance.
*
* @var \Symfony\Component\Mime\Email
*/
protected $message;
/**
* CIDs of files embedded in the message.
*
* @deprecated Will be removed in a future Laravel version.
*
* @var array
*/
protected $embeddedFiles = [];
/**
* Create a new message instance.
*
* @param \Symfony\Component\Mime\Email $message
* @return void
*/
public function __construct(Email $message)
{
$this->message = $message;
}
/**
* Add a "from" address to the message.
*
* @param string|array $address
* @param string|null $name
* @return $this
*/
public function from($address, $name = null)
{
is_array($address)
? $this->message->from(...$address)
: $this->message->from(new Address($address, (string) $name));
return $this;
}
/**
* Set the "sender" of the message.
*
* @param string|array $address
* @param string|null $name
* @return $this
*/
public function sender($address, $name = null)
{
is_array($address)
? $this->message->sender(...$address)
: $this->message->sender(new Address($address, (string) $name));
return $this;
}
/**
* Set the "return path" of the message.
*
* @param string $address
* @return $this
*/
public function returnPath($address)
{
$this->message->returnPath($address);
return $this;
}
/**
* Add a recipient to the message.
*
* @param string|array $address
* @param string|null $name
* @param bool $override
* @return $this
*/
public function to($address, $name = null, $override = false)
{
if ($override) {
is_array($address)
? $this->message->to(...$address)
: $this->message->to(new Address($address, (string) $name));
return $this;
}
return $this->addAddresses($address, $name, 'To');
}
/**
* Remove all "to" addresses from the message.
*
* @return $this
*/
public function forgetTo()
{
if ($header = $this->message->getHeaders()->get('To')) {
$this->addAddressDebugHeader('X-To', $this->message->getTo());
$header->setAddresses([]);
}
return $this;
}
/**
* Add a carbon copy to the message.
*
* @param string|array $address
* @param string|null $name
* @param bool $override
* @return $this
*/
public function cc($address, $name = null, $override = false)
{
if ($override) {
is_array($address)
? $this->message->cc(...$address)
: $this->message->cc(new Address($address, (string) $name));
return $this;
}
return $this->addAddresses($address, $name, 'Cc');
}
/**
* Remove all carbon copy addresses from the message.
*
* @return $this
*/
public function forgetCc()
{
if ($header = $this->message->getHeaders()->get('Cc')) {
$this->addAddressDebugHeader('X-Cc', $this->message->getCC());
$header->setAddresses([]);
}
return $this;
}
/**
* Add a blind carbon copy to the message.
*
* @param string|array $address
* @param string|null $name
* @param bool $override
* @return $this
*/
public function bcc($address, $name = null, $override = false)
{
if ($override) {
is_array($address)
? $this->message->bcc(...$address)
: $this->message->bcc(new Address($address, (string) $name));
return $this;
}
return $this->addAddresses($address, $name, 'Bcc');
}
/**
* Remove all of the blind carbon copy addresses from the message.
*
* @return $this
*/
public function forgetBcc()
{
if ($header = $this->message->getHeaders()->get('Bcc')) {
$this->addAddressDebugHeader('X-Bcc', $this->message->getBcc());
$header->setAddresses([]);
}
return $this;
}
/**
* Add a "reply to" address to the message.
*
* @param string|array $address
* @param string|null $name
* @return $this
*/
public function replyTo($address, $name = null)
{
return $this->addAddresses($address, $name, 'ReplyTo');
}
/**
* Add a recipient to the message.
*
* @param string|array $address
* @param string $name
* @param string $type
* @return $this
*/
protected function addAddresses($address, $name, $type)
{
if (is_array($address)) {
$type = lcfirst($type);
$addresses = collect($address)->map(function ($address, $key) {
if (is_string($key) && is_string($address)) {
return new Address($key, $address);
}
if (is_array($address)) {
return new Address($address['email'] ?? $address['address'], $address['name'] ?? null);
}
if (is_null($address)) {
return new Address($key);
}
return $address;
})->all();
$this->message->{"{$type}"}(...$addresses);
} else {
$this->message->{"add{$type}"}(new Address($address, (string) $name));
}
return $this;
}
/**
* Add an address debug header for a list of recipients.
*
* @param string $header
* @param \Symfony\Component\Mime\Address[] $addresses
* @return $this
*/
protected function addAddressDebugHeader(string $header, array $addresses)
{
$this->message->getHeaders()->addTextHeader(
$header,
implode(', ', array_map(fn ($a) => $a->toString(), $addresses)),
);
return $this;
}
/**
* Set the subject of the message.
*
* @param string $subject
* @return $this
*/
public function subject($subject)
{
$this->message->subject($subject);
return $this;
}
/**
* Set the message priority level.
*
* @param int $level
* @return $this
*/
public function priority($level)
{
$this->message->priority($level);
return $this;
}
/**
* Attach a file to the message.
*
* @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file
* @param array $options
* @return $this
*/
public function attach($file, array $options = [])
{
if ($file instanceof Attachable) {
$file = $file->toMailAttachment();
}
if ($file instanceof Attachment) {
return $file->attachTo($this);
}
$this->message->attachFromPath($file, $options['as'] ?? null, $options['mime'] ?? null);
return $this;
}
/**
* Attach in-memory data as an attachment.
*
* @param string|resource $data
* @param string $name
* @param array $options
* @return $this
*/
public function attachData($data, $name, array $options = [])
{
$this->message->attach($data, $name, $options['mime'] ?? null);
return $this;
}
/**
* Embed a file in the message and get the CID.
*
* @param string|\Illuminate\Contracts\Mail\Attachable|\Illuminate\Mail\Attachment $file
* @return string
*/
public function embed($file)
{
if ($file instanceof Attachable) {
$file = $file->toMailAttachment();
}
if ($file instanceof Attachment) {
return $file->attachWith(
function ($path) use ($file) {
$cid = $file->as ?? Str::random();
$this->message->embedFromPath($path, $cid, $file->mime);
return "cid:{$cid}";
},
function ($data) use ($file) {
$this->message->embed($data(), $file->as, $file->mime);
return "cid:{$file->as}";
}
);
}
$cid = Str::random(10);
$this->message->embedFromPath($file, $cid);
return "cid:$cid";
}
/**
* Embed in-memory data in the message and get the CID.
*
* @param string|resource $data
* @param string $name
* @param string|null $contentType
* @return string
*/
public function embedData($data, $name, $contentType = null)
{
$this->message->embed($data, $name, $contentType);
return "cid:$name";
}
/**
* Get the underlying Symfony Email instance.
*
* @return \Symfony\Component\Mime\Email
*/
public function getSymfonyMessage()
{
return $this->message;
}
/**
* Dynamically pass missing methods to the Symfony instance.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function __call($method, $parameters)
{
return $this->forwardDecoratedCallTo($this->message, $method, $parameters);
}
}
How it Works
Getting started with NFC Pay is simple and quick. Register your account, add your cards, and you're ready to make payments in no time. Whether you're paying at a store, sending money to a friend, or managing your merchant transactions, NFC Pay makes it easy and secure.
Download the NFC Pay app and sign up with your email or phone number. Complete the registration process by verifying your identity, and set up your secure PIN to protect your account.
Link your debit or credit cards to your NFC Pay wallet. Simply scan your card or enter the details manually, and you’re set to load funds, shop, and pay with ease.
To pay, simply tap your phone or scan the QR code at checkout. You can also transfer money to other users with a few taps. Enjoy fast, contactless payments with top-notch security.
Security System
NFC Pay prioritizes your security with advanced features that safeguard every transaction. From SMS or email verification to end-to-end encryption, we've implemented robust measures to ensure your data is always protected. Our security systems are designed to prevent unauthorized access and provide you with a safe and reliable payment experience.
Receive instant alerts for every transaction to keep track of your account activities.
Verify your identity through our Know Your Customer process to prevent fraud and enhance security.
Dramatically supply transparent backward deliverables before caward comp internal or "organic" sources.
All your data and transactions are encrypted, ensuring that your sensitive information remains private.
Monitor unusual activity patterns to detect and prevent suspicious behavior in real-time.
Why Choice Us
With NFC Pay, you get a trusted platform backed by proven expertise and a commitment to quality. We put our customers first, offering innovative solutions tailored to your needs, ensuring every transaction is secure, swift, and seamless.
Our team brings years of experience in the digital payments industry to provide reliable services.
We prioritize excellence, ensuring that every aspect of our platform meets the highest standards.
Your needs drive our solutions, and we are dedicated to delivering a superior user experience.
We continuously evolve, integrating the latest technologies to enhance your payment experience.
Testimonial Section
Hear from our users who trust NFC Pay for their everyday transactions. Our commitment to security, ease of use, and exceptional service shines through in their experiences. See why our clients choose NFC Pay for their payment needs and how it has transformed the way they manage their finances.
App Section
Unlock the full potential of NFC Pay by downloading our app, designed to bring secure, swift, and smart transactions to your fingertips. Whether you're paying at a store, transferring money to friends, or managing your business payments, the NFC Pay app makes it effortless. Available on both iOS and Android, it's your all-in-one solution for convenient and reliable digital payments. Download now and experience the future of payments!