The Stripe Order service is a connecting point for synchronizing orders between Stripe Relay and YaaS. The service is part of the Stripe Relay In-App & Social Sales package, which allows merchants to sell products directly within mobile apps via Stripe Relay.
The YaaS services environment includes several services that are required by the Stripe Order service. The required services are:
- Order service
- PubSub service
- Document service
- Stripe Order Webhook service
The Stripe Order service requires the following scopes:
For more information about scopes, see the documentation for the particular service:
Stripe Order Introduction
Orders in Stripe are created, usually by a customer, via Stripe Relay. For example, a customer can click a Buy Now button in a tweet to create an order in Stripe.
The order is created in Stripe after the customer makes the payment. After the payment goes through successfully, the order status changes to paid.
Then, the order information is sent to YaaS via a webhook call from Stripe. The merchants must set up the webhook in their Stripe dashboard. For more information about the webhook, see the Order Webhook Stripe service documentation.
Eventually, the Stripe order arrives at the Stripe Order service, which can be seen as a connection point between the Stripe and YaaS services.
After an order is created in the Order service in YaaS, an email notification is sent to the customer, and the merchant can further process the order. Just like any other order in YaaS, the order can be confirmed, shipped, and completed. As soon as the order status is changed to shipped in the Order service in YaaS, the Stripe Order service updates the status of the order in Stripe to Fulfilled.
In general, the Stripe Order service converts a Stripe order to a YaaS order. The Stripe Order service does the following:
- It consumes the topic from the PubSub service and reads the stripeOrderId data.
- It validates the stripeOrderId by fetching the details of the order from Stripe. If validation is successful, it means that the stripeOrderId is a valid order.
- It keeps track of the processed orders and checks to see if the Stripe order is a new order or if it has already been processed. This check is necessary because Stripe guarantees at least one delivery of the Stripe order. This means that a Stripe order can actually be sent multiple times. This check ensures that the Stripe Order service does not create another order in YaaS based on the same stripeOrderId.
- It keeps track of the processing of the stripeOrderId using the Document service.
- It creates a YaaS order in the Order Service for further processing.
- It consumes the order-status-changed topic from the PubSub service and reads the stripeOrderId that needs to be updated.
- After the order status changes to SHIPPED in the YaaS Order service, the Stripe Order service updates the order status in Stripe to Fulfilled.
- After the order status changes to DECLINED in the YaaS Order service, the corresponding order in Stripe is automatically refunded and its status changes to Canceled.
- It tries to figure out the channel/source from where the order originates. Currently, only Twitter recognition is possible. If the source is not identified, then the service sets Stripe as the channel for the order created in the YaaS order service.
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.