post https://api.shop-and-pay.com/v1.0/Design/
Note for NodeJS: You need to install the following modules:
npm i axios crypto-js qs
Response
Note for NodeJS: You need to install the following modules:
npm i axios crypto-js qs
xxxxxxxxxx
57<?php
use Shopandpay\Models\Request\Design;
use Shopandpay\Shopandpay;
use Shopandpay\ShopandpayException;
spl_autoload_register(function ($class) {
$root = dirname(__DIR__);
$classFile = $root . '/lib/' . str_replace('\\', '/', $class) . '.php';
if (file_exists($classFile)) {
require_once $classFile;
}
});
// $instanceName is a part of the url where you access your shopandpay installation.
// https://{$instanceName}.shop-and-pay.com
$instanceName = 'YOUR_INSTANCE_NAME';
// $secret is the shopandpay secret for the communication between the applications
// if you think someone got your secret, just regenerate it in the shopandpay administration
$secret = 'YOUR_SECRET';
$shopandpay = new Shopandpay($instanceName, $secret);
$design = new Design();
$design->setDefault(false);
$design->setName('Example Design (via API)');
$design->setHeaderImageShape('square'); // square, rectangular or round
$design->setLogoBackgroundColor('FFFFFF'); // Hex code