Skip to content

Commit 3ea2152

Browse files
committed
Update docs, fixes #399
1 parent c444bda commit 3ea2152

File tree

5 files changed

+17
-38
lines changed

5 files changed

+17
-38
lines changed

changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ registerProductDiscoverabilityFilter({ hiddenTagValue: 'hidden' });
1919
**Attention: If you upgrade to this version from <3, first upgrade to the latest v3 to not miss any migrations.**
2020

2121
## Major
22-
- Removed `CARD` type for payments. We never used it and it doesn't make sense to provide card data in plaintext.
22+
- Added `Mutation.updateCartPaymentInvoice`, `Mutation.updateCartPaymentGeneric`, `Mutation.updateCartDeliveryPickUp`, `Mutation.updateCartDeliveryShipping`. Those mutations do not only change the provider's configuration but also set the provider as current provider on the cart/orderId provided. As this new flow is superior to the old one involving calling multiple mutations and holding a deliveryId/paymentId in memory for clients, we deprecated the following mutations: `Mutation.updateOrderDeliveryShipping`, `Mutation.updateOrderDeliveryPickUp`, `Mutation.updateOrderPaymentInvoice`, `Mutation.updateOrderPaymentGeneric`, `Mutation.setOrderPaymentProvider`, `Mutation.setOrderDeliveryProvider`
23+
- Removed `CARD` type for payments. We never used it and it doesn't make sense to provide card data in plaintext. Removing `Mutation.updateOrderPaymentCard`.
2324
- Boolean filter types do not support an undefined or null state of values and whenever the key is set in a filter query and it's of type SWITCH (for ex. `[{ key: "meta.feeds.googleAds" }]` it will only show products that have a value of true. You can still do a "NOT" filtering by explicitly providing a value of false or 0: `[{ key: "meta.feeds.googleAds", value: "false" }]`
2425
- `Query.eventsCount` and `Query.events` now accept a DateFilterInput (start/end range) for the created date.
2526
- The Locale Context has been refactored and all API's that had the old chaotic naming: What was once countryContext, currencyContext or localeContext is now countryCode, currencyCode, locale throughout the system: The type of locale fields in the API are now validated at the GraphQL Server level. This effects a lot of plugins too, please check migration-v4.md.

docs/docs/extend/order-fulfilment/carts.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ query {
8383
By using `Mutation.updateCart` you can change the active payment provider for that order (input parameter
8484
`paymentProviderId`).
8585

86-
To set payment provider related options, use `Mutation.updateOrderPaymentInvoice` or `Mutation.updateOrderPaymentGeneric`.
86+
To set payment provider related options, use `Mutation.updateCartPaymentInvoice` or `Mutation.updateCartPaymentGeneric`.
8787

8888
## Delivery Provider configuration
8989

@@ -121,8 +121,8 @@ query {
121121
By using `Mutation.updateCart` you can change the active delivery provider for that order (input
122122
parameter `deliveryProviderId`).
123123

124-
To set delivery provider related options, use `Mutation.updateOrderDeliveryPickUp` or
125-
`Mutation.updateOrderDeliveryShipping`. Pick up providers usually want a pickup location, shipping
124+
To set delivery provider related options, use `Mutation.updateCartDeliveryPickUp` or
125+
`Mutation.updateCartDeliveryShipping`. Pick up providers usually want a pickup location, shipping
126126
providers usually want to know an address to ship a parcel to.
127127

128128
## Discounts

docs/docs/platform-configuration/plugins/apple-iap.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,10 @@ signPaymentProviderForCredentialRegistration(
6464
3. **Create Order**: Create an order with the purchased product and set transaction metadata:
6565

6666
```graphql
67-
updateOrderPayment(
68-
orderPaymentId: "order-payment-id"
69-
paymentPayment: {
70-
meta: {
71-
transactionIdentifier: "apple-transaction-id"
72-
}
67+
updateCartPaymentGeneric(
68+
paymentProviderId: "apple-iap-provider-id"
69+
meta: {
70+
transactionIdentifier: "apple-transaction-id"
7371
}
7472
)
7573
```

docs/docs/tutorials/sausage-pricing.md

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -236,38 +236,18 @@ mutation addCartProduct {
236236
}
237237
```
238238

239-
Tell Unchained more about the guy who orders:
239+
Tell Unchained more about the guy who orders and optionally set payment and delivery providers:
240240

241241
```
242242
mutation updateContact {
243-
updateCart(contact: { emailAddress: "hello@unchained.local" }, billingAddress: {firstName: "Pascal", addressLine: "Haha", postalCode: "5556", city: "somewhere"}) {
243+
updateCart(contact: { emailAddress: "hello@unchained.local" }, billingAddress: {firstName: "Pascal", addressLine: "Haha", postalCode: "5556", city: "somewhere"},
244+
paymentProviderId: "PROVIDER_ID"
245+
deliveryProviderId: "PROVIDER_ID") {
244246
_id
245247
}
246248
}
247249
```
248250

249-
Set order payment provider (optional):
250-
251-
```
252-
mutation SetOrderPaymentProvider{
253-
setOrderPaymentProvider(
254-
orderId: "ORDERID",
255-
paymentProviderId: "PROVIDER_ID"
256-
)
257-
}
258-
```
259-
260-
Set order delivery provider (optional):
261-
262-
```
263-
mutation SetOrderDeliverProvider {
264-
setOrderDeliveryProvider(
265-
orderId: "ORDERID",
266-
deliveryProviderId: "PROVIDER_ID"
267-
)
268-
}
269-
```
270-
271251
Checkout the cart:
272252

273253
```

packages/api/src/schema/mutation.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ export default [
236236
@deprecated(reason: "Use updateCart or updateCartPayment* mutations instead")
237237
238238
"""
239-
Update the cart using a Shipping Delivery Provider with specific configuration
239+
Update the cart by changing the delivery provider and using a shipping specific configuration
240240
"""
241241
updateCartDeliveryShipping(
242242
orderId: ID
@@ -246,7 +246,7 @@ export default [
246246
): Order!
247247
248248
"""
249-
Update the cart using a PickUp Delivery Provider with specific configuration
249+
Update the cart by changing the delivery provider and using a pick up specific configuration
250250
"""
251251
updateCartDeliveryPickUp(
252252
orderId: ID
@@ -256,12 +256,12 @@ export default [
256256
): Order!
257257
258258
"""
259-
Update the cart using an invoice-type payment provider with specific configuration
259+
Update the cart by changing the payment provider and using an invoice-type specific configuration
260260
"""
261261
updateCartPaymentInvoice(orderId: ID, paymentProviderId: ID!, meta: JSON): Order!
262262
263263
"""
264-
Update the cart using a generic payment provider with specific configuration
264+
Update the cart by changing the payment provider and using a generic specific configuration
265265
"""
266266
updateCartPaymentGeneric(orderId: ID, paymentProviderId: ID!, meta: JSON): Order!
267267

0 commit comments

Comments
 (0)