0.1.0 • Published 9 years ago
vue-squarepay
Licence
MIT
Version
0.1.0
Deps
0
Vulns
0
Weekly
0
vue-squarepay
A Vue component that wraps the Web API functionality of Square to accept payments.
Install:
$ npm install --save vue-squarepay
Usage:
This component takes the query parameters to initiate a payment with the Squarepay WebAPI. The main settings are easily configurable with props : client, currency, amount, callbackUrl - see table below for full usage breakdown.
Params/Props:
| Name | Description | Prop | Type | Required |
|---|---|---|---|---|
action |
This must be com.squareup.register.action.CHARGE. This represents a Square transaction request. |
No | N/A | Yes |
S.com.squareup.register.WEB_CALLBACK_URI |
The callback URI that Square Register will use to send a response. | Yes - callbackUrl |
String | Yes |
S.com.squareup.register.CLIENT_ID |
Your client ID | Yes - client |
String, Number |
Yes |
S.com.squareup.register.API_VERSION |
The targeted version of the Square Register API, e.g., v1.3 | No | N/A | Yes |
S.com.squareup.register.CURRENCY_CODE |
The currency code, e.g., USD | Yes - currency |
String |
Yes |
i.com.squareup.register.TOTAL_AMOUNT |
The total amount represented in the smallest unit of the supplied currency, e.g., a value of 100 corresponds to $1.00 USD | Yes - amount |
Number |
Yes |
S.com.squareup.register.TENDER_TYPES |
Provides the tender types that will be allowed and displayed by Square Register. Must be a non-empty comma-delimited set of the following 4 rows | No | N/A | Yes |
com.squareup.register.TENDER_CARD |
See Above | No | N/A | Yes |
com.squareup.register.TENDER_CARD_ON_FILE |
See Above | No | N/A | Yes |
com.squareup.register.TENDER_CASH |
See Above | No | N/A | Yes |
com.squareup.register.TENDER_OTHER |
See Above | No | N/A | Yes |
package |
If set, this must be 'com.squareup'. Identifies the package name of the application responding to this intent. | No | N/A | Recommended |
S.com.squareup.register.CURRENCY_CODE |
If Register is not installed, Android will route to this supplied url; If missing, Android will route to Play Store if package parameter is provided. | Yes - callbackUrl |
String |
No |
S.com.squareup.register.NOTE |
A note to add to your transaction if completed successfully. | No | N/A | No |
S.com.squareup.register.REQUEST_METADATA |
The state parameter that is returned in the response for the developer's use. | No | N/A | No |
Example:
Here is an example application containing the squarepay component:
JavaScript:
import Vue from 'vue';
import Squarepay from 'vue-squarepay';
new Vue({
el: '#app',
store,
components: { Squarepay },
});
Markup:
<squarepay :callbackUrl="callbackUrl" :client="client" :currency="currency" :amount="amount"></squarepay>