https://github.com/Microsoft/Windows-appsample-shopping
A sample app that demonstrates the UWP Payment Request APIs.
https://github.com/Microsoft/Windows-appsample-shopping
Last synced: 5 months ago
JSON representation
A sample app that demonstrates the UWP Payment Request APIs.
- Host: GitHub
- URL: https://github.com/Microsoft/Windows-appsample-shopping
- Owner: microsoft
- License: mit
- Archived: true
- Created: 2017-06-09T18:18:56.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2019-02-05T17:28:17.000Z (about 6 years ago)
- Last Synced: 2024-08-04T01:11:24.275Z (9 months ago)
- Language: C#
- Size: 93.8 KB
- Stars: 28
- Watchers: 6
- Forks: 29
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
---
topic: sample
languages:
- csharp
products:
- windows
- windows-uwp
---# Payment Request API Sample App
A mini-app that presents a basic shopping experience where a user can buy emoji. This app shows how to use the
[Payment Request APIs](https://docs.microsoft.com/uwp/api/windows.applicationmodel.payments) to implement the checkout experience. It also demonstrates a basic multi-page XAML UI that uses
the Model-View-ViewModel (MVVM) pattern.This sample runs on the Universal Windows Platform (UWP).

## Features
Payment Request API Sample App demonstrates:
* Using the Payment Request APIs ([Windows.ApplicationModel.Payments](https://docs.microsoft.com/uwp/api/windows.applicationmodel.payments))
## Universal Windows Platform development
Requirements:
* Windows 10 Creators Update - 1703 (or later)
* [Visual Studio 2017 (or later)](https://www.visualstudio.com/downloads/)
* [Windows SDK - Build 15063 (or later)](https://developer.microsoft.com/windows/downloads/windows-10-sdk)Additionally, to be informed of the latest updates to Windows and the development tools, join the
[Windows Insider Program](https://insider.windows.com/ "Become a Windows Insider").## Running the sample
**Note:** The platform target currently defaults to ARM, so be sure to change that to x64 or x86 if you want to test on
a non-ARM device.The default project is YetAnotherShoppingApp and you can Start Debugging (F5) or Start Without Debugging (Ctrl+F5) to try
it out. The app will run in the emulator or on physical devices.## Code at a glance
If you’re just interested in code snippets for certain API and don’t want to browse or run the full sample, check out the
following files for examples of some highlighted features:* [WindowsPaymentOperation.cs](YetAnotherShoppingApp/Views/WindowsPaymentOperation.cs#L25)
- Uses [PaymentMediator.SubmitPaymentRequestAsync](https://docs.microsoft.com/uwp/api/windows.applicationmodel.payments.paymentmediator#Windows_ApplicationModel_Payments_PaymentMediator_SubmitPaymentRequestAsync_) to initiate the checkout experience.
* [BasicCardPaymentProtocol.cs](YetAnotherShoppingApp/Models/BasicCardPaymentProtocol.cs#L25)
- Handles the boilerplate of the [W3C Basic Card Payment Method](https://www.w3.org/TR/payment-method-basic-card/).