Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

feat(docs): add usage of shopware-6-client in payment guide #754

Merged
Merged
Changes from all commits
Commits
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
16 changes: 14 additions & 2 deletions docs/guide/PAYMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ The base for a payment transaction is always the order. There is no transaction
```
POST sales-channel-api/v1/checkout/order
```


Respose:
```json {7,11}
{
Expand All @@ -71,6 +69,13 @@ Respose:
}
```

or using [**@shopware-pwa/shopware-6-client**](https://www.npmjs.com/package/@shopware-pwa/shopware-6-client)
```
import { createOrder } from "@shopware-pwa/shopware-6-client"

const response: Promise<Order> = createOrder()
```

The order that was created contains the following (and more) fields:

* `orderNumber` - identification used for internal/accounting purposes (no technical relevance)
Expand All @@ -96,6 +101,13 @@ POST store-api/v1/payment-method
}
```

or using [**@shopware-pwa/shopware-6-client**](https://www.npmjs.com/package/@shopware-pwa/shopware-6-client)
```
import { getAvailablePaymentMethods } from "@shopware-pwa/shopware-6-client"

const response: Promise<PaymentMethod[]> = getAvailablePaymentMethods()
```


:::details Want to know what's happening in detail?

Expand Down