Introducing Cash App API: A Seamless Payment Solution

Simplify Online Checkout with Cash App Pay

We are excited to announce that developers and partners now have the ability to integrate Cash App Pay into their online checkout process using the Square Web Payments SDK and Square Checkout API. Cash App is a widely-used mobile payment app that holds the title of the #1 finance app in the App Store, boasting over 70 million annual active users in the U.S. With Cash App Pay, customers can effortlessly pay using their Cash App account balance or linked bank account. Since its introduction to Square Online and Square Point of Sale sellers in late 2021, millions of unique buyers have already used Cash App Pay to make secure and seamless payments to hundreds of thousands of Square sellers.

How Cash App Pay Works

The process of using Cash App Pay is straightforward. When checking out, customers simply click on the Cash App Pay button and can then choose to either scan the provided QR code on their desktop or have the Cash App open automatically on their mobile device. With Cash App Pay, there is no need to provide card details such as the card number, expiration date, CVV, or billing address. It offers a familiar and secure peer-to-peer payment experience through the Cash App.

See also  Discover the Exciting Potential of Bard API

Simplify Integration with Cash App Pay

This release offers developers a variety of benefits:

  • Enable a fast and familiar checkout experience with just a few lines of code. The integration of Cash App Pay into the Square Web Payments SDK is effortless, requiring only a few lines of code. Furthermore, Cash App Pay is prebuilt into the Checkout API, eliminating the need for additional integration work.

  • Build and maintain a single integration for both Square and Cash App Pay payments. Instead of creating multiple integrations utilizing Square APIs and Cash App APIs separately, this release streamlines the process, reducing developer resources and maintenance costs.

  • Help sellers consolidate transaction data in the Square Dashboard. By utilizing a single integration, all funds from Square and Cash App Pay payments flow into sellers’ Square accounts, simplifying cash flow management.

Notable Square partners, including Jotform, Reference Health, Magento, Iris Works, Kyoo, BillyCart, and Payable Forms, have already begun building integrations with Cash App Pay.

“We’re excited to offer Cash App Pay on Jotform as a payment option for fast and effortless online payments to more than 15 million customers globally. Square makes it easy to add new payment methods, and we’re eager to add this one to our Web Payments SDK integration.” — Ender Ozmen, Head of Payments at Jotform

Adding Cash App Pay to Your Web Payments SDK Integration

To incorporate Cash App Pay into your Web Payments SDK integration, follow these simple steps:

  1. Add an element to attach Cash App Pay:

    <form id="payment-form">
    <!-- Add the cash-app-pay button div below -->
    <div id="cash-app-pay"></div>
    <div id="card-container"></div>
    <button id="card-button" type="button">Pay $1.00</button>
    </form>
    <div id="payment-status-container"></div>
  2. Include the necessary functions:

    
    function buildPaymentRequest(payments) {
    const paymentRequest = payments.paymentRequest({
    countryCode: 'US',
    currencyCode: 'USD',
    total: {
    amount: '1.00',
    label: 'Total',
    },
    });
    return paymentRequest;
    }

async function initializeCashApp(payments) {
const paymentRequest = buildPaymentRequest(payments);
const cashAppPay = await payments.cashApp(paymentRequest, {
redirectURL: ‘https://my.website/checkout‘,
referenceId: ‘my-website-00000001’,
});
await cashAppPay.attach(‘#cash-app-pay’);
return cashAppPay;
}


3. Provide the required redirectURL value:

The initializeCashApp function requires a redirectURL value to indicate where to send buyers after completing a payment on a mobile device. The redirectURL value is only for mobile payments and is not used for desktop QR payments.


4. In the DOMContentLoaded event listener, initialize Cash App Pay:
```javascript
let cashAppPay;
try {
cashAppPay = await initializeCashApp(payments);
} catch (e) {
console.error('Initializing Cash App Pay failed', e);
}
  1. Retrieve the payment token from Cash App Pay:
    cashAppPay.addEventListener('ontokenization', function (event) {
    const { tokenResult, error } = event.details;
    if (error) {
    // developer handles error
    } else if (tokenResult.status === 'OK') {
    // developer passes token to backend for use with CreatePayment
    }
    });

Get Started with Cash App Pay

Cash App Pay is now available for developers and partners in the U.S. through the Web Payments SDK and Checkout API. To start building your integration, refer to our developer documentation, technical reference, and payments pricing. We value your feedback, so feel free to share it in our community Slack channel or Square Developer Forums. Stay updated with the latest content by following this blog and our Twitter account.

See also  Dividend Rate Vs APY

ProgramMatek