Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCC-203: Update Guide #427

Merged
merged 97 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
546baa1
Add OrchardCore.Commerce.Payment.Exactly project.
sarahelsaig Jan 20, 2024
371e470
Add some basic services.
sarahelsaig Jan 20, 2024
f8d37a4
Add configuration, permission, admin things.
sarahelsaig Jan 20, 2024
2280e83
Add ChargeRequest.
sarahelsaig Jan 20, 2024
5be431d
Add response models.
sarahelsaig Jan 23, 2024
a7b0c5c
Add FrontendException.ThrowIfAny.
sarahelsaig Jan 23, 2024
d4f2f8a
controller stuff
sarahelsaig Jan 23, 2024
35a04a3
Frontend button.
sarahelsaig Jan 23, 2024
d3eb9f9
not yet needed
sarahelsaig Jan 29, 2024
1532b40
Merge remote-tracking branch 'origin/main' into issue/OCC-203
sarahelsaig Jan 29, 2024
525b017
Merge remote-tracking branch 'origin/main' into issue/OCC-203
sarahelsaig Mar 19, 2024
5476f61
Post merge fixup.
sarahelsaig Mar 19, 2024
7b35da8
Add feature to recipes.
sarahelsaig Mar 20, 2024
50e3753
Organize Exactly settings.
sarahelsaig Mar 20, 2024
208950a
Harmonize Stripe settings view with new changes.
sarahelsaig Mar 20, 2024
3c18703
Clean up ChargeRequest initialization.
sarahelsaig Mar 20, 2024
4e49e34
Reference OrchardCore.Settings.
sarahelsaig Mar 20, 2024
08e6225
Add button to verify API.
sarahelsaig Mar 20, 2024
90859e4
Wrap API actions in ExactlyService.
sarahelsaig Mar 20, 2024
821189f
Better error handling.
sarahelsaig Mar 23, 2024
6c8929a
Fix error output.
sarahelsaig Mar 23, 2024
4321a76
Remove TokenizeSource since it doesn't work anyway.
sarahelsaig Mar 23, 2024
709e3ac
even better error reporting
sarahelsaig Mar 25, 2024
ceca7a3
bug fix.
sarahelsaig Mar 25, 2024
c7f5932
Code cleanup.
sarahelsaig Mar 30, 2024
53d8779
Return a dummy result in case the server checks it.
sarahelsaig Mar 30, 2024
807c4ad
Fix actions and add content-type workaround.
sarahelsaig Apr 3, 2024
2234f69
Merge remote-tracking branch 'origin/main' into issue/OCC-203
sarahelsaig Apr 4, 2024
45786dd
listen to all URL
sarahelsaig Apr 5, 2024
f62f775
disable test button on field edit
sarahelsaig Apr 5, 2024
832535a
Show payment button if the site settings are filled.
sarahelsaig Apr 5, 2024
9d8cc3e
Fix multiple errors formatting.
sarahelsaig Apr 6, 2024
8bf541b
Remove duplicate errors.
sarahelsaig Apr 6, 2024
e59172d
Revert FrontendException to main branch.
sarahelsaig Apr 6, 2024
0afe5fb
Update HL and fix FrontendException usage.
sarahelsaig Apr 6, 2024
bb9f9d9
Use the FrontendException from HL everywhere.
sarahelsaig Apr 6, 2024
1cdb952
Code cleanup.
sarahelsaig Apr 7, 2024
59670e6
Update and fixes.
sarahelsaig Apr 8, 2024
cc7f41a
Use LineItems instead of Charge.
sarahelsaig Apr 8, 2024
e881264
Fix redirect and reuse error handling.
sarahelsaig Apr 8, 2024
4de5cfc
Handle if there is no response at first.
sarahelsaig Apr 8, 2024
f456a29
Add middleware.
sarahelsaig Apr 8, 2024
50342d4
Move callback logic into provider instead of separate method.
sarahelsaig Apr 9, 2024
ff226f1
DRY tenant reload warnings.
sarahelsaig Apr 9, 2024
3b8cf60
Code cleanup.
sarahelsaig Apr 9, 2024
93d84b3
Add RedirectToWait helper method.
sarahelsaig Apr 9, 2024
e711196
Callback should only evaluate if status is pending, otherwise redirec…
sarahelsaig Apr 9, 2024
179b218
Fix wait view.
sarahelsaig Apr 9, 2024
ef83e7a
Calculate response currency using money service.
sarahelsaig Apr 9, 2024
2ed160a
Fix success.
sarahelsaig Apr 9, 2024
ddf1f5d
Various bug fixes.
sarahelsaig Apr 9, 2024
6e93792
Clean up order statuses, don't use HtmlClassify when not needed.
sarahelsaig Apr 9, 2024
00a670d
Add documentation.
sarahelsaig Apr 9, 2024
e78ce11
Code cleanup
sarahelsaig Apr 9, 2024
363f2c5
Just get rid of the base address editor, it's dangerous!
sarahelsaig Apr 9, 2024
bcd4212
Adjust documentation.
sarahelsaig Apr 9, 2024
ba6a64e
Add info notification with referral.
sarahelsaig Apr 9, 2024
7d1a9b6
Spelling.
sarahelsaig Apr 9, 2024
a09ae7f
Mention referral in docs too.
sarahelsaig Apr 9, 2024
d5dce42
wat?
sarahelsaig Apr 9, 2024
9429101
Merge remote-tracking branch 'origin/main' into issue/OCC-203
sarahelsaig Apr 15, 2024
2d68f1a
Create CreateOrderPartAddressViewModelsAsync extension method.
sarahelsaig Apr 15, 2024
8a08454
Extract logic from ~/checkout/price into IPaymentService.GetTotalAsyn…
sarahelsaig Apr 15, 2024
c225ffb
Bug fix incorrect price when discounted.
sarahelsaig Apr 15, 2024
f28eb24
Remove unused service injection.
sarahelsaig Apr 15, 2024
d097881
Merge branch 'main' into issue/OCC-203
sarahelsaig Apr 15, 2024
b47ffd6
Update docs/features/exactly-payment.md
sarahelsaig Apr 15, 2024
46f53f2
Spacing.
sarahelsaig Apr 15, 2024
8c3fe9a
Fix copy-paste error in documentation.
sarahelsaig Apr 15, 2024
cf7bc3b
Case insensitive GET compare.
sarahelsaig Apr 15, 2024
9d3251b
Merge branch 'issue/OCC-203' of https://github.com/OrchardCMS/Orchard…
sarahelsaig Apr 15, 2024
511cf36
Set API test order's title.
sarahelsaig Apr 15, 2024
882ceb7
Fix order title.
sarahelsaig Apr 15, 2024
0658445
Merge localized string lines.
sarahelsaig Apr 15, 2024
c19fe05
Add Technical overview to the docs.
sarahelsaig Apr 15, 2024
35f6c68
Turn the signup link into a reusable constant.
sarahelsaig Apr 15, 2024
5cf63e5
Add test to verify signup notification.
sarahelsaig Apr 15, 2024
d45f043
bug fix remove reference to deleted field
sarahelsaig Apr 15, 2024
d68bb4f
SignUp instead of Signup
sarahelsaig Apr 15, 2024
9199e17
update class too
sarahelsaig Apr 15, 2024
fde507a
sigh
sarahelsaig Apr 15, 2024
d45ffae
unusing
sarahelsaig Apr 15, 2024
983f551
Add note about only EUR and USD in sandbox.
sarahelsaig Apr 16, 2024
79d2c27
Merge remote-tracking branch 'origin/main' into issue/OCC-203
sarahelsaig Apr 16, 2024
403c835
Add create-webshop.md as solution item.
sarahelsaig Apr 16, 2024
f106876
Update "Creating a webshop" guide.
sarahelsaig Apr 16, 2024
c4cd964
Add note in guide regarding Stripe.
sarahelsaig Apr 16, 2024
ef9e532
Link to the documentation portal in readme.
sarahelsaig Apr 16, 2024
5797a93
Fix formatting in mkdocs
sarahelsaig Apr 16, 2024
0858347
Add missing cross links.
sarahelsaig Apr 16, 2024
29c057e
Update nav to include the missing features/payment-providers.md
sarahelsaig Apr 16, 2024
cbfcf83
taxation clarification
sarahelsaig Apr 17, 2024
601961b
Add ® and fix formatting.
sarahelsaig Apr 17, 2024
9ecb8b3
Also in the button.
sarahelsaig Apr 17, 2024
fb232f9
Update src/Modules/OrchardCore.Commerce.Payment.Exactly/Views/Checkou…
sarahelsaig Apr 17, 2024
d8f0ae2
Update docs/guides/create-webshop.md
sarahelsaig Apr 17, 2024
5bb3be8
Update docs/features/exactly-payment.md
sarahelsaig Apr 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions OrchardCore.Commerce.sln
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.Commerce.Abstra
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrchardCore.Commerce.Payment.Exactly", "src\Modules\OrchardCore.Commerce.Payment.Exactly\OrchardCore.Commerce.Payment.Exactly.csproj", "{73925C09-BF96-4727-91D8-57A88AD1601F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "guides", "guides", "{EF8008F1-64F5-4053-A639-6285084AFA52}"
ProjectSection(SolutionItems) = preProject
docs\guides\create-webshop.md = docs\guides\create-webshop.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -208,6 +213,7 @@ Global
{A4D69733-CDC0-46AE-B46A-163CCC6F77F9} = {E6C02BDF-EEB0-4ABD-ADEC-9932F60923AE}
{28DB6CBB-1527-42A1-8EFE-3D95BF185884} = {90913510-3D7F-4BCC-B55E-56343128F049}
{73925C09-BF96-4727-91D8-57A88AD1601F} = {E6C02BDF-EEB0-4ABD-ADEC-9932F60923AE}
{EF8008F1-64F5-4053-A639-6285084AFA52} = {BEBA1764-178A-4722-A193-4DEF26DCE8D1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {456CBC78-579D-483F-A4C3-AF5C12AB3324}
Expand Down
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,13 @@ If you have [Lombiq Analyzers](https://github.com/Lombiq/.NET-Analyzers) include

## Documentation

Check out the complete documentation portal here: <https://commerce.orchardcore.net/>

- [Inventory](docs/features/inventory.md)
- [Products and Prices](docs/features/products-and-prices.md)
- [Promotions](docs/features/promotions.md)
- [Payment providers](docs/features/payment-providers.md)
- [Exactly® Payment](docs/features/exactly-payment.md)
- [Stripe Payment](docs/features/stripe-payment.md)
- [Taxation](docs/features/taxation.md)
- [User Features](docs/features/user-features.md)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
8 changes: 5 additions & 3 deletions docs/features/exactly-payment.md
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Exactly Payment
# Exactly® Payment

Orchard Core Commerce supports multiple [payment providers](payment-providers.md). [Exactly](https://exactly.com/) is one of the officially included ones. Unlike [our Stripe implementation](stripe-payment.md), it uses redirects to send you to a payment interface on their domain.
Orchard Core Commerce supports multiple [payment providers](payment-providers.md). [Exactly®](https://exactly.com/) is one of the officially included ones. Unlike [our Stripe implementation](stripe-payment.md), it uses redirects to send you to a payment interface on their domain.

To start using, follow these steps:
1. Sign up to Exactly. Please be sure to use [this link](https://application.exactly.com/?utm_source=partner&utm_medium=kirill&utm_campaign=LOMBIQ) to create your account. That way [Lombiq](https://lombiq.com) (the steward of the Orchard Core Commerce project) will get a commission on the payment fees, which helps cover some of the development costs of OCC. This is at no cost to you; the fees you pay are the same either way.

1. Sign up to Exactly®. Please be sure to use [this link](https://application.exactly.com/?utm_source=partner&utm_medium=kirill&utm_campaign=LOMBIQ) to create your account. That way [Lombiq](https://lombiq.com) (the steward of the Orchard Core Commerce project) will get a commission on the payment fees, which helps cover some of the development costs of OCC. This is at no cost to you; the fees you pay are the same either way.
2. Once they respond, ask your contact person for the following:
- Whitelist for your web domain.
- If needed, a sandbox project you can use for testing.
Expand Down Expand Up @@ -36,6 +37,7 @@ There are available test cards for the sandbox environment that can be found in
### Technical overview

As mentioned above, this module uses redirects to communicate with the payment processor. This means the OrchardCore.Commerce site never sees the buyer's payment information, which avoids potential liability and improves buyer confidence. Here is a broad overview of what happens when you click on the _Pay with exactly_ button:

- JS script sends a POST request that only contains the contents of the checkout page (i.e. addresses).
- C# backend creates a new Order content item from the checkout data and the stored shopping cart.
- C# backend sends a POST request to the Exactly API including the order total and the return URL.
Expand Down
1 change: 1 addition & 0 deletions docs/features/payment-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Orchard Core Commerce supports multiple payment providers and allows developers

Each provider is a stand-alone feature you can turn on or off.

- [Exactly](exactly-payment.md): A production-ready provider for [exactly.com](https://exactly.com/).
- [Stripe](stripe-payment.md): A production-ready provider for [stripe.com](https://stripe.com/).
- Dummy: A development-only provider that lets you click through the checkout without going off-site. Mainly used for UI testing.

Expand Down
2 changes: 1 addition & 1 deletion docs/features/taxation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Enable the _Orchard Core Commerce - Tax_ feature. This grants you the _Tax_ cont

## Basic tax support

Filling out the _Gross Price_ and _Tax Rate_ (percentage) fields, automatically updates the product's regular price field to the calculated net price during publish. For products configured like this the shopping cart shows the _Gross Price_ instead of the _Price_ field. This is suitable for stores that only ship locally.
Filling out the _Gross Price_ and _Tax Rate_ (percentage) fields, automatically updates the product's regular price field to the calculated net price during publish. For products configured like this the shopping cart shows the _Gross Price_ instead of the _Price_ field (so it only works with _Price_ part and not the _PriceVariant_ part). This is suitable for stores that only ship locally.

## Locally maintained tax rates

Expand Down
18 changes: 10 additions & 8 deletions docs/guides/create-webshop.md
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ Get the latest version of the [Orchard Core Commerce NuGet](https://www.nuget.or

### Step 2 — Enable necessary features

Certain Orchard Core Commerce features, as well as some prerequisite stock Orchard Core features, need to be enabled for the necessary functionality. This can be done under _Configuration > Features_. These features include the following:
Certain Orchard Core Commerce features, as well as some prerequisite stock Orchard Core features, need to be enabled for the necessary functionality. This can be done under _Configuration > Features_, but if you used the _Orchard Core Commerce - Development_ setup recipe then they are already enabled. These features include the following:

- **Orchard Core Commerce - Core**: Registers core components of Commerce features.
- **Orchard Core Commerce - Payment** Provides the basics for online payment.
- **Orchard Core Commerce - Payment - Stripe**: Provides online payment implementation using Stripe.
- **Orchard Core Commerce - Payment - Exactly**: Provides online payment implementation using Exactly.
DemeSzabolcs marked this conversation as resolved.
Show resolved Hide resolved
- **Orchard Core Commerce - Session Cart Storage**: Provides shopping cart functionality.
- **Widgets**: Allows rendering widgets in zones.
- **Layers**: Allows rendering widgets across pages based on conditions.
Expand Down Expand Up @@ -106,17 +106,19 @@ _Any content type with the Widget stereotype can be added this way, but let's ju

_Name the Widget and select the Layer where it should be rendered._

### Step 6 — Enable a payment provider (Stripe)
### Step 6 — Enable a payment provider (Exactly®)

Having Products and being able to browse them is great and all, but customers will also need a way to checkout and pay for their cart's content. This is where payment providers come into the picture. For simplicity's sake, we'll use Stripe as the payment provider here. Ensure the **Orchard Core Commerce - Payment - Stripe** feature is enabled, then go to _Configuration > Commerce > Stripe API_. The Publishable Key and Secret Key fields need to be filled in for the Stripe Payment form to work on the checkout page, see the links on the settings page for more.
> ℹ If Exactly® is not available in your region [try Stripe instead](../features/stripe-payment.md), the other payment provider OCC has built-in integration for.

![Stripe settings.](../assets/images/create-webshop/step-6/stripe-settings.png)
Having Products and being able to browse them is great and all, but customers will also need a way to checkout and pay for their cart's content. This is where payment providers come into the picture. We will use Exactly®, the default built-in payment provider. Ensure the **Orchard Core Commerce - Payment - Exactly** feature is enabled, then go to _Configuration > Commerce > Exactly API_. The Project ID and API Key fields need to be filled in sp payments are directed towards your account.

_If you don't already have the necessary API keys, follow the links on the page._
![Exactly settings.](../assets/images/create-webshop/step-6/exactly-settings.png)

With that done, the Stripe Payment form now appears on the checkout page and the purchase can be completed.
_See the links on the settings page and the [feature documentation](../features/exactly-payment.md) for info if you haven't got your keys yet._

![Stripe Payment.](../assets/images/create-webshop/step-6/stripe-form.png)
Once you're saved the settings, feel free to click on the _Verify currently saved API configuration_ to test your API access. With that done, the _Pay with exactly_ button now appears on the checkout page which redirects the customer to the payment processor's site and then if everything went well sends them back to the success page.

![Exactly Payment.](../assets/images/create-webshop/step-6/exactly-form.png)

_This will allow customers to pay to their card's content._
Skrypt marked this conversation as resolved.
Show resolved Hide resolved

Expand Down
6 changes: 4 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ nav:
- Inventory: features/inventory.md
- Products and Prices: features/products-and-prices.md
- Promotions: features/promotions.md
- Exactly Payment: features/exactly-payment.md
- Stripe Payment: features/stripe-payment.md
- Payment Providers:
- Overview: features/payment-providers.md
- Exactly® Payment: features/exactly-payment.md
- Stripe Payment: features/stripe-payment.md
- Taxation: features/taxation.md
- User Features: features/user-features.md
- Workflows: features/workflows.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
T["An error has occurred while trying to connect to the payment service. Please try again later."];
}

<shape type="PayButton" PayButtonClass="exactly" prop-Text="@T["Pay with exactly"]" />
<shape type="PayButton" PayButtonClass="exactly" prop-Text="@T["Pay with Exactly\u00ae"]" />

<script asp-name="OrchardCore.Commerce.Payment.Exactly.Script" at="Foot">
Array.from(document.querySelectorAll(".pay-button-exactly")).forEach((button) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@

"OrchardCore.Commerce.Payment.DummyProvider",
"OrchardCore.Commerce.Payment.Exactly",
"OrchardCore.Commerce.Payment.Stripe",
"OrchardCore.Commerce.Promotion",
"OrchardCore.Commerce.Inventory",

Expand Down
Loading