When a cardholder is in a hurry, a scan to pay app with Visa capabilities can help let enrolled and eligible cardholders use their mobile device to scan a participating merchant’s QR code to quickly pay for an item or service. From food cards and taxis to restaurants and brick-and-mortar stores, merchants can make it easy for consumers to pay from their phone.
This app makes use of Visa APIs and microservices as well as third-party systems to provide a simple, easy user experience. In the back of the participating taxi, at the food cart, or in the store—wherever the user is, it can be simple to pay. Here’s an overview of the app. Below, you can find some information about how we created the application.
The scan to pay app with Visa capabilities relies on the participating merchant creating a QR code for payment use. The merchant uses the mobile app to create the code by entering the fee amount (and any additional payment information). The mobile app generates the QR code, which the merchant can display on the phone or save and print for display.
The consumer opens the mobile app on his or her phone and scans the posted QR code. The QR code maps to the merchant and merchant card which is the recipient of the payment made.
The vendor tells the user the total amount and, in the app, the user enters that amount and clicks to begin the transaction. Using the Funds Transfer API, the payment is processed.
The customer sees a confirmation in the app, and the merchant receives payment confirmation or a decline message, if there’s a problem.
It can be easy to pay on the go with this mobile app. Vendors or merchants can generate a QR code that consumers scan to help quickly pay the bill, and move on.
The Node.js client library simplifies calling Visa APIs. Currently, it supports Funds Transfer API and mVisa API.
The Node.js client library simplifies calling Mutual Auth or X-Pay Token based requests to Visa APIs.
The scan to pay app with Visa capabilities is designed for smartphones and makes use of a number of platforms, APIs, and microservices*. To create the app, our team used some of the following prerequisites and steps.
Note: For the example that follows, our team used Visa Developer APIs, and an Apple® developer account along with Apple development and open source software.
To get started you may need:
As a reference, Visa has provided sample code for this app. Find the reference implementation for this application on Visa GitHub.
To create this app, our team:
Cloned the scan to pay GitHub repository or downloaded the code.
$pod install
In the Constants.swift file, replace YOUR_ENDPOINT with the server name in the payMerchant endpoint:
static let payMerchantEndpoint: String = "YOUR_ENDPOINT".
In the controller file, for exampleViewController.swift, entered some sample card information, including:
For example:
let merchant = [ "acquiringBin": payMerchantResponse?.bin, "city": payMerchantResponse?.cityName!, "countryCode": payMerchantResponse?.countryCode!, "pan": payMerchantResponse?.mVisaMerchantPan!, "name": payMerchantResponse?.merchantName! ] as! [String: String] let transaction = [ "amount": payMerchantResponse?.currencyCode, "currencyCode": payMerchantResponse?.currencyCode ] as! [String: String] let parameters = ["merchant": merchant, "transaction": transaction]
Alamofire.request(Constants.payMerchantEndpoint, method: .post, parameters: parameters, encoding: JSONEncoding.default) .responseJSON { response in debugPrint(response) }
1 Apple®, Xcode®, IOS®, and Cocoa® are registered trademarks of Apple Inc.
Any use of this code is subject to the Visa Developer Terms of Use (developer.visa.com/terms) and constitutes acceptance of these Terms.
let contextPath = 'visadirect/'
let resourcePath = 'mvisa/v1/merchantpushpayments'
instance.doMutualAuthRequest(contextPath+resourcePath,{},'POST',mVisaTransactionRequest)
.then(response => {
// do something with the response
})
.catch(err => {
// do something with the response
})
* VISA CONFIDENTIAL
Legal Disclaimer
All brand names and logos are the property of their respective owners, used for identification purposes only, and do not imply product endorsement or affiliation with Visa. Any links to third party sites are for your information only and equally do not constitute a Visa endorsement. Visa has no insight into and control over third party content and code and disclaims all liability for any such components, including continued availability and functionality. Benefits depend on implementation details and business factors and coding steps shown are exemplary only and do not reflect all necessary elements for the described capabilities. Depictions are illustrative only and use of capabilities and features are subject to Visa’s terms and conditions and may require development, implementation and resources by you based on your business and operational details. Please refer to the specific API documentation for details on the requirements, eligibility and geographic availability.
This website includes programs, concepts and details under continuing development by Visa. Any Visa features, functionality, implementation, branding, and schedules may be amended, updated or canceled at Visa’s discretion. The timing of widespread availability of programs and functionality is also subject to a number of factors outside Visa’s control, including but not limited to deployment of necessary infrastructure by issuers, acquirers, merchants and mobile device manufacturers.
Use of Visa Direct APIs in production requires the originator to be a licensed Visa acquirer or to obtain sponsorship by a licensed Visa acquirer and is subject to Visa’s review and approval.