ltsecurityinc安防产品在线商城代码
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\Catalog\Api\ProductRepositoryInterface;
|
||||
use Magento\Quote\Api\CartRepositoryInterface;
|
||||
use Magento\Quote\Model\QuoteFactory;
|
||||
use Magento\Quote\Model\ResourceModel\Quote as QuoteResource;
|
||||
use Magento\TestFramework\Helper\Bootstrap;
|
||||
use Magento\TestFramework\Workaround\Override\Fixture\Resolver;
|
||||
|
||||
Resolver::getInstance()->requireDataFixture('Magento/GraphQl/Catalog/_files/simple_product.php');
|
||||
|
||||
/** @var ProductRepositoryInterface $productRepository */
|
||||
$productRepository = Bootstrap::getObjectManager()->get(ProductRepositoryInterface::class);
|
||||
/** @var QuoteFactory $quoteFactory */
|
||||
$quoteFactory = Bootstrap::getObjectManager()->get(QuoteFactory::class);
|
||||
/** @var QuoteResource $quoteResource */
|
||||
$quoteResource = Bootstrap::getObjectManager()->get(QuoteResource::class);
|
||||
/** @var CartRepositoryInterface $cartRepository */
|
||||
$cartRepository = Bootstrap::getObjectManager()->get(CartRepositoryInterface::class);
|
||||
|
||||
$product = $productRepository->get('simple_product');
|
||||
|
||||
$quote = $quoteFactory->create();
|
||||
$quoteResource->load($quote, 'test_quote', 'reserved_order_id');
|
||||
$quote->addProduct($product, 2);
|
||||
$cartRepository->save($quote);
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\Framework\UrlInterface;
|
||||
use Magento\TestFramework\ObjectManager;
|
||||
|
||||
$url = ObjectManager::getInstance()->get(UrlInterface::class);
|
||||
$cancelUrl = $url->getUrl('paypal/express/cancel/');
|
||||
$successUrl = $url->getUrl('checkout/onepage/success/');
|
||||
$returnUrl = $url->getUrl('paypal/express/return/');
|
||||
$pendingUrl = $url->getUrl('checkout/onepage/pending/');
|
||||
|
||||
|
||||
|
||||
return [
|
||||
'PAYMENTACTION' => 'Authorization',
|
||||
'AMT' => '30.00',
|
||||
'CURRENCYCODE' => 'USD',
|
||||
'RETURNURL' => $returnUrl,
|
||||
'CANCELURL' => $cancelUrl,
|
||||
'INVNUM' => 'test_quote',
|
||||
'SOLUTIONTYPE' => 'Mark',
|
||||
'GIROPAYCANCELURL' => $cancelUrl,
|
||||
'GIROPAYSUCCESSURL' => $successUrl,
|
||||
'BANKTXNPENDINGURL' => $pendingUrl,
|
||||
'SHIPPINGAMT' => '10.00',
|
||||
'ITEMAMT' => '20.00',
|
||||
'TAXAMT' => '0.00',
|
||||
'L_NUMBER0' => null,
|
||||
'L_NAME0' => 'Simple Product',
|
||||
'L_QTY0' => 2,
|
||||
'L_AMT0' => '10.00',
|
||||
'BUSINESS' => 'CompanyName',
|
||||
'NOTETEXT' => null,
|
||||
'EMAIL' => 'customer@example.com',
|
||||
'FIRSTNAME' => 'John',
|
||||
'LASTNAME' => 'Smith',
|
||||
'MIDDLENAME' => null,
|
||||
'SALUTATION' => null,
|
||||
'SUFFIX' => null,
|
||||
'COUNTRYCODE' => 'US',
|
||||
'STATE' => 'AL',
|
||||
'CITY' => 'CityM',
|
||||
'STREET' => 'Green str, 67',
|
||||
'ZIP' => '75477',
|
||||
'PHONENUM' => '3468676',
|
||||
'SHIPTOCOUNTRYCODE' => 'US',
|
||||
'SHIPTOSTATE' => 'AL',
|
||||
'SHIPTOCITY' => 'CityM',
|
||||
'SHIPTOSTREET' => 'Green str, 67',
|
||||
'SHIPTOZIP' => '75477',
|
||||
'SHIPTOPHONENUM' => '3468676',
|
||||
'SHIPTOSTREET2' => '',
|
||||
'STREET2' => '',
|
||||
'SHIPTONAME' => 'John Smith',
|
||||
'ADDROVERRIDE' => 1
|
||||
];
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\Framework\UrlInterface;
|
||||
use Magento\TestFramework\ObjectManager;
|
||||
|
||||
$url = ObjectManager::getInstance()->get(UrlInterface::class);
|
||||
$cancelUrl = $url->getUrl('paypal/express/cancel/');
|
||||
$successUrl = $url->getUrl('checkout/onepage/success/');
|
||||
$returnUrl = $url->getUrl('paypal/express/return/');
|
||||
$pendingUrl = $url->getUrl('checkout/onepage/pending/');
|
||||
|
||||
|
||||
return [
|
||||
'PAYMENTACTION' => 'Authorization',
|
||||
'AMT' => '30.00',
|
||||
'CURRENCYCODE' => 'USD',
|
||||
'RETURNURL' => $returnUrl,
|
||||
'CANCELURL' => $cancelUrl,
|
||||
'INVNUM' => 'test_quote',
|
||||
'SOLUTIONTYPE' => 'Mark',
|
||||
'GIROPAYCANCELURL' => $cancelUrl,
|
||||
'GIROPAYSUCCESSURL' => $successUrl,
|
||||
'BANKTXNPENDINGURL' => $pendingUrl,
|
||||
'SHIPPINGAMT' => '10.00',
|
||||
'ITEMAMT' => '20.00',
|
||||
'TAXAMT' => '0.00',
|
||||
'L_NUMBER0' => null,
|
||||
'L_NAME0' => 'Simple Product',
|
||||
'L_QTY0' => 2,
|
||||
'L_AMT0' => '10.00',
|
||||
'BUSINESS' => 'CompanyName',
|
||||
'NOTETEXT' => null,
|
||||
'EMAIL' => 'guest@example.com',
|
||||
'FIRSTNAME' => 'John',
|
||||
'LASTNAME' => 'Smith',
|
||||
'MIDDLENAME' => null,
|
||||
'SALUTATION' => null,
|
||||
'SUFFIX' => null,
|
||||
'COUNTRYCODE' => 'US',
|
||||
'STATE' => 'AL',
|
||||
'CITY' => 'CityM',
|
||||
'STREET' => 'Green str, 67',
|
||||
'ZIP' => '75477',
|
||||
'PHONENUM' => '3468676',
|
||||
'SHIPTOCOUNTRYCODE' => 'US',
|
||||
'SHIPTOSTATE' => 'AL',
|
||||
'SHIPTOCITY' => 'CityM',
|
||||
'SHIPTOSTREET' => 'Green str, 67',
|
||||
'SHIPTOZIP' => '75477',
|
||||
'SHIPTOPHONENUM' => '3468676',
|
||||
'SHIPTOSTREET2' => '',
|
||||
'STREET2' => '',
|
||||
'SHIPTONAME' => 'John Smith',
|
||||
'ADDROVERRIDE' => 1
|
||||
];
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
//phpcs:ignorefile
|
||||
use Magento\Framework\UrlInterface;
|
||||
use Magento\TestFramework\ObjectManager;
|
||||
|
||||
$url = ObjectManager::getInstance()->create(UrlInterface::class);
|
||||
$cancelUrl = $url->getUrl('paypal/hostedpro/customcancel');
|
||||
$returnUrl = $url->getUrl('paypal/hostedpro/customreturn');
|
||||
|
||||
return [
|
||||
'METHOD' => 'BMCreateButton',
|
||||
'BUTTONCODE' => 'TOKEN',
|
||||
'BUTTONTYPE' => 'PAYMENT',
|
||||
'L_BUTTONVAR0' => 'invoice=test_quote',
|
||||
'L_BUTTONVAR1' => 'address_override=true',
|
||||
'L_BUTTONVAR2' => 'currency_code=USD',
|
||||
'L_BUTTONVAR3' => 'buyer_email=guest@example.com',
|
||||
'L_BUTTONVAR4' => 'billing_first_name=John',
|
||||
'L_BUTTONVAR5' => 'billing_last_name=Smith',
|
||||
'L_BUTTONVAR6' => 'billing_city=CityM',
|
||||
'L_BUTTONVAR7' => 'billing_state=AL',
|
||||
'L_BUTTONVAR8' => 'billing_zip=75477',
|
||||
'L_BUTTONVAR9' => 'billing_country=US',
|
||||
'L_BUTTONVAR10' => 'billing_address1=Green str, 67',
|
||||
'L_BUTTONVAR11' => 'billing_address2=',
|
||||
'L_BUTTONVAR12' => 'first_name=John',
|
||||
'L_BUTTONVAR13' => 'last_name=Smith',
|
||||
'L_BUTTONVAR14' => 'city=CityM',
|
||||
'L_BUTTONVAR15' => 'state=AL',
|
||||
'L_BUTTONVAR16' => 'zip=75477',
|
||||
'L_BUTTONVAR17' => 'country=US',
|
||||
'L_BUTTONVAR18' => 'address1=Green str, 67',
|
||||
'L_BUTTONVAR19' => 'address2=',
|
||||
'L_BUTTONVAR20' => 'paymentaction=authorization',
|
||||
'L_BUTTONVAR21' => 'notify_url=http://localhost/index.php/paypal/ipn/',
|
||||
'L_BUTTONVAR22' => 'cancel_return=' . $cancelUrl,
|
||||
'L_BUTTONVAR23' => 'return=' . $returnUrl,
|
||||
'L_BUTTONVAR24' => 'lc=US',
|
||||
'L_BUTTONVAR25' => 'template=mobile-iframe',
|
||||
'L_BUTTONVAR26' => 'showBillingAddress=false',
|
||||
'L_BUTTONVAR27' => 'showShippingAddress=true',
|
||||
'L_BUTTONVAR28' => 'showBillingEmail=false',
|
||||
'L_BUTTONVAR29' => 'showBillingPhone=false',
|
||||
'L_BUTTONVAR30' => 'showCustomerName=false',
|
||||
'L_BUTTONVAR31' => 'showCardInfo=true',
|
||||
'L_BUTTONVAR32' => 'showHostedThankyouPage=false',
|
||||
'L_BUTTONVAR33' => 'subtotal=20.00',
|
||||
'L_BUTTONVAR34' => 'total=30.00',
|
||||
'L_BUTTONVAR35' => 'tax=0.00',
|
||||
'L_BUTTONVAR36' => 'shipping=10.00',
|
||||
'L_BUTTONVAR37' => 'discount=0.00',
|
||||
];
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
|
||||
//phpcs:ignorefile
|
||||
return [
|
||||
'WEBSITECODE' => '<form action="https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess" method="post">
|
||||
<input type="hidden" name="hosted_button_id" value="hosted_pro_hosted_button_id">
|
||||
<input type="image" src="https://www.sandbox.paypal.com/en_GB/i/btn/btn_paynow_LG.gif" border="0" name="submit" alt="PayPal – The safer, easier way to pay online!">
|
||||
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_GB/i/scr/pixel.gif" width="1" height="1">
|
||||
</form>',
|
||||
'EMAILLINK' => 'https://securepayments.sandbox.paypal.com/webapps/HostedSoleSolutionApp/webflow/sparta/hostedSoleSolutionProcess?hosted_button_id=hosted_pro_hosted_button_id',
|
||||
'HOSTEDBUTTONID' => 'hosted_pro_hosted_button_id',
|
||||
'TIMESTAMP' => '2019-07-25T16:03:27Z',
|
||||
'CORRELATIONID' => '1098765432',
|
||||
'ACK' => 'Success',
|
||||
'VERSION' => '72.0',
|
||||
'BUILD' => '1234567',
|
||||
];
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
use Magento\Framework\App\ProductMetadataInterface;
|
||||
use Magento\Framework\UrlInterface;
|
||||
use Magento\TestFramework\ObjectManager;
|
||||
|
||||
$url = ObjectManager::getInstance()->get(UrlInterface::class);
|
||||
$notifyUrl = $url->getUrl('paypal/ipn/');
|
||||
|
||||
$productMetadata = ObjectManager::getInstance()->get(ProductMetadataInterface::class);
|
||||
$button = 'Magento_2_' . $productMetadata->getEdition();
|
||||
|
||||
return [
|
||||
'TOKEN' => $token,
|
||||
'PAYERID' => $payerId,
|
||||
'PAYMENTACTION' => 'Authorization',
|
||||
'AMT' => '30.00',
|
||||
'CURRENCYCODE' => 'USD',
|
||||
'BUTTONSOURCE' => $button,
|
||||
'NOTIFYURL' => $notifyUrl,
|
||||
'RETURNFMFDETAILS' => 1,
|
||||
'SHIPPINGAMT' => '10.00',
|
||||
'ITEMAMT' => '20.00',
|
||||
'TAXAMT' => '0.00',
|
||||
'L_NUMBER0' => null,
|
||||
'L_NAME0' => 'Simple Product',
|
||||
'L_QTY0' => 2,
|
||||
'L_AMT0' => '10.00',
|
||||
'BUSINESS' => 'CompanyName',
|
||||
'EMAIL' => 'guest@example.com',
|
||||
'FIRSTNAME' => 'John',
|
||||
'LASTNAME' => 'Smith',
|
||||
'MIDDLENAME' => null,
|
||||
'SALUTATION' => null,
|
||||
'SUFFIX' => null,
|
||||
'COUNTRYCODE' => 'US',
|
||||
'STATE' => 'AL',
|
||||
'CITY' => 'CityM',
|
||||
'STREET' => 'Green str, 67',
|
||||
'ZIP' => '75477',
|
||||
'PHONENUM' => '3468676',
|
||||
'SHIPTOCOUNTRYCODE' => 'US',
|
||||
'SHIPTOSTATE' => 'AL',
|
||||
'SHIPTOCITY' => 'CityM',
|
||||
'SHIPTOSTREET' => 'Green str, 67',
|
||||
'SHIPTOZIP' => '75477',
|
||||
'SHIPTOPHONENUM' => '3468676',
|
||||
'SHIPTOSTREET2' => '',
|
||||
'STREET2' => '',
|
||||
'SHIPTONAME' => 'John Smith',
|
||||
'ADDROVERRIDE' => 1,
|
||||
];
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright © Magento, Inc. All rights reserved.
|
||||
* See COPYING.txt for license details.
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
|
||||
return [
|
||||
'RESULT' => '0',
|
||||
'RESPMSG' => 'Approved',
|
||||
'AVSADDR' => 'Y',
|
||||
'AVSZIP' => 'Y',
|
||||
'TOKEN' => $token,
|
||||
'PAYERID' => $payerId,
|
||||
'CORRELATIONID' => $correlationId,
|
||||
'EMAIL' => 'guest@example.com',
|
||||
'PAYERSTATUS' => 'verified',
|
||||
'INVNUM' => 'test_quote',
|
||||
'FIRSTNAME' => 'John',
|
||||
'LASTNAME' => 'Smith',
|
||||
'SHIPTOBUSINESS' => 'Magento',
|
||||
'SHIPTOSTREET' => 'Green str, 67',
|
||||
'SHIPTOCITY' => 'CityM',
|
||||
'SHIPTOSTATE' => 'AL',
|
||||
'SHIPTOZIP' => '75477',
|
||||
'SHIPTOCOUNTRY' => 'US',
|
||||
'SHIPTOPHONENUM' => '3468676',
|
||||
'SHIPTONAME' => 'John Smith',
|
||||
'STREET' => 'Green str, 67',
|
||||
'CITY' => 'CityM',
|
||||
'STATE' => 'TX',
|
||||
'ZIP' => '75477',
|
||||
'COUNTRYCODE' => 'US',
|
||||
'ADDRESSSTATUS' => 'Y',
|
||||
];
|
||||
Reference in New Issue
Block a user