Skip to content

Commit

Permalink
# Removing no required requisite and fixing typo
Browse files Browse the repository at this point in the history
  • Loading branch information
maurok committed May 18, 2017
1 parent 89f847c commit f2cb6ca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions CSharp/sample-payments/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ A sample bot showing how to integrate with Microsoft Seller Center for payment p
### Prerequisites

The minimum prerequisites to run this sample are:
* A Microsoft Wallet subscription. To get a subscription signup [here](https://www.microsoft.com/en-us/payments).
* The latest update of Visual Studio 2015. You can download the community version [here](http://www.visualstudio.com) for free.
* Register your bot with the Microsoft Bot Framework. Please refer to [this](https://docs.botframework.com/en-us/csharp/builder/sdkreference/gettingstarted.html#registering) for the instructions. Once you complete the registration, update the [Bot's Web.config](PaymentsBot/Web.config#L9-L11) file with the registered config values (MicrosoftAppId and MicrosoftAppPassword).

Expand Down Expand Up @@ -264,7 +263,7 @@ private async Task<PaymentRequestCompleteResult> ProcessPaymentComplete(IInvokeA

As you can see the method calls the [`PaymentService`](PaymentsBot/Controllers/MessagesController.cs#L183) which completes the payment by registering the user's action and calls the external payment service (in this case Stripe), and sets the result value with a 'success' or 'failure' depending on the result of that operation. It also returns a `PaymentRecord` which will be sent after to the Bot.

Finally, a message is built in order to send it to the Bot to end the payment conversation by showing a receipt is the operation was successful or show an error otherwise. To build this message a `ConversationReference` instance at [`invoke.RelatesTo`](PaymentsBot/Controllers/MessagesController.cs#L195) is used, and the conversation is resumed using the [`Conversation.ResumeAsync`](PaymentsBot/Controllers/MessagesController.cs#L207) helper.
Finally, a message is built in order to send it to the Bot to end the payment conversation by showing a receipt if the operation was successful or show an error otherwise. To build this message a `ConversationReference` instance at [`invoke.RelatesTo`](PaymentsBot/Controllers/MessagesController.cs#L195) is used, and the conversation is resumed using the [`Conversation.ResumeAsync`](PaymentsBot/Controllers/MessagesController.cs#L207) helper.

The conversation is resumed where it was left after showing the `HeroCard` with the `Buy` button to the user. There, the [`AfterPurchaseAsync`](PaymentsBot/Dialogs/RootDialog.cs#L58) handler was stacked within the `IDialogContext` in order to continue the conversation flow. This handler receives the `PaymentRecord` generated by the payment service within the activity's value, and builds a `ReceiptCard` by calling the [`BuildReceiptCardAsync`](PaymentsBot/Dialogs/RootDialog.cs#L239) method (if no payment record is present we assume an error occurred and display the activity message).

Expand Down

0 comments on commit f2cb6ca

Please sign in to comment.