Warning: Invalid argument supplied for foreach() in /Users/aneeshramakrishnapillai/Documents/Development/www/sandbox/omnipay/vendor/transportersio/omnipay-square/src/Message/WebPaymentRequest.php on line 40
"omnipay/omnipay": "^3.2", "transportersio/omnipay-square": "^2.1"
require 'vendor/autoload.php';
use Omnipay\Omnipay;
$gateway = Omnipay::create('Square');
$gateway->setAccessToken('__id_');
$gateway->setLocationId('id__');
$gateway->setTestMode(true); // Set test mode to true for sandbox environment
Warning: Invalid argument supplied for foreach() in /Users/aneeshramakrishnapillai/Documents/Development/www/sandbox/omnipay/vendor/transportersio/omnipay-square/src/Message/WebPaymentRequest.php on line 40
"omnipay/omnipay": "^3.2", "transportersio/omnipay-square": "^2.1"
require 'vendor/autoload.php';
use Omnipay\Omnipay;
$gateway = Omnipay::create('Square'); $gateway->setAccessToken('__id_'); $gateway->setLocationId('id__'); $gateway->setTestMode(true); // Set test mode to true for sandbox environment
// Charge a credit card $response = $gateway->purchase([ 'amount' => '10.00', 'currency' => 'USD', 'card' => [ 'number' => '4808499845665488', 'expiryMonth' => '12', 'expiryYear' => '2024', 'cvv' => '385', ], ])->send();
// Process response if ($response->isSuccessful()) {
} elseif ($response->isRedirect()) {
} else {
}