duncanmcclean / sc-starter-kit Goto Github PK
View Code? Open in Web Editor NEWSimple Commerce - Starter Kit
Home Page: https://statamic.com/sc-starter-kit
Simple Commerce - Starter Kit
Home Page: https://statamic.com/sc-starter-kit
I'd like to add a screenshot of what the starter kit looks like after some content has been populated so I can display it on the README.md
.
All that needs done is to clone this repository down, get it setup, add some dummy products and take a screenshot of the homepage of the store.
<div class="border rounded p-2 mb-2 text-gray-600 focus:text-gray-800 outline-none" id="card-element"></div>
<input id="stripePaymentMethod" type="hidden" name="payment_method">
<script src="https://js.stripe.com/v3/"></script>
<script>
var stripe = Stripe('{{ gateway-config:key }}');
var elements = stripe.elements();
const card = elements.create('card');
card.mount('#card-element');
card.addEventListener('change', ({error}) => {
const displayError = document.getElementById('card-errors');
if (error) {
alert('There was an issue when loading: '+error.message);
}
});
function confirmPayment() {
stripe.confirmCardPayment('{{ client_secret }}', {
payment_method: {
card: card,
},
}).then(function (result) {
if (result.error) {
alert(result.error.message);
} else if (result.paymentIntent.status === 'succeeded') {
var paymentMethod = document.getElementById('stripePaymentMethod');
paymentMethod.value = result.paymentIntent.payment_method;
document.querySelector('form').submit();
}
});
}
</script>
But on last step of checkout ( payment ) get error: DoubleThreeDigital\SimpleCommerce\Exceptions\GatewayDoesNotExist
The provided gateway (index) does not exist.
C:\SERVER\OpenServer\domains\statshop\resources\views/checkout/payment.antlers.html
'gateways' => [
\DoubleThreeDigital\SimpleCommerce\Gateways\DummyGateway::class => [],
// \DoubleThreeDigital\SimpleCommerce\Gateways\StripeGateway::class => [
// 'key' => env('STRIPE_KEY'),
// 'secret' => env('STRIPE_SECRET'),
// ],
],
When you are going through the checkout process with Stripe and put in your cc details, after submitting that form, it redirects back to /checkout/complete
but does not include the APP_URL
.
The best I can tell from debugging is that the sites.php
config file does not use config('app.url')
for the default url.
The odd thing is when I change the the default url in sites.php, my /cart no longer works (404)
Here is the shots of things redirecting back to /checkout/complete
While trying to fix that to get {site:url}
I found that the redirect="{site:url}/checkout/complete"
in payment.antlers.html
would return /
. Changing the default url in sites.php
to be config('app.url')
it will cause a 404 on the /cart page
1: run statamic new simple-commerce
2: add simple-commerce
addon
3: run php please sc:install
4: add stripe
payment processing (using test keys)
5: run through a checkout process
Part 2:
1: Run 1-5 above
2: change sites.php
config file to have a url config('app.url')
3: visit cart page in a fresh browser
Environment
Application Name: Statamic
Laravel Version: 10.20.0
PHP Version: 8.3.0beta2
Composer Version: 2.5.5
Environment: local
Debug Mode: ENABLED
URL: simple-commerce.test
Maintenance Mode: OFF
Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED
Drivers
Broadcasting: log
Cache: statamic
Database: mysql
Logs: stack / single
Mail: log
Queue: sync
Session: file
Simple Commerce
Currencies: USD
Gateways: Stripe
Repository: Customer: DoubleThreeDigital\SimpleCommerce\Customers\EntryCustomerRepository
Repository: Order: DoubleThreeDigital\SimpleCommerce\Orders\EntryOrderRepository
Repository: Product: DoubleThreeDigital\SimpleCommerce\Products\EntryProductRepository
Shipping Methods: Free Shipping
Tax Engine: DoubleThreeDigital\SimpleCommerce\Tax\BasicTaxEngine
Statamic
Addons: 1
Antlers: runtime
Stache Watcher: Enabled
Static Caching: Disabled
Version: 4.19.0 PRO
Statamic Addons
doublethreedigital/simple-commerce: 5.3.5
shipping_region
and billing_region
were added in Simple Commerce - duncanmcclean/simple-commerce#483
They should be added with the rest of the fields, just whenever I have some time.
N/A
Will need it in the next few weeks
Just as the title says - they have been removed from Simple Commerce as it doesn't make use of them out of the box. If needed, developers can add it to the sites.
Right now, the normal price field for standard products is on the blueprint for variant products. I've built a workaround in Simple Commerce in db1f142
and e417c3f
but really this should be sorted so we don't need those hacky workarounds one day.
We should ensure that the account checkout page is all wired up properly if a user goes down the route of registering or logging in.
Maybe we should also take the customer's email address when they go through with guest checkout?
I receive an error in the checkout process when I did not enter payment informations.
When I go to checkout -> payment, I can confirm the "Finish & Pay" button without having entered anything. If I do so, I don't receive a hint on missing data but PHP outputs an error:
str_replace(): Argument duncanmcclean/simple-commerce#2 ($replace) must be of type string when argument duncanmcclean/simple-commerce#1 ($search) is a string
I've installed the demo shop.
Statamic 3.2 will introduce a new format for starter kits. This starter kit should be prepared in advance of the changes.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.