├── .gitignore ├── .jshintignore ├── .jshintrc ├── FAQ.md ├── FEATURES.md ├── Gruntfile.js ├── HACKING.md ├── LICENSE.md ├── README.md ├── bin ├── country-codes.js ├── db-audit.js ├── payflow-client.js ├── promo.js ├── url-info.js ├── usaepay-client.js └── validate-address.js ├── configs ├── bin.dev.js ├── common.js ├── constants.js ├── dev-data.js ├── payswarm.dev.js ├── permissions.js ├── roles.js ├── test.js └── yahoo-av.example.js ├── email-templates ├── bedrock.Identity.created-identity.tpl ├── common.Deposit.ach-merchant-account-log.tpl ├── common.Deposit.cc-merchant-account-log.tpl ├── common.Deposit.failure.tpl ├── common.Deposit.success-identity.tpl ├── common.Deposit.success.tpl ├── common.FinancialAccount.created.tpl ├── common.FinancialAccount.unbackedCreditPayoffFailed-identity.tpl ├── common.FinancialAccount.unbackedCreditPayoffFailed.tpl ├── common.PaymentToken.bankAccountCreated-identity.tpl ├── common.PaymentToken.bankAccountCreated.tpl ├── common.PaymentToken.unverified-identity.tpl ├── common.PaymentToken.unverified.tpl ├── common.PaymentToken.unverifiedLimitReached.tpl ├── common.PaymentToken.verified-identity.tpl ├── common.PaymentToken.verifyBalanceTooLow.tpl ├── common.PaymentToken.verifyFailed.tpl ├── common.Purchase.success-identity.tpl ├── common.Purchase.success.tpl ├── common.Transaction.externalTransactionVoided.tpl ├── common.Transaction.statusCheckError.tpl ├── common.Transaction.statusChecksExceeded.tpl ├── common.Withdrawal.ach-merchant-account-log.tpl ├── common.Withdrawal.failure.tpl ├── common.Withdrawal.success-identity.tpl ├── common.Withdrawal.success.tpl ├── hosted.Listing.assetExpired-identity.tpl └── mapper.js ├── less ├── app.less └── cc-logos.less ├── lib ├── payswarm-auth │ ├── audit-map-reduce.js │ ├── audit-txn-worker.js │ ├── audit.js │ ├── authority.js │ ├── av.test.js │ ├── av.yahoo.js │ ├── financial.account.js │ ├── financial.budget.js │ ├── financial.contract.js │ ├── financial.deposit.js │ ├── financial.js │ ├── financial.paymentToken.js │ ├── financial.regulation.js │ ├── financial.transaction.js │ ├── financial.transfer.js │ ├── financial.withdrawal.js │ ├── hosted.asset.js │ ├── hosted.listing.js │ ├── identityAddress.js │ ├── identityPreferences.js │ ├── jsonld.js │ ├── money.js │ ├── monitors.js │ ├── payflow-client.js │ ├── pg.authority.js │ ├── pg.payflow.js │ ├── pg.test.js │ ├── pg.usaepay.js │ ├── promo.js │ ├── resource.js │ ├── security.js │ ├── services.account.js │ ├── services.address.js │ ├── services.assetora.js │ ├── services.budget.js │ ├── services.hosted.asset.js │ ├── services.hosted.listing.js │ ├── services.identityPreferences.js │ ├── services.license.js │ ├── services.paymentToken.js │ ├── services.payswarm.identifier.js │ ├── services.promo.js │ ├── services.system.js │ ├── services.test.js │ ├── services.tools.js │ ├── services.transaction.js │ ├── services.vendor.js │ ├── services.well-known.js │ ├── system.js │ ├── tools.js │ └── usaepay-client.js └── rdfa │ └── rdfa.js ├── locales ├── de.js ├── en.js ├── es.js ├── fr.js ├── ja.js ├── ru.js └── zh.js ├── npm-shrinkwrap.json ├── package.json ├── payswarm.dev.js ├── pki ├── README ├── test-payswarm-auth.crt └── test-payswarm-auth.key ├── protractor.conf.js ├── schemas ├── address.js ├── allowBudget.js ├── asset.js ├── bankAccount.js ├── creditCard.js ├── currency.js ├── deposit.js ├── depositAmount.js ├── invoice.js ├── ipv4Address.js ├── money.js ├── payee.js ├── payeeRule.js ├── paymentToken.js ├── promo.js ├── receipt.js ├── referenceId.js ├── refreshInterval.js ├── regulatoryAddress.js ├── resourceHash.js ├── resources.asset.js ├── resources.license.js ├── resources.listing.js ├── services.account.js ├── services.address.js ├── services.budget.js ├── services.hosted.asset.js ├── services.hosted.listing.js ├── services.identityPreferences.js ├── services.license.js ├── services.paymentToken.js ├── services.payswarm.identifier.js ├── services.promo.js ├── services.test.js ├── services.transaction.js ├── services.vendor.js ├── transaction.js ├── transfer.js ├── validatedAddress.js ├── validityInterval.js ├── vendor.js ├── withdrawal.js └── withdrawalAmount.js ├── site ├── img-src │ └── cc-logos.xcf ├── static │ ├── app │ │ ├── bootstrap.js │ │ ├── components │ │ │ ├── account │ │ │ │ ├── account-balance-details-directive.js │ │ │ │ ├── account-balance-details.html │ │ │ │ ├── account-balance-directive.js │ │ │ │ ├── account-balance-summary-directive.js │ │ │ │ ├── account-balance-summary.html │ │ │ │ ├── account-balance.html │ │ │ │ ├── account-controller.js │ │ │ │ ├── account-form.html │ │ │ │ ├── account-routes.js │ │ │ │ ├── account-selection-directive.js │ │ │ │ ├── account-selection.html │ │ │ │ ├── account-selector-directive.js │ │ │ │ ├── account-selector.html │ │ │ │ ├── account-service.js │ │ │ │ ├── account-view.html │ │ │ │ ├── account.html │ │ │ │ ├── account.js │ │ │ │ ├── accounts-directive.js │ │ │ │ ├── accounts-view.html │ │ │ │ ├── accounts.html │ │ │ │ ├── add-account-modal-directive.js │ │ │ │ ├── add-account-modal.html │ │ │ │ ├── add-credit-line-complete.html │ │ │ │ ├── add-credit-line-modal-directive.js │ │ │ │ ├── add-credit-line-modal.html │ │ │ │ ├── add-credit-line-review.html │ │ │ │ ├── deposit-complete.html │ │ │ │ ├── deposit-modal-directive.js │ │ │ │ ├── deposit-modal.html │ │ │ │ ├── deposit-prepare.html │ │ │ │ ├── deposit-review.html │ │ │ │ ├── edit-account-modal-directive.js │ │ │ │ ├── edit-account-modal.html │ │ │ │ ├── update-account-button-directive.js │ │ │ │ ├── update-account-button.html │ │ │ │ ├── withdraw-complete.html │ │ │ │ ├── withdraw-modal-directive.js │ │ │ │ ├── withdraw-modal.html │ │ │ │ ├── withdraw-prepare.html │ │ │ │ └── withdraw-review.html │ │ │ ├── address │ │ │ │ ├── add-address-edit.html │ │ │ │ ├── add-address-modal-directive.js │ │ │ │ ├── add-address-modal.html │ │ │ │ ├── add-address-select.html │ │ │ │ ├── address-form.html │ │ │ │ ├── address-selector-directive.js │ │ │ │ ├── address-selector.html │ │ │ │ ├── address-service.js │ │ │ │ ├── address-settings.html │ │ │ │ ├── address-view-directive.js │ │ │ │ ├── address-view.html │ │ │ │ ├── address.js │ │ │ │ ├── addresses-controller.js │ │ │ │ ├── addresses-directive.js │ │ │ │ ├── addresses-view.html │ │ │ │ ├── edit-address-modal-directive.js │ │ │ │ └── edit-address-modal.html │ │ │ ├── assetora │ │ │ │ ├── add-asset-modal-directive.js │ │ │ │ ├── add-asset-modal.html │ │ │ │ ├── add-invoice-item-modal-directive.js │ │ │ │ ├── add-invoice-item-modal.html │ │ │ │ ├── add-invoice-modal-directive.js │ │ │ │ ├── add-invoice-modal.html │ │ │ │ ├── add-listing-modal-directive.js │ │ │ │ ├── add-listing-modal.html │ │ │ │ ├── asset-form.html │ │ │ │ ├── assetora-controller.js │ │ │ │ ├── assetora-routes.js │ │ │ │ ├── assetora.html │ │ │ │ ├── assetora.js │ │ │ │ ├── causes-controller.js │ │ │ │ ├── causes.html │ │ │ │ ├── content-portal-controller.js │ │ │ │ ├── edit-asset-modal.html │ │ │ │ ├── edit-invoice-modal.html │ │ │ │ ├── edit-listing-modal.html │ │ │ │ ├── hosted-asset-service.js │ │ │ │ ├── hosted-assets-controller.js │ │ │ │ ├── hosted-listing-service.js │ │ │ │ ├── invoice-form.html │ │ │ │ ├── invoice-item-form.html │ │ │ │ ├── invoices-controller.js │ │ │ │ ├── invoices.html │ │ │ │ ├── listing-form.html │ │ │ │ ├── protect-asset-modal-directive.js │ │ │ │ ├── protect-asset-modal.html │ │ │ │ ├── protect-asset-php.html │ │ │ │ ├── tickets-controller.js │ │ │ │ ├── tickets.html │ │ │ │ ├── tools-controller.js │ │ │ │ └── tools.html │ │ │ ├── budget │ │ │ │ ├── add-budget-modal-directive.js │ │ │ │ ├── add-budget-modal.html │ │ │ │ ├── budget-bar-directive.js │ │ │ │ ├── budget-bar.html │ │ │ │ ├── budget-controller.js │ │ │ │ ├── budget-form.html │ │ │ │ ├── budget-routes.js │ │ │ │ ├── budget-selection-directive.js │ │ │ │ ├── budget-selection.html │ │ │ │ ├── budget-selector-directive.js │ │ │ │ ├── budget-selector.html │ │ │ │ ├── budget-service.js │ │ │ │ ├── budget-view.html │ │ │ │ ├── budget.html │ │ │ │ ├── budget.js │ │ │ │ ├── budgets-directive.js │ │ │ │ ├── budgets-view.html │ │ │ │ ├── edit-budget-modal-directive.js │ │ │ │ └── edit-budget-modal.html │ │ │ ├── components.js │ │ │ ├── dashboard │ │ │ │ ├── dashboard-controller.js │ │ │ │ ├── dashboard.html │ │ │ │ ├── dashboard.js │ │ │ │ ├── messages-directive.js │ │ │ │ ├── messages-view.html │ │ │ │ ├── welcome-modal-directive.js │ │ │ │ └── welcome-modal.html │ │ │ ├── identity-preferences │ │ │ │ ├── identity-preferences-service.js │ │ │ │ └── identity-preferences.js │ │ │ ├── payment-token │ │ │ │ ├── add-payment-token-modal-directive.js │ │ │ │ ├── add-payment-token-modal.html │ │ │ │ ├── card-brand-filter.js │ │ │ │ ├── cc-number-filter.js │ │ │ │ ├── credit-card-selector-directive.js │ │ │ │ ├── edit-payment-token-modal-directive.js │ │ │ │ ├── edit-payment-token-modal.html │ │ │ │ ├── external-account-settings.html │ │ │ │ ├── external-accounts-controller.js │ │ │ │ ├── external-accounts-directive.js │ │ │ │ ├── external-accounts-view.html │ │ │ │ ├── kredit-directive.js │ │ │ │ ├── payment-token-form.html │ │ │ │ ├── payment-token-list-directive.js │ │ │ │ ├── payment-token-list-selector-modal-directive.js │ │ │ │ ├── payment-token-list-selector-modal.html │ │ │ │ ├── payment-token-list.html │ │ │ │ ├── payment-token-selection-directive.js │ │ │ │ ├── payment-token-selection.html │ │ │ │ ├── payment-token-selector-directive.js │ │ │ │ ├── payment-token-selector.html │ │ │ │ ├── payment-token-service.js │ │ │ │ ├── payment-token.js │ │ │ │ ├── verify-bank-account-complete.html │ │ │ │ ├── verify-bank-account-modal-directive.js │ │ │ │ ├── verify-bank-account-modal.html │ │ │ │ ├── verify-bank-account-prepare.html │ │ │ │ └── verify-bank-account-review.html │ │ │ ├── promo │ │ │ │ ├── promo-code-checker-directive.js │ │ │ │ ├── promo-service.js │ │ │ │ ├── promo.js │ │ │ │ ├── redeem-promo-code-modal-directive.js │ │ │ │ └── redeem-promo-code-modal.html │ │ │ ├── purchase │ │ │ │ ├── purchase-controller.js │ │ │ │ └── purchase.js │ │ │ ├── system │ │ │ │ ├── dashboard-controller.js │ │ │ │ └── system.js │ │ │ ├── transaction │ │ │ │ ├── money-directive.js │ │ │ │ ├── money.html │ │ │ │ ├── transaction-controller.js │ │ │ │ ├── transaction-details-directive.js │ │ │ │ ├── transaction-details.html │ │ │ │ ├── transaction-routes.js │ │ │ │ ├── transaction-service.js │ │ │ │ ├── transaction-view.html │ │ │ │ ├── transaction.html │ │ │ │ ├── transaction.js │ │ │ │ ├── transactions-directive.js │ │ │ │ └── transactions-view.html │ │ │ └── vendor │ │ │ │ ├── register-controller.js │ │ │ │ └── vendor.js │ │ ├── configs.js │ │ └── configs │ │ │ ├── settings.js │ │ │ └── site.js │ ├── contexts │ │ └── payswarm-v1.jsonld │ ├── css │ │ ├── admin.css │ │ ├── app.css │ │ ├── custom.css │ │ ├── ie.css │ │ └── system-dashboard.css │ ├── favicon.ico │ ├── fonts │ │ ├── GnuMICR.eot │ │ ├── GnuMICR.svg │ │ ├── GnuMICR.ttf │ │ ├── GnuMICR.woff │ │ ├── KreditBack.eot │ │ ├── KreditBack.svg │ │ ├── KreditBack.ttf │ │ ├── KreditBack.woff │ │ ├── KreditFront.eot │ │ ├── KreditFront.svg │ │ ├── KreditFront.ttf │ │ ├── KreditFront.woff │ │ ├── KreditShine.eot │ │ ├── KreditShine.svg │ │ ├── KreditShine.ttf │ │ └── KreditShine.woff │ ├── img │ │ ├── bank-icon.png │ │ ├── cc-background.svg │ │ ├── cc-logos.png │ │ ├── payswarm.png │ │ ├── scode.png │ │ └── swarm.png │ ├── php-json-ld │ │ └── jsonld.php │ ├── polyfill │ │ ├── Blob.js │ │ └── typedarray.js │ ├── robots.txt │ └── zip │ │ ├── deflate.js │ │ ├── inflate.js │ │ ├── mime-types.js │ │ ├── zip-ext.js │ │ ├── zip-fs.js │ │ └── zip.js └── views │ ├── about.html │ ├── assetora.html │ ├── contact.html │ ├── content-portal.html │ ├── create.html │ ├── credits.html │ ├── demo-warning.html │ ├── docs │ ├── index.html │ ├── services.budget.deleteBudget.html │ ├── services.budget.postBudgets.html │ ├── services.transaction.getTransaction.html │ ├── services.transaction.postPurchaseRequest.html │ └── services.well-known.payswarm.html │ ├── help │ ├── index.html │ ├── pricing.html │ └── wordpress.html │ ├── hostedAssets.html │ ├── identity.disabled.html │ ├── index.html │ ├── layout.html │ ├── legal.html │ ├── licenses │ └── blogging.html │ ├── purchase.html │ ├── register-public-key.html │ └── system │ └── dashboard.html └── tests ├── address-examples ├── blacksburg.json └── london.json ├── backend ├── 000-money.js ├── 001-schemas.js └── 002-payee.js ├── frontend ├── e2e │ └── adminLogin.js ├── helper.js ├── pages │ ├── dashboard.js │ └── index.js └── selectors │ └── index.js ├── payflow-examples ├── authorize.json ├── capture.json ├── charge-ach.json ├── charge.json ├── inquire.json ├── verify-ach.json ├── verify-cc.jsonld ├── verify.json └── void.json ├── purchase.js └── usaepay-examples └── bankaccount.json /.gitignore: -------------------------------------------------------------------------------- 1 | *.py[co] 2 | *.sw[nop] 3 | *~ 4 | .project 5 | .settings 6 | TAGS 7 | coverage 8 | node_modules 9 | npm-debug.log 10 | reports 11 | site/static/app/main.min.js 12 | site/static/app/templates.min.js 13 | site/static/css/bundle.min.css 14 | -------------------------------------------------------------------------------- /.jshintignore: -------------------------------------------------------------------------------- 1 | lib/rdfa/rdfa.js 2 | minify.js 3 | site/static/app/main.min.js 4 | site/static/app/templates.min.js 5 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true 3 | } 4 | -------------------------------------------------------------------------------- /FAQ.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## How do I setup a local p3 development environment? 4 | 5 | See the [README][] documentation for a QuickStart guide. 6 | 7 | ## What should my mongo database config look like? 8 | 9 | If you choose to use the MongoDB module, a simple config like the following 10 | is fine: 11 | 12 | dbpath=/var/lib/mongodb 13 | logpath=/var/log/mongodb/mongodb.log 14 | logappend=true 15 | journal=true 16 | auth = true 17 | 18 | ## I'm getting an 'auth fails' Mongo error on startup. What's wrong? 19 | 20 | If you are using the MongoDB module, when the system first starts up it will 21 | connect to MongoDB as an administrator and create all of the necessary 22 | databases for p3. If you get an 'auth fails' message, the most likely 23 | culprit is that the admin username and password you're using is wrong, or 24 | you forgot to setup a database admin. 25 | 26 | Check to make sure that the admin username and password is correct by logging 27 | into MongoDB manually: 28 | 29 | > mongo 30 | > use admin 31 | > db.auth('admin', 'password') 32 | 33 | The command above assumes that 'admin' is the username and 'password' is your 34 | password. If it's not, put in whatever your admin username and password is 35 | at the time. The three commands above should return 1 (success). If the 36 | return value is 0, then your admin user isn't configured correctly. Refer to 37 | [README][] to learn how to configure the MongoDB administrator. 38 | 39 | ## How do I clear all p3 data from the MongoDB database? 40 | 41 | Make sure that the p3 process has been halted, then drop the master 42 | p3 database and the local p3 database collection: 43 | 44 | > mongo 45 | > use admin 46 | > db.auth('admin', 'password') 47 | > use payswarm_dev 48 | > db.dropDatabase() 49 | > use local 50 | > db.payswarm_dev.drop() 51 | > exit 52 | 53 | [AUTHORS]: AUTHORS.md 54 | [FEATURES]: FEATURES.md 55 | [HACKING]: HACKING.md 56 | [README]: README.md 57 | [FAQ]: FAQ.md 58 | [LICENSE]: LICENSE.md 59 | -------------------------------------------------------------------------------- /FEATURES.md: -------------------------------------------------------------------------------- 1 | # Basic Features of P3 2 | 3 | This document outlines the basic features of the p3 software platform. 4 | Generally speaking, p3 is a turn-key solution for organizations that 5 | want to process Web Payments. 6 | 7 | It provides a Web Payments as a Service (WPaaS) platform that is typically 8 | operated at banks, financial institutions, retailers, and personal domains. 9 | P3 is capable of processing payments for a single individual on a low-powered 10 | device up to enterprise transaction processing in the tens of millions of 11 | transactions per day range. 12 | 13 | ## Financial Transaction Services 14 | 15 | ### Accounts 16 | 17 | ### Budgets 18 | 19 | ### Transfers and Auditing 20 | 21 | ### Digital Signatures 22 | 23 | ## Identity Services 24 | 25 | ### Address Verification 26 | 27 | ### Credential Storage 28 | 29 | ## Customer Services 30 | 31 | ### Dashboard 32 | 33 | ### Financial Account Management 34 | 35 | ### Budget Management 36 | 37 | ### Transaction History 38 | 39 | ### Email Notification 40 | 41 | ## Payment Gateway Services 42 | 43 | ### Automated Clearing House Services 44 | 45 | ### Bank Account Verification 46 | 47 | ### Deposits and Withdrawals 48 | 49 | ### PayFlow 50 | 51 | ### USA ePay 52 | 53 | ## Retail Services 54 | 55 | ### Hosted Assets 56 | 57 | ### Hosted Offers 58 | 59 | ### External Vendor Registration 60 | 61 | ### Promotional Codes 62 | 63 | ### Digital Receipts 64 | 65 | ## Auditing Services 66 | 67 | ### Real-time Regulatory Reporting 68 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | /* 2 | * PaySwarm Gruntfile. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | */ 6 | module.exports = function(grunt) { 7 | 'use strict'; 8 | 9 | // configure w/bedrock grunt config 10 | var bedrockGrunt = require(__dirname + '/node_modules/bedrock/Gruntfile'); 11 | bedrockGrunt(grunt); 12 | 13 | // update dirs 14 | var dirs = grunt.config.getRaw('dirs'); 15 | dirs.bedrock = __dirname + '/node_modules/bedrock'; 16 | dirs.payswarm = __dirname; 17 | grunt.config('dirs', dirs); 18 | 19 | // read package configuration 20 | grunt.config('pkg', grunt.file.readJSON('package.json')); 21 | 22 | // add templates 23 | var ngtemplates = grunt.config.getRaw('ngtemplates'); 24 | ngtemplates.myapp.src.push('site/static/app/components/**/*.html'); 25 | grunt.config('ngtemplates', ngtemplates); 26 | 27 | // requirejs 28 | var requirejs = grunt.config.getRaw('requirejs'); 29 | var compileOptions = requirejs.compile.options; 30 | compileOptions.paths.payswarm = '<%= dirs.payswarm %>/site/static'; 31 | compileOptions.paths['app/components'] = '<%= dirs.payswarm %>/site/static/app/components'; 32 | compileOptions.paths['app/configs'] = '<%= dirs.payswarm %>/site/static/app/configs'; 33 | compileOptions.paths['app/templates'] = '<%= dirs.payswarm %>/site/static/app/templates.min'; 34 | compileOptions.shim = { 35 | // export app/bootstrap globals 36 | 'FileSaver': {exports: 'saveAs'}, 37 | 'zip': {exports: 'zip'} 38 | }; 39 | grunt.config('requirejs', requirejs); 40 | 41 | // jscs 42 | var jscs = grunt.config.getRaw('jscs'); 43 | jscs.all.options.excludeFiles.push('<%= dirs.payswarm %>/lib/rdfa/*.js'); 44 | grunt.config('jscs', jscs); 45 | }; 46 | -------------------------------------------------------------------------------- /HACKING.md: -------------------------------------------------------------------------------- 1 | # P3 Hacking 2 | 3 | Please refer to the following document for best practices related to 4 | hacking on the p3 code base: 5 | 6 | https://github.com/digitalbazaar/bedrock/blob/master/HACKING.md 7 | 8 | -------------------------------------------------------------------------------- /configs/yahoo-av.example.js: -------------------------------------------------------------------------------- 1 | var config = require('bedrock').config; 2 | 3 | // yahoo address validator config 4 | config.addressValidator.yahoo = {}; 5 | config.addressValidator.yahoo.hashKey = 'YAHOO_AV_HASH_KEY'; 6 | config.addressValidator.yahoo.consumerKey = 'YAHOO_AV_CONSUMER_KEY'; 7 | config.addressValidator.yahoo.consumerSecret = 'YAHOO_AV_CONSUMER_SECRET'; 8 | -------------------------------------------------------------------------------- /email-templates/bedrock.Identity.created-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}Welcome to {{service.name}}! 4 | 5 | {% if productionMode == false %} 6 | ******* 7 | NOTE: This is a demonstration website notification. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | ******* 10 | 11 | {% endif -%} 12 | Hello {{identity.label}}, 13 | 14 | Welcome to {{service.name}}! 15 | 16 | We're so glad you joined! Please let us know if there is anything that we 17 | can do to help you settle into the website. 18 | 19 | {{service.name}} is a demo website for testing out PaySwarm. If you're a 20 | developer, feel free to check out the API documentation here: 21 | 22 | {{baseUri}}/docs 23 | 24 | You can manage your identity, financial accounts, credit/debit cards, bank 25 | accounts, and other settings by going here: 26 | 27 | {{identity.id}}/dashboard 28 | 29 | We'd love to hear any feedback you have about {{service.name}}. 30 | Just send an email to {{comments.email}}. 31 | 32 | If you have any questions or comments please contact {{support.email}}. 33 | -------------------------------------------------------------------------------- /email-templates/common.Deposit.ach-merchant-account-log.tpl: -------------------------------------------------------------------------------- 1 | To: {{service.domain}}-merchant-account-logs@digitalbazaar.com 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} ACH deposit log ({{deposit.id}}) 4 | 5 | Merchant Name: Digital Bazaar, Inc. 6 | Merchant Location: Blacksburg, VA, USA 7 | Merchant Company URL: http://digitalbazaar.com/ 8 | Merchant Service URL: {{baseUri}}/ 9 | Deposit Amount: ${{amount}} {{deposit.currency}} 10 | Transaction Amount: ${{deposit.amount}} {{deposit.currency}} 11 | Transaction Date: {{deposit.created}} 12 | Transaction Payment Type: {{deposit.source.paymentMethod}} 13 | Transaction ID: {{deposit.id}} 14 | Owner: {{deposit.source.owner}} 15 | Bank Routing Number: {{deposit.source.bankRoutingNumber}} 16 | Bank Account Number: {{deposit.source.bankAccount}} 17 | ACH Gateway: {{deposit.source.paymentGateway}} 18 | Authorization Approval Code: {{deposit.sysGatewayApprovalCode}} 19 | Transaction Type: purchase 20 | Transaction Description: {{service.name}} deposit 21 | Return/Refund Policy: {{baseUri}}/legal#tos 22 | -------------------------------------------------------------------------------- /email-templates/common.Deposit.cc-merchant-account-log.tpl: -------------------------------------------------------------------------------- 1 | To: {{service.domain}}-merchant-account-logs@digitalbazaar.com 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} card deposit log ({{deposit.id}}) 4 | 5 | Merchant Name: Digital Bazaar, Inc. 6 | Merchant Location: Blacksburg, VA, USA 7 | Merchant Company URL: http://digitalbazaar.com/ 8 | Merchant Service URL: {{baseUri}}/ 9 | Transaction Amount: ${{deposit.amount}} {{deposit.currency}} 10 | Transaction Date: {{deposit.created}} 11 | Transaction Payment Type: {{deposit.source.paymentMethod}} 12 | Transaction ID: {{deposit.id}} 13 | Owner: {{deposit.source.owner}} 14 | Card Brand: {{deposit.source.cardBrand}} 15 | Card Number: {{deposit.source.cardNumber}} 16 | Card Expiration: {{deposit.source.cardExpMonth}}/{{deposit.source.cardExpYear}} 17 | Payment Gateway: {{deposit.source.paymentGateway}} 18 | Authorization Approval Code: {{deposit.sysGatewayApprovalCode}} 19 | Transaction Type: purchase 20 | Transaction Description: {{service.name}} deposit 21 | Return/Refund Policy: {{baseUri}}/legal#tos 22 | -------------------------------------------------------------------------------- /email-templates/common.Deposit.failure.tpl: -------------------------------------------------------------------------------- 1 | To: {{deposits.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} deposit FAILED: {{deposit.currency}} ${{deposit.amount}} ({{deposit.id}}) 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{deposit.id}} 7 | Date: {{deposit.created}} 8 | Charge: {{deposit.currency}} ${{deposit.amount}} 9 | Requestor: {{identity.id}} 10 | Requestor Email: {{identity.email}} 11 | Requestor Label: {{identity.label}} 12 | 13 | {% if headers %} 14 | ============================== HTTP Headers ================================ 15 | {% for h in headers -%} 16 | {{loop.key}}: {{h}} 17 | {% endfor -%} 18 | {% endif -%} 19 | =============================== Requestor ================================== 20 | {{toJson(identity)}} 21 | ================================ Deposit =================================== 22 | {{toJson(deposit)}} 23 | ================================= Error ==================================== 24 | {{toJson(error)}} 25 | -------------------------------------------------------------------------------- /email-templates/common.Deposit.success-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}{{service.name}} deposit receipt 4 | 5 | {% if productionMode == false %} 6 | *** NOTE *** 7 | This is a demonstration website notification and no real money was involved. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | *** NOTE *** 10 | 11 | {% endif -%} 12 | Your {% if deposit.source.cardNumber %}card{% elseif deposit.source.bankAccount %}bank account{% else %}account{% endif %} has been charged ${{deposit.amount}} {{deposit.currency}}. 13 | 14 | {%- if deposit.source.bankAccount %} 15 | 16 | It will take between 3-7 business days for the money to be transferred from your 17 | bank account to {{service.name}}. 18 | {%- endif %} 19 | 20 | Here is your deposit receipt: 21 | 22 | Transaction ID: {{deposit.id}} 23 | Date and Time: {{deposit.created}} 24 | Source: 25 | From: {{deposit.source.label}} 26 | {% if deposit.source.cardNumber %} Number: {{deposit.source.cardNumber}} 27 | Exp: {{deposit.source.cardExpMonth}}/{{deposit.source.cardExpYear}} 28 | {% elseif deposit.source.bankAccount %} Routing: {{deposit.source.bankRoutingNumber}} 29 | Account: {{deposit.source.bankAccount}} 30 | {% endif %} Charge: ${{deposit.amount}} {{deposit.currency}} 31 | Deposit Details*: 32 | {%- for transfer in deposit.transfer %} 33 | {{transfer.comment}}: ${{transfer.amount}} {{transfer.currency}} 34 | {%- endfor %} 35 | 36 | You can view your latest financial activity on your account activity page. 37 | 38 | {{deposit.transfer[0].destination}}?view=activity 39 | 40 | If you have any questions or comments please contact {{support.email}}. 41 | 42 | * All deposit fees are used to reimburse {{service.name}} for fees charged by banks and the banking and financial networks. 43 | -------------------------------------------------------------------------------- /email-templates/common.Deposit.success.tpl: -------------------------------------------------------------------------------- 1 | To: {{deposits.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} {{stage}} deposit: {{deposit.currency}} ${{deposit.amount}} ({{deposit.id}}) 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{deposit.id}} 7 | Date: {{deposit.created}} 8 | Charge: {{deposit.currency}} ${{deposit.amount}} 9 | Requestor: {{identity.id}} 10 | Requestor Email: {{identity.email}} 11 | Requestor Label: {{identity.label}} 12 | 13 | {% if headers %} 14 | ============================== HTTP Headers ================================ 15 | {% for h in headers -%} 16 | {{loop.key}}: {{h}} 17 | {% endfor -%} 18 | {% endif -%} 19 | =============================== Requestor ================================== 20 | {{toJson(identity)}} 21 | ================================ Deposit =================================== 22 | {{toJson(deposit)}} 23 | -------------------------------------------------------------------------------- /email-templates/common.FinancialAccount.created.tpl: -------------------------------------------------------------------------------- 1 | To: {{registration.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} Account created: {{account.id}}) 4 | 5 | -----BEGIN ACCOUNT----- 6 | {{toJson(account)}} 7 | -----END ACCOUNT----- 8 | -------------------------------------------------------------------------------- /email-templates/common.FinancialAccount.unbackedCreditPayoffFailed-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}A credit line payment failed for an account on {{service.name}} 4 | 5 | {% if productionMode == false %} 6 | ******* 7 | NOTE: This is a demonstration website notification. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | ******* 10 | {% endif %} 11 | Hello {{identity.label}}, 12 | 13 | An attempt to pay off your used credit with your account "{{account.label}}" 14 | has failed on the {{service.name}} website! Please sign into {{service.name}} 15 | and correct your payment information to prevent any problems with future 16 | payments. 17 | 18 | We'd love to hear any feedback you have about {{service.name}}. 19 | Just send an email to {{comments.email}}. 20 | 21 | If you have any questions or comments please contact {{support.email}}. 22 | -------------------------------------------------------------------------------- /email-templates/common.FinancialAccount.unbackedCreditPayoffFailed.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} FinancialAccount intervention required, credit payoff FAILED for {{account.id}} 4 | 5 | Machine: {{machine}} 6 | Account ID: {{account.id}} 7 | Identity ID: {{identity.id}} 8 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.bankAccountCreated-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}Bank account linking started on {{service.name}} 4 | 5 | {% if productionMode == false %} 6 | ******* 7 | NOTE: This is a demonstration website notification. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | ******* 10 | {% endif %} 11 | Hello {{identity.label}}, 12 | 13 | We have begun the verification process for linking your bank account, 14 | which you labeled "{{paymentToken.label}}", with the {{service.name}} website! 15 | In about 3-7 business days, you should see two small deposits appear on your 16 | bank statement for the following bank account: 17 | 18 | Account Number: {{paymentToken.bankAccount}} 19 | Routing Number: {{paymentToken.bankRoutingNumber}} 20 | 21 | The deposits should have the label "DIGITAL BAZAAR CREDIT". You will need to 22 | record the amounts associated with these deposits and enter them into the 23 | {{service.name}} website in order to complete the verification process that will 24 | link your bank account. It may take up to 24 hours after the deposits appear 25 | on your bank statement for the "Verify" link to become available on the 26 | {{service.name}} website. 27 | 28 | You can verify and manage your bank accounts here: 29 | 30 | {{identity.id}}/settings 31 | 32 | We'd love to hear any feedback you have about {{service.name}}. 33 | Just send an email to {{comments.email}}. 34 | 35 | If you have any questions or comments please contact {{support.email}}. 36 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.bankAccountCreated.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} PaymentToken Bank Account created for {{identity.id}} 4 | 5 | -----BEGIN IDENTITY----- 6 | {{toJson(identity)}} 7 | -----END IDENTITY----- 8 | -----BEGIN PAYMENT TOKEN----- 9 | {{toJson(paymentToken)}} 10 | -----END PAYMENT TOKEN----- 11 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.unverified-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}Verify your bank account on {{service.name}} 4 | 5 | {% if productionMode == false %} 6 | ******* 7 | NOTE: This is a demonstration website notification. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | ******* 10 | {% endif %} 11 | Hello {{identity.label}}, 12 | 13 | Your bank account "{{paymentToken.label}}" is ready to be verified on the {{service.name}} website! 14 | {% if verify %} 15 | Because this is a development sandbox and this bank account is not real, the 16 | transaction amounts required to verify the bank account are included below. 17 | On a real system you would get these amounts from your bank. 18 | 19 | Amounts: {{verify[0].amount}}, {{verify[1].amount}} 20 | {% endif %} 21 | You can verify and manage your bank accounts here: 22 | 23 | {{identity.id}}/settings 24 | 25 | We'd love to hear any feedback you have about {{service.name}}. 26 | Just send an email to {{comments.email}}. 27 | 28 | If you have any questions or comments please contact {{support.email}}. 29 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.unverified.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} PaymentToken unverified for {{identity.id}} 4 | 5 | -----BEGIN IDENTITY----- 6 | {{toJson(identity)}} 7 | -----END IDENTITY----- 8 | -----BEGIN PAYMENT TOKEN----- 9 | {{toJson(paymentToken)}} 10 | -----END PAYMENT TOKEN----- 11 | {%- if verify %} 12 | -----VERIFY DATA----- 13 | {{toJson(verify)}} 14 | -----END VERIFY DATA----- 15 | {% endif -%} 16 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.unverifiedLimitReached.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} Unverified PaymentToken limit reached 4 | 5 | Machine: {{machine}} 6 | Token Limit: {{limit}} 7 | 8 | ================================ Error =================================== 9 | {{toJson(error)}} 10 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.verified-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}Your bank account has been verified on {{service.name}} 4 | 5 | {% if productionMode == false %} 6 | ******* 7 | NOTE: This is a demonstration website notification. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | ******* 10 | 11 | {% endif -%} 12 | Hello {{identity.label}}, 13 | 14 | Your bank account "{{paymentToken.label}}" has been verified on {{service.name}}! 15 | 16 | You can manage your bank accounts here: 17 | 18 | {{identity.id}}/settings 19 | 20 | We'd love to hear any feedback you have about {{service.name}}. 21 | Just send an email to {{comments.email}}. 22 | 23 | If you have any questions or comments please contact {{support.email}}. 24 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.verifyBalanceTooLow.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} PaymentToken verify balance too low 4 | 5 | Machine: {{machine}} 6 | Account: {{account}} 7 | {% if balance %}Balance: {{currency}} {{balance}}{% endif %} 8 | -------------------------------------------------------------------------------- /email-templates/common.PaymentToken.verifyFailed.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} PaymentToken intervention required, verify FAILED for {{tokenId}} 4 | 5 | Machine: {{machine}} 6 | Token ID: {{tokenId}} 7 | -------------------------------------------------------------------------------- /email-templates/common.Purchase.success-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}{{service.name}} purchase notification 4 | 5 | {% if productionMode == false %} 6 | ******* 7 | NOTE: This is a demo website notification and no real money was involved. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | ******* 10 | 11 | {% endif -%} 12 | A purchase has just been made using your {{service.name}} account. 13 | 14 | Asset: "{{contract.asset.title}}" by {{contract.asset.creator.name}} 15 | Asset Provider{% if contract.assetProvider.id == contract.vendor.id %} and Vendor{% endif %}: {{contract.assetProvider.label}} ({{contract.assetProvider.url}}) 16 | {% if contract.assetProvider.id != contract.vendor.id -%} 17 | Vendor: {{contract.vendor.label}} ({{contract.vendor.url}}) 18 | {% endif %} 19 | The purchased content is available here: 20 | 21 | {{contract.asset.assetContent}} 22 | 23 | The details of this transaction are located here: 24 | 25 | {{contract.id}} 26 | 27 | If you have any questions or comments about this purchase, please contact: 28 | {{support.email}} 29 | 30 | Digital Bazaar, Inc. 31 | Blacksburg, VA, USA 32 | -------------------------------------------------------------------------------- /email-templates/common.Purchase.success.tpl: -------------------------------------------------------------------------------- 1 | To: {{contracts.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} Purchase for "{{contract.asset.title}}" from {{contract.assetProvider.label}} 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{contract.id}} 7 | Date: {{contract.created}} 8 | Amount: {{contract.currency}} ${{contract.amount}} 9 | Asset ID: {{contract.asset.id}} 10 | Asset Title: {{contract.asset.title}} 11 | Asset Content: {{contract.asset.assetContent}} 12 | Acquirer ID: {{contract.assetAcquirer.id}} 13 | Provider ID: {{contract.assetProvider.id}} 14 | Vendor ID: {{contract.vendor.id}} 15 | 16 | ================================ Contract =================================== 17 | {{toJson(contract)}} 18 | -------------------------------------------------------------------------------- /email-templates/common.Transaction.externalTransactionVoided.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} possible intervention required for {{transactionId}} 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{transactionId}} 7 | 8 | The payment gateway indicated that the external transaction was voided during 9 | a status check. Possible intervention is required to deal with this transaction. 10 | -------------------------------------------------------------------------------- /email-templates/common.Transaction.statusCheckError.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} intervention required for {{transactionId}} 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{transactionId}} 7 | 8 | The payment gateway returned an error during a transaction status check. 9 | Intervention is required to deal with this transaction. 10 | -------------------------------------------------------------------------------- /email-templates/common.Transaction.statusChecksExceeded.tpl: -------------------------------------------------------------------------------- 1 | To: {{notify.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} intervention required for {{transactionId}} 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{transactionId}} 7 | 8 | Too many external status checks have been performed without an adequate 9 | settled/voided response for the transaction with the above ID. Intervention 10 | is required to deal with this transaction. 11 | 12 | A status check is performed via a payment gateway's API to see if a transaction 13 | has been settled or voided by an external monetary system. A limit is placed 14 | on these automated checks to ensure that transactions are finishing in a 15 | timely fashion and to prevent overuse of an external API that may cost money. 16 | 17 | The maximum number of external status checks (with a payment gateway) 18 | has been exceeded for the transaction with the above ID. 19 | -------------------------------------------------------------------------------- /email-templates/common.Withdrawal.ach-merchant-account-log.tpl: -------------------------------------------------------------------------------- 1 | To: {{service.domain}}-merchant-account-logs@digitalbazaar.com 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} ACH withdrawal log ({{withdrawal.id}}) 4 | 5 | Merchant Name: Digital Bazaar, Inc. 6 | Merchant Location: Blacksburg, VA, USA 7 | Merchant Company URL: http://digitalbazaar.com/ 8 | Merchant Service URL: {{baseUri}}/ 9 | Withdrawal Amount: ${{amount}} {{withdrawal.currency}} 10 | Transaction Total: ${{withdrawal.amount}} {{withdrawal.currency}} 11 | Transaction Date: {{withdrawal.created}} 12 | Transaction Payment Type: {{withdrawal.destination.paymentMethod}} 13 | Transaction ID: {{withdrawal.id}} 14 | Owner: {{withdrawal.destination.owner}} 15 | Bank Routing Number: {{withdrawal.destination.bankRoutingNumber}} 16 | Bank Account Number: {{withdrawal.destination.bankAccount}} 17 | ACH Gateway: {{withdrawal.destination.paymentGateway}} 18 | Authorization Approval Code: {{withdrawal.sysGatewayApprovalCode}} 19 | Transaction Type: credit 20 | Transaction Description: {{service.name}} withdrawal 21 | Return/Refund Policy: {{baseUri}}/legal#tos 22 | -------------------------------------------------------------------------------- /email-templates/common.Withdrawal.failure.tpl: -------------------------------------------------------------------------------- 1 | To: {{deposits.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} withdrawal FAILED: {{withdrawal.currency}} ${{withdrawal.amount}} ({{withdrawal.id}}) 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{withdrawal.id}} 7 | Date: {{withdrawal.created}} 8 | Credit: {{withdrawal.currency}} ${{amount}} 9 | Requestor ID: {{identity.id}} 10 | Requestor Email: {{identity.email}} 11 | Requestor Label: {{identity.label}} 12 | 13 | {% if headers %} 14 | ============================== HTTP Headers ================================ 15 | {% for h in headers -%} 16 | {{loop.key}}: {{h}} 17 | {% endfor -%} 18 | {% endif -%} 19 | =============================== Requestor ================================== 20 | {{toJson(identity)}} 21 | =============================== Withdrawal ================================= 22 | {{toJson(withdrawal)}} 23 | ================================= Error ==================================== 24 | {{toJson(error)}} 25 | -------------------------------------------------------------------------------- /email-templates/common.Withdrawal.success-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}{{service.name}} withdrawal receipt 4 | 5 | {% if productionMode == false %} 6 | *** NOTE *** 7 | This is a demonstration website notification and no real money was involved. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | *** NOTE *** 10 | 11 | {% endif -%} 12 | Your {% if withdrawal.destination.bankAccount %}bank account{% else %}account{% endif %} has been credited with ${{amount}} {{withdrawal.currency}}. 13 | 14 | {%- if withdrawal.destination.bankAccount %} 15 | 16 | It will take between 3-7 business days for the money to be transferred from 17 | {{service.name}} to your bank account. 18 | {%- endif %} 19 | 20 | Here is your withdrawal receipt: 21 | 22 | Transaction ID: {{withdrawal.id}} 23 | Date and Time: {{withdrawal.created}} 24 | Source: 25 | From: {{withdrawal.source}} 26 | Destination: 27 | {% if withdrawal.destination.bankAccount %} Routing: {{withdrawal.destination.bankRoutingNumber}} 28 | Account: {{withdrawal.destination.bankAccount}} 29 | {% endif %} Credit: ${{amount}} {{withdrawal.currency}} 30 | Withdrawal Details*: 31 | {%- for transfer in withdrawal.transfer %} 32 | {{transfer.comment}}: ${{transfer.amount}} {{transfer.currency}} 33 | {%- endfor %} 34 | 35 | You can view your latest financial activity on your account activity page. 36 | 37 | {{withdrawal.transfer[0].source}}?view=activity 38 | 39 | If you have any questions or comments please contact {{support.email}}. 40 | 41 | * All withdrawal fees are used to reimburse {{service.name}} for fees charged by banks and the banking and financial networks. 42 | -------------------------------------------------------------------------------- /email-templates/common.Withdrawal.success.tpl: -------------------------------------------------------------------------------- 1 | To: {{withdrawals.email}} 2 | From: "{{service.name}} {{system.name}}" <{{system.email}}> 3 | Subject: {{subject.prefix}}{{service.name}} {{stage}} withdrawal: {{withdrawal.currency}} ${{amount}} ({{withdrawal.id}}) 4 | 5 | Machine: {{machine}} 6 | Transaction ID: {{withdrawal.id}} 7 | Date: {{withdrawal.created}} 8 | Credit: {{withdrawal.currency}} ${{amount}} 9 | Requestor ID: {{identity.id}} 10 | Requestor Email: {{identity.email}} 11 | Requestor Label: {{identity.label}} 12 | 13 | {% if headers %} 14 | ============================== HTTP Headers ================================ 15 | {% for h in headers -%} 16 | {{loop.key}}: {{h}} 17 | {% endfor -%} 18 | {% endif -%} 19 | =============================== Requestor ================================== 20 | {{toJson(identity)}} 21 | =============================== Withdrawal ================================= 22 | {{toJson(withdrawal)}} 23 | -------------------------------------------------------------------------------- /email-templates/hosted.Listing.assetExpired-identity.tpl: -------------------------------------------------------------------------------- 1 | To: {{identity.email}} 2 | From: "{{service.name}} {{support.name}}" <{{support.email}}> 3 | Subject: {{subject.identityPrefix}}{{service.name}} listing asset expired 4 | 5 | {% if productionMode == false %} 6 | *** NOTE *** 7 | This is a demonstration website notification and no real money was involved. 8 | More info is available at https://payswarm.com/wiki/Demo_Warning. 9 | *** NOTE *** 10 | 11 | {% endif -%} 12 | An asset that you have listed for sale has expired. Please log in and change 13 | or remove the listing. 14 | 15 | Asset Title: {{asset.title}} 16 | Asset Creator: {{asset.creator.name}} 17 | Asset Content: {{asset.assetContent}} 18 | Asset Expired: {{asset.listingRestrictions.validUntil}} 19 | Your Listing ID: {{listing.id}} 20 | -------------------------------------------------------------------------------- /email-templates/mapper.js: -------------------------------------------------------------------------------- 1 | module.exports.map = function(mapping) { 2 | var ids = [ 3 | 'bedrock.Identity.created-identity', 4 | 'common.FinancialAccount.created', 5 | 'common.FinancialAccount.unbackedCreditPayoffFailed', 6 | 'common.FinancialAccount.unbackedCreditPayoffFailed-identity', 7 | 'common.Deposit.ach-merchant-account-log', 8 | 'common.Deposit.cc-merchant-account-log', 9 | 'common.Deposit.failure', 10 | 'common.Deposit.success', 11 | 'common.Deposit.success-identity', 12 | 'common.PaymentToken.bankAccountCreated', 13 | 'common.PaymentToken.bankAccountCreated-identity', 14 | 'common.PaymentToken.unverified', 15 | 'common.PaymentToken.unverified-identity', 16 | 'common.PaymentToken.unverifiedLimitReached', 17 | 'common.PaymentToken.verified-identity', 18 | 'common.PaymentToken.verifyBalanceTooLow', 19 | 'common.PaymentToken.verifyFailed', 20 | 'common.Purchase.success', 21 | 'common.Purchase.success-identity', 22 | 'common.Transaction.externalTransactionVoided', 23 | 'common.Transaction.statusCheckError', 24 | 'common.Transaction.statusChecksExceeded', 25 | 'common.Withdrawal.ach-merchant-account-log', 26 | 'common.Withdrawal.failure', 27 | 'common.Withdrawal.success', 28 | 'common.Withdrawal.success-identity', 29 | 'hosted.Listing.assetExpired-identity' 30 | ]; 31 | 32 | ids.forEach(function(id) { 33 | var filename = __dirname + '/' + id + '.tpl'; 34 | mapping[id] = {filename: filename}; 35 | }); 36 | }; 37 | -------------------------------------------------------------------------------- /lib/payswarm-auth/financial.transfer.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 3 | */ 4 | var bedrock = require('bedrock'); 5 | var payswarm = { 6 | config: bedrock.module('config'), 7 | db: bedrock.module('bedrock.database'), 8 | financial: require('./financial'), 9 | identity: bedrock.module('bedrock.identity'), 10 | logger: bedrock.module('loggers').get('app'), 11 | security: require('./security'), 12 | tools: require('./tools') 13 | }; 14 | 15 | // constants 16 | var MODULE_NS = payswarm.financial.namespace; 17 | 18 | // module permissions 19 | var PERMISSIONS = payswarm.config.permission.permissions; 20 | 21 | // sub module API 22 | var api = {}; 23 | module.exports = api; 24 | 25 | /** 26 | * Initializes this module. 27 | * 28 | * @param callback(err) called once the operation completes. 29 | */ 30 | api.init = function(callback) { 31 | callback(); 32 | }; 33 | 34 | /** 35 | * Processes a financial Transaction containing a list of financial 36 | * Transfers. The transaction ID will be generated and assigned by this 37 | * method. 38 | * 39 | * @param actor the Identity performing the action. 40 | * @param transaction the Transaction to process. 41 | * @param options the transfer options. 42 | * @param callback(err) called once the operation completes. 43 | */ 44 | api.processTransfer = function(actor, transaction, options, callback) { 45 | // FIXME: implement me 46 | }; 47 | -------------------------------------------------------------------------------- /lib/payswarm-auth/jsonld.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013-2014 Digital Bazaar, Inc. All rights reserved. 3 | */ 4 | var bedrock = require('bedrock'); 5 | module.exports = bedrock.module('jsonld'); 6 | -------------------------------------------------------------------------------- /lib/payswarm-auth/system.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 3 | */ 4 | var bedrock = require('bedrock'); 5 | var payswarm = { 6 | logger: bedrock.module('loggers').get('app') 7 | }; 8 | 9 | var api = {}; 10 | module.exports = api; 11 | 12 | api.name = 'System'; 13 | api.init = function(app, callback) { 14 | callback(null); 15 | }; 16 | -------------------------------------------------------------------------------- /locales/de.js: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /locales/en.js: -------------------------------------------------------------------------------- 1 | { 2 | "Service Endpoints": "Service Endpoints", 3 | "Identities": "Identities", 4 | "Accounts": "Accounts", 5 | "Budgets": "Budgets", 6 | "Keys": "Keys", 7 | "Validator not found.": "Validator not found." 8 | } -------------------------------------------------------------------------------- /locales/es.js: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /locales/fr.js: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /locales/ja.js: -------------------------------------------------------------------------------- 1 | { 2 | "Service Endpoints": "ウェブサービス 場所", 3 | "Identities": "恒等式", 4 | "Accounts": "金融勘定", 5 | "Budgets": "予算", 6 | "Keys": "キーにアクセスする" 7 | } 8 | -------------------------------------------------------------------------------- /locales/ru.js: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /locales/zh.js: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /payswarm.dev.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 3 | */ 4 | var br = require('bedrock'); 5 | 6 | if(module.parent) { 7 | module.exports = br; 8 | } else { 9 | // load PaySwarm config and dev data 10 | require('./configs/payswarm.dev'); 11 | require('./configs/dev-data'); 12 | br.start(); 13 | } 14 | -------------------------------------------------------------------------------- /pki/README: -------------------------------------------------------------------------------- 1 | PaySwarm Authority PKI 2 | ====================== 3 | 4 | To generate new key-pair on the command line: 5 | 6 | openssl genrsa -out newkey.pem 2048 7 | openssl rsa -in newkey.pem -pubout > newkey.pub 8 | 9 | To convert it to a string for use in JSON config files: 10 | 11 | cat newkey.pem | perl -p -e 's/\n/\\n/' && echo 12 | cat newkey.pub | perl -p -e 's/\n/\\n/' && echo 13 | 14 | To generate a OpenSSH public key to use for remote logins: 15 | 16 | openssl genrsa -out sshkey.pem 2048 17 | chmod go-rwx sshkey.pem 18 | ssh-keygen -y -f sshkey.pem > sshkey.pub 19 | # append sshkey.pub to target machine ~ACCOUNT/.ssh/authorized_keys 20 | -------------------------------------------------------------------------------- /pki/test-payswarm-auth.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIEkTCCA3mgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBkTELMAkGA1UEBhMCVVMx 3 | ETAPBgNVBAgTCFZpcmdpbmlhMRMwEQYDVQQHEwpCbGFja3NidXJnMR0wGwYDVQQK 4 | ExREaWdpdGFsIEJhemFhciwgSW5jLjEnMCUGA1UECxMeVGVzdCBCaXRtdW5rIE5l 5 | dHdvcmsgQXV0aG9yaXR5MRIwEAYDVQQDEwliaXRtdW5rLTEwHhcNMTAwMTIzMDIw 6 | MTI5WhcNMzAwMTE4MDIwMTI5WjCBkTELMAkGA1UEBhMCVVMxETAPBgNVBAgTCFZp 7 | cmdpbmlhMRMwEQYDVQQHEwpCbGFja3NidXJnMR0wGwYDVQQKExREaWdpdGFsIEJh 8 | emFhciwgSW5jLjEnMCUGA1UECxMeVGVzdCBCaXRtdW5rIE5ldHdvcmsgQXV0aG9y 9 | aXR5MRIwEAYDVQQDEwliaXRtdW5rLTEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw 10 | ggEKAoIBAQDsNQTe1VPBnXDhUbYkaQLm3cbhxrgwHTTWNnUSz7z4GDvPr3OAQuRR 11 | r+WzHr5jONyJH8d/xlfiic9WMMq3o9lmh1dqMcq2qgOuutdtbbTET6VettergS+2 12 | h8g/BC5/9u6wEAaazHE35H1dbI1uWSE7DFX9B3DLzOldSqrR69uwe0jtD5mq8+MH 13 | uW+3neLgiWkHnKl63pHAPvPrwmVuHLBmG6/1x/LJ8uuoAY5plqLSszdSH7P/7uK5 14 | njgfS94Z+N7XVbNWItvlpz6+hV7aAuj23uEsAmN758RKRfdf2794+8oD8Io6ZTDB 15 | Uq9o9ee4144WNkW6QhZjtdDzMxuC+JgpAgMBAAGjgfEwge4wHQYDVR0OBBYEFGMP 16 | WR61Bu3eO/3GxyTDNntGWo0hMIG+BgNVHSMEgbYwgbOAFGMPWR61Bu3eO/3GxyTD 17 | NntGWo0hoYGXpIGUMIGRMQswCQYDVQQGEwJVUzERMA8GA1UECBMIVmlyZ2luaWEx 18 | EzARBgNVBAcTCkJsYWNrc2J1cmcxHTAbBgNVBAoTFERpZ2l0YWwgQmF6YWFyLCBJ 19 | bmMuMScwJQYDVQQLEx5UZXN0IEJpdG11bmsgTmV0d29yayBBdXRob3JpdHkxEjAQ 20 | BgNVBAMTCWJpdG11bmstMYIBADAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBBQUA 21 | A4IBAQBWzU0fp/pvT7REa3u7UO/SH1XvlB2xswm/JHPkjF+l9C2Bu7uzX71XcyYE 22 | mHcYufKhMxGh1BEkXlJeZBMWVv+7djHmPrOn25ig+g2to1nTGzaFUbygJVxZHvU0 23 | EKmoKMeOPRpMyejerZjx9q9uorVaeX10cIFvlVw7Kaa8O6LguxdE0xRPQLA8BMhf 24 | 99kAxkj9CiN/WQ2Do/8zrqs8ernTaJlFHrBKGyhXavDxGcYM6keRNiXrwvqro5/4 25 | AIZiyUGqCPQwjbkpdTnfv/STK8kxcDoEj3A7wX9Q8udg2kfwqLeAWMQxODlVStB/ 26 | k3pTlRDZu3tgvePFHYEYDip6lkzD 27 | -----END CERTIFICATE----- 28 | -------------------------------------------------------------------------------- /pki/test-payswarm-auth.key: -------------------------------------------------------------------------------- 1 | -----BEGIN PRIVATE KEY----- 2 | MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDsNQTe1VPBnXDh 3 | UbYkaQLm3cbhxrgwHTTWNnUSz7z4GDvPr3OAQuRRr+WzHr5jONyJH8d/xlfiic9W 4 | MMq3o9lmh1dqMcq2qgOuutdtbbTET6VettergS+2h8g/BC5/9u6wEAaazHE35H1d 5 | bI1uWSE7DFX9B3DLzOldSqrR69uwe0jtD5mq8+MHuW+3neLgiWkHnKl63pHAPvPr 6 | wmVuHLBmG6/1x/LJ8uuoAY5plqLSszdSH7P/7uK5njgfS94Z+N7XVbNWItvlpz6+ 7 | hV7aAuj23uEsAmN758RKRfdf2794+8oD8Io6ZTDBUq9o9ee4144WNkW6QhZjtdDz 8 | MxuC+JgpAgMBAAECggEAcMoIX1dCPUuuoQjhjpVOO2tfEmRPgzoPBtLOKINl2pnH 9 | xa4j2vUWDSOO7W8avkpilF/GZW8SfCwOAzwdMH9eyiSKSz0nbP3V8FNrlucx0COv 10 | 9YAdj9mKLQC9T8nxYk1JQG0GmlhRH71NV5UEG9MXmRiU3tP0unxIWrHSy5ZyOtxY 11 | 5uDDR41jG0wnfoFR4W00AoDh+5foScWI82phlTdgtdeOoFznkkQfU1uu0Xz6gfH9 12 | gvkAD7Ezi5upW06E7gve/7FiSfIkBO0C1ApqdM47Ej6CSYcMBslCpEvz3WukyO9i 13 | dfMVwjGPDUy4U1e+rlX3ZA2C+UGdTCCKnUvuxemEWQKBgQD3tTaNb7WI/qCD+kbH 14 | TH6+UOZcIBQBhfJS6iChmH4w75uu0u7YviDajTBDkbpl8ShAJakwjeRTzwc77AXf 15 | Zd/IezFo1Z+Glz26mgpEO2Na3Z16mnxDeh9la1dbSP1BeOy9JCbspra47KHfzgRj 16 | 2cxplapYY4PEDXtAQRdWhhQGVwKBgQD0HT9mkvcxRlesz1jWvdn3Ad35OQG7yIKh 17 | bIo2oFLYbIBT7FqASuk0XewGVIyCyKuLbcm/5MEFn/lSsVod8sUyNbkcSark8mPC 18 | VpnG12xDs5NU/xlHeJGyad1Qmt+WMYAPdvNBruloDUTMh2Q4vbYAmyRi85dYZHsB 19 | Rt/OVMxFfwKBgFeb3PZ7Gv6f6A+lliDo+i6/mCnfIpRDVqhirDXbJE6UgEB91AIO 20 | hLonk3lickWZ3H2LlGJa3PWTVGCqIo2Xj2VtxNTqMSi+FxQHZTgqtQIvPYJeXzLS 21 | X4ZUR6o+j2v3o+tlfOrYL+oJr1rjl4PlRTnWuE/YqoLNrdjU7LcqZqyzAoGAC0OO 22 | OV1uqodkZETtBHueIxei9mz69385B9nKRtr+952KDlVJl8HdIN10lpYwJZi80aIv 23 | PPuBLJFFH9uvHNKm5roz4GpFyGqmz8DPN62ZAUa39aQPtoyJrIHWBHIg/v0pu4zx 24 | jIZVnsd99TIKHdQjIcQG2coDocCBLH3otcyT4GECgYB2LyBZgL9HF5XdbkqGI8t4 25 | NUi7InDfC5xvjD8mCI180sl95zz6jgG3Z6B56p4YkjmF3Cc7ji8f5Y2HHZBKiKp9 26 | 5gNAqa5wwE3dlInhi9IWoe2xSJXqq2TXe7WCyl5P25DgQ//qYye6PLcly/SXy4U9 27 | YdLWowtQZT9fdpU9k9e42A== 28 | -----END PRIVATE KEY----- 29 | -------------------------------------------------------------------------------- /protractor.conf.js: -------------------------------------------------------------------------------- 1 | // ensure local helper is loaded 2 | require(__dirname + '/tests/frontend/helper'); 3 | 4 | var config = require( 5 | __dirname + '/node_modules/bedrock/protractor.conf').config; 6 | exports.config = config; 7 | 8 | var bedrockSuites = config.suites; 9 | config.suites = { 10 | unit: bedrockSuites.unit, 11 | e2e: [bedrockSuites.e2e, __dirname + '/tests/frontend/e2e/**/*js'] 12 | }; 13 | -------------------------------------------------------------------------------- /schemas/allowBudget.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: false, 6 | title: 'Allow Budget', 7 | description: 'A flag to indicate whether a budget can be used in a purchase.', 8 | type: 'boolean', 9 | errors: { 10 | invalid: 'Please enter a valid preference (true/false) for allowing a budget.' 11 | } 12 | }; 13 | 14 | module.exports = function(extend) { 15 | if(extend) { 16 | return tools.extend(true, tools.clone(schema), extend); 17 | } 18 | return schema; 19 | }; 20 | -------------------------------------------------------------------------------- /schemas/asset.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var payee = require('./payee'); 6 | var payeeRule = require('./payeeRule'); 7 | var vendor = require('./vendor'); 8 | 9 | var schema = { 10 | required: true, 11 | title: 'Asset', 12 | description: 'PaySwarm Asset.', 13 | type: 'object', 14 | properties: { 15 | '@context': schemas.jsonldContext(), 16 | // allow up to 4 additional custom types 17 | type: schemas.jsonldType('Asset', 4), 18 | creator: { 19 | required: false, 20 | type: [schemas.url(), {type: 'object'}] 21 | }, 22 | created: schemas.w3cDateTime(), 23 | title: schemas.title({required: false}), 24 | assetContent: schemas.url({required: false}), 25 | assetProvider: schemas.url(), 26 | listingRestrictions: { 27 | title: 'Listing Restrictions', 28 | description: 'Restrictions on the listing of this Asset for sale.', 29 | required: false, 30 | type: 'object', 31 | properties: { 32 | payee: payee({required: false}), 33 | payeeRule: payeeRule({required: false}), 34 | vendor: vendor({required: false}), 35 | validFrom: schemas.w3cDateTime({required: false}), 36 | validUntil: schemas.w3cDateTime({required: false}) 37 | } 38 | }, 39 | // FIXME: is sysPublished desirable? 40 | sysPublished: schemas.w3cDateTime({required: false})//, 41 | // Meritora custom asset properties 42 | // FIXME: need semantic type-based validation 43 | // FIXME: this is currently a hack to allow these to pass through 44 | // 45 | }, 46 | additionalProperties: false 47 | }; 48 | 49 | module.exports = function(extend) { 50 | if(extend) { 51 | return tools.extend(true, tools.clone(schema), extend); 52 | } 53 | return schema; 54 | }; 55 | -------------------------------------------------------------------------------- /schemas/bankAccount.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var address = require('./address'); 6 | 7 | var schema = { 8 | required: true, 9 | title: 'BankAccount', 10 | description: 'A bank account.', 11 | type: 'object', 12 | properties: { 13 | '@context': schemas.jsonldContext(), 14 | type: schemas.jsonldType('BankAccount'), 15 | bankAccount: { 16 | required: true, 17 | type: 'string', 18 | pattern: '^[0-9]+$', 19 | minLength: 5, 20 | maxLength: 30, 21 | errors: { 22 | invalid: 'The bank account number is invalid.', 23 | missing: 'Please enter a bank account number.', 24 | mask: true 25 | } 26 | }, 27 | bankAccountType: { 28 | required: true, 29 | type: 'string', 30 | enum: ['Checking', 'Savings'] 31 | }, 32 | bankRoutingNumber: { 33 | required: true, 34 | type: 'string', 35 | pattern: '^[0-9]+$', 36 | minLength: 9, 37 | maxLength: 9, 38 | errors: { 39 | invalid: 'The bank routing number in invalid.', 40 | missing: 'Please enter a bank account routing number.', 41 | mask: true 42 | } 43 | }, 44 | address: address() 45 | }, 46 | additionalProperties: false 47 | }; 48 | 49 | module.exports = function(extend) { 50 | if(extend) { 51 | return tools.extend(true, tools.clone(schema), extend); 52 | } 53 | return schema; 54 | }; 55 | -------------------------------------------------------------------------------- /schemas/currency.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: true, 6 | title: 'Currency', 7 | description: 'A currency code or identifier.', 8 | type: 'string', 9 | enum: ['USD'], 10 | errors: { 11 | invalid: 'Please enter a valid currency.', 12 | missing: 'Please enter a currency.' 13 | } 14 | }; 15 | 16 | module.exports = function(extend) { 17 | if(extend) { 18 | return tools.extend(true, tools.clone(schema), extend); 19 | } 20 | return schema; 21 | }; 22 | -------------------------------------------------------------------------------- /schemas/deposit.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var currency = require('./currency'); 6 | var depositAmount = require('./depositAmount'); 7 | var ipv4Address = require('./ipv4Address'); 8 | var payee = require('./payee'); 9 | var paymentToken = require('./paymentToken'); 10 | var transfer = require('./transfer'); 11 | 12 | var unsignedDeposit = { 13 | required: true, 14 | title: 'Unsigned Deposit', 15 | description: 'A Deposit that has not been digitally-signed.', 16 | type: 'object', 17 | properties: { 18 | '@context': schemas.jsonldContext(), 19 | type: schemas.jsonldType(['Transaction', 'Deposit']), 20 | payee: payee(), 21 | source: schemas.url() 22 | }, 23 | additionalProperties: false 24 | }; 25 | 26 | var signedDeposit = { 27 | required: true, 28 | title: 'Signed Deposit', 29 | description: 'A digitally-signed Deposit.', 30 | type: 'object', 31 | properties: { 32 | '@context': schemas.jsonldContext(), 33 | id: schemas.url(), 34 | type: schemas.jsonldType(['Transaction', 'Deposit']), 35 | payee: payee(), 36 | source: paymentToken(), 37 | transfer: { 38 | required: true, 39 | type: 'array', 40 | items: transfer() 41 | }, 42 | created: schemas.w3cDateTime(), 43 | currency: currency(), 44 | amount: depositAmount(), 45 | ipv4Address: ipv4Address(), 46 | signature: schemas.graphSignature() 47 | }, 48 | additionalProperties: false 49 | }; 50 | 51 | var deposit = { 52 | required: true, 53 | title: 'Deposit', 54 | description: 'A Deposit.', 55 | type: [unsignedDeposit, signedDeposit] 56 | }; 57 | 58 | module.exports = function(type, extend) { 59 | var schema = deposit; 60 | if(type === 'unsigned') { 61 | schema = unsignedDeposit; 62 | } else if(type === 'signed') { 63 | schema = signedDeposit; 64 | } 65 | 66 | if(extend) { 67 | return tools.extend(true, tools.clone(schema), extend); 68 | } 69 | return schema; 70 | }; 71 | -------------------------------------------------------------------------------- /schemas/depositAmount.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: true, 6 | title: 'Deposit Amount', 7 | description: 'An amount to be deposited.', 8 | type: 'string', 9 | pattern: '^([0-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,10})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,10})?)$', 10 | errors: { 11 | invalid: 'The deposit amount is invalid.', 12 | missing: 'Please deposit a minimum of USD $1.00.' 13 | } 14 | }; 15 | 16 | module.exports = function(extend) { 17 | if(extend) { 18 | return tools.extend(true, tools.clone(schema), extend); 19 | } 20 | return schema; 21 | }; 22 | -------------------------------------------------------------------------------- /schemas/invoice.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var asset = require('./asset'); 6 | var currency = require('./currency'); 7 | var money = require('./money'); 8 | 9 | var invoiceItem = { 10 | required: true, 11 | title: 'Invoice Item', 12 | description: 'An item that is part of an Invoice.', 13 | type: 'object', 14 | properties: { 15 | type: schemas.jsonldType('InvoiceItem'), 16 | title: schemas.title(), 17 | // allow negative values for discounts, etc 18 | amount: money.precise(), 19 | currency: currency(), 20 | comment: schemas.comment({ 21 | minLength: 0 22 | }) 23 | }, 24 | additionalProperties: false 25 | }; 26 | 27 | var schema = { 28 | required: true, 29 | title: 'Invoice', 30 | description: 'An invoice asset.', 31 | type: asset({ 32 | properties: { 33 | type: schemas.jsonldType('Invoice', 4), 34 | invoiceItem: { 35 | required: true, 36 | type: 'array', 37 | items: invoiceItem, 38 | minItems: 1 39 | } 40 | } 41 | }), 42 | additionalProperties: false 43 | }; 44 | 45 | module.exports = function(extend) { 46 | if(extend) { 47 | return tools.extend(true, tools.clone(schema), extend); 48 | } 49 | return schema; 50 | }; 51 | -------------------------------------------------------------------------------- /schemas/ipv4Address.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: true, 6 | title: 'IPv4 Address', 7 | description: 'A numeric IPv4 address in dot-notation.', 8 | type: 'string', 9 | pattern: '^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$', 10 | errors: { 11 | invalid: 'The IPv4 address must be of the in numeric dot-notation, for example: "nnn.nnn.nnn.nnn".', 12 | missing: 'The IPv4 address of the requesting client is missing.' 13 | } 14 | }; 15 | 16 | module.exports = function(extend) { 17 | if(extend) { 18 | return tools.extend(true, tools.clone(schema), extend); 19 | } 20 | return schema; 21 | }; 22 | -------------------------------------------------------------------------------- /schemas/payeeRule.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var money = require('./money'); 6 | 7 | var schema = { 8 | required: true, 9 | title: 'PayeeRule', 10 | description: 'A Payee rule.', 11 | type: 'array', 12 | items: { 13 | type: 'object', 14 | properties: { 15 | id: schemas.url({required: false}), 16 | type: schemas.jsonldType('PayeeRule'), 17 | payeeGroupPrefix: { 18 | required: false, 19 | type: 'array', 20 | items: { 21 | type: 'string' 22 | } 23 | }, 24 | maximumPayeeRate: money.precisePositive({required: false}), 25 | minimumPayeeRate: money.precisePositive({required: false}), 26 | payeeGroup: { 27 | required: false, 28 | type: [{ 29 | type: 'string' 30 | }, { 31 | type: 'array', 32 | uniqueItems: true, 33 | items: { 34 | type: 'string' 35 | } 36 | }] 37 | }, 38 | payeeRateType: { 39 | required: false, 40 | type: 'string', 41 | enum: ['FlatAmount', 'Percentage'] 42 | }, 43 | payeeApplyType: { 44 | required: false, 45 | type: 'string', 46 | enum: ['ApplyExclusively', 'ApplyInclusively'] 47 | } 48 | }, 49 | additionalProperties: false 50 | } 51 | }; 52 | 53 | module.exports = function(extend) { 54 | if(extend) { 55 | return tools.extend(true, tools.clone(schema), extend); 56 | } 57 | return schema; 58 | }; 59 | -------------------------------------------------------------------------------- /schemas/paymentToken.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var schema = { 6 | required: true, 7 | title: 'Payment Token', 8 | description: 'A tokenized source of monetary funds.', 9 | type: [{ 10 | type: 'object', 11 | properties: { 12 | id: schemas.url(), 13 | type: schemas.jsonldType('PaymentToken'), 14 | owner: schemas.url(), 15 | paymentToken: { 16 | required: true, 17 | type: 'string' 18 | }, 19 | paymentGateway: { 20 | required: true, 21 | type: 'string', 22 | minLength: 1, 23 | errorMessage: 'Gateway too short; 1 character minimum.' 24 | }, 25 | paymentMethod: { 26 | required: true, 27 | type: 'string', 28 | enum: ['CreditCard', 'BankAccount'] 29 | } 30 | } 31 | }], 32 | additionalProperties: false 33 | }; 34 | 35 | module.exports = function(extend) { 36 | if(extend) { 37 | return tools.extend(true, tools.clone(schema), extend); 38 | } 39 | return schema; 40 | }; 41 | -------------------------------------------------------------------------------- /schemas/promo.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var currency = require('./currency'); 6 | var money = require('./money'); 7 | 8 | var schema = { 9 | required: true, 10 | title: 'Promotion', 11 | description: 'A promotion description.', 12 | type: 'object', 13 | properties: { 14 | promoCode: { 15 | title: 'Promotional Code', 16 | description: 'The promotional code.', 17 | required: true, 18 | type: 'string', 19 | minLength: 1, 20 | maxLength: 50, 21 | errors: { 22 | invalid: 'The promo code is invalid.', 23 | missing: 'Please enter a promo code.' 24 | } 25 | }, 26 | expires: schemas.w3cDateTime(), 27 | redeemable: { 28 | title: 'Redeemable', 29 | description: 'The number of times the promotional code can be redeemed.', 30 | required: true, 31 | type: 'integer', 32 | minimum: 1 33 | }, 34 | deposit: { 35 | title: 'Promotional Deposits', 36 | description: 'The amounts and comments for deposits that occur when the promotional code is redeemed', 37 | required: true, 38 | type: 'array', 39 | items: { 40 | type: 'object', 41 | properties: { 42 | amount: money.precisePositive(), 43 | currency: currency(), 44 | comment: { 45 | title: 'Deposit Comment', 46 | description: 'The comment that will appear in the deposit when the promotional code is redeemed.', 47 | required: false, 48 | type: 'string' 49 | } 50 | } 51 | } 52 | }, 53 | email: schemas.email({required: false}), 54 | description: { 55 | title: 'Promotion Description', 56 | description: 'A description of the Promotion', 57 | required: false, 58 | type: 'string' 59 | } 60 | } 61 | }; 62 | 63 | module.exports = function(extend) { 64 | if(extend) { 65 | return tools.extend(true, tools.clone(schema), extend); 66 | } 67 | return schema; 68 | }; 69 | -------------------------------------------------------------------------------- /schemas/receipt.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var schema = { 6 | required: true, 7 | title: 'Receipt', 8 | description: 'A financial Receipt.', 9 | type: 'object', 10 | properties: { 11 | '@context': schemas.jsonldContext(), 12 | type: schemas.jsonldType('Receipt'), 13 | preferences: { 14 | required: false, 15 | title: 'Purchase Preferences', 16 | type: 'array', 17 | items: { 18 | type: 'string', 19 | enum: ['PreAuthorization'] 20 | } 21 | }, 22 | contract: { 23 | required: true, 24 | title: 'Contract in Receipt', 25 | description: 'The short-form Contract that appears in a Receipt.', 26 | type: 'object', 27 | properties: { 28 | type: schemas.jsonldType(['Transaction', 'Contract']), 29 | id: schemas.url(), 30 | asset: { 31 | required: true, 32 | type: [schemas.url(), { 33 | required: true, 34 | type: 'object', 35 | properties: { 36 | id: schemas.url(), 37 | type: schemas.jsonldType('Asset'), 38 | assetContent: schemas.url() 39 | }, 40 | additionalProperties: false 41 | }] 42 | }, 43 | license: schemas.url(), 44 | listing: schemas.url(), 45 | assetProvider: schemas.url(), 46 | assetAcquirer: schemas.url(), 47 | vendor: schemas.url() 48 | }, 49 | additionalProperties: false 50 | }, 51 | signature: schemas.graphSignature() 52 | }, 53 | additionalProperties: false 54 | }; 55 | 56 | module.exports = function(extend) { 57 | if(extend) { 58 | return tools.extend(true, tools.clone(schema), extend); 59 | } 60 | return schema; 61 | }; 62 | -------------------------------------------------------------------------------- /schemas/referenceId.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | title: 'PaySwarm Transaction Reference ID', 6 | required: true, 7 | type: 'string', 8 | // do not start with 'payswarm', 1-128 chars in length 9 | pattern: "^(?!payswarm).{1,128}$" 10 | }; 11 | 12 | module.exports = function(extend) { 13 | if(extend) { 14 | return tools.extend(true, tools.clone(schema), extend); 15 | } 16 | return schema; 17 | }; 18 | -------------------------------------------------------------------------------- /schemas/refreshInterval.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: true, 6 | title: 'Refresh interval', 7 | description: 'The interval on which a budget refills to its original amount.', 8 | type: 'string', 9 | pattern: '^([2-9][0-9]{3}-(0[1-9]|1[0-2])-([0-2][0-9]|3[0-1])T([0-1][0-9]|2[0-3]):([0-5][0-9]):(([0-5][0-9])|60)(\\.[0-9]+)?(Z|((\\+|-)([0-1][0-9]|2[0-3]):([0-5][0-9])))?)|(R(\\d+)?\\/[2-9][0-9]{3}-(0[1-9]|1[0-2])-([0-2][0-9]|3[0-1])T([0-1][0-9]|2[0-3]):([0-5][0-9]):(([0-5][0-9])|60)(\\.[0-9]+)?(Z|((\\+|-)([0-1][0-9]|2[0-3]):([0-5][0-9])))?\\/P((\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?)$', 10 | errors: { 11 | invalid: 'Please enter a valid refresh interval.', 12 | missing: 'Please enter a refresh interval.' 13 | } 14 | }; 15 | 16 | module.exports = function(extend) { 17 | if(extend) { 18 | return tools.extend(true, tools.clone(schema), extend); 19 | } 20 | return schema; 21 | }; 22 | -------------------------------------------------------------------------------- /schemas/regulatoryAddress.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var address = require('./address'); 5 | 6 | var schema = address({ 7 | title: 'Regulatory Address', 8 | description: 'An address to identify applicable regulations.', 9 | properties: { 10 | addressLocality: { 11 | required: false 12 | } 13 | } 14 | }); 15 | delete schema.properties.label; 16 | delete schema.properties.name; 17 | delete schema.properties.streetAddress; 18 | delete schema.properties.postalCode; 19 | 20 | module.exports = function(extend) { 21 | if(extend) { 22 | return tools.extend(true, tools.clone(schema), extend); 23 | } 24 | return schema; 25 | }; 26 | -------------------------------------------------------------------------------- /schemas/resourceHash.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | title: 'PaySwarm Resource Hash', 6 | required: true, 7 | type: 'string', 8 | pattern: "^urn:sha256:[a-f0-9]{64}$" 9 | }; 10 | 11 | module.exports = function(extend) { 12 | if(extend) { 13 | return tools.extend(true, tools.clone(schema), extend); 14 | } 15 | return schema; 16 | }; 17 | -------------------------------------------------------------------------------- /schemas/resources.asset.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var payee = require('./payee'); 6 | var payeeRule = require('./payeeRule'); 7 | var vendor = require('./vendor'); 8 | 9 | var schema = { 10 | required: true, 11 | title: 'Asset', 12 | description: 'An Asset.', 13 | type: 'object', 14 | properties: { 15 | '@context': schemas.jsonldContext(), 16 | id: schemas.url(), 17 | // allow up to 4 additional custom types 18 | type: schemas.jsonldType('Asset', 4), 19 | creator: { 20 | required: false, 21 | type: [schemas.url(), {type: 'object'}] 22 | }, 23 | title: schemas.title({required: false}), 24 | assetContent: schemas.url({required: false}), 25 | assetProvider: schemas.url(), 26 | listingRestrictions: { 27 | required: false, 28 | title: 'Listing Restrictions', 29 | description: 'Restrictions on the listing of this Asset for sale.', 30 | type: 'object', 31 | properties: { 32 | payee: payee({required: false}), 33 | payeeRule: payeeRule({required: false}), 34 | vendor: vendor({required: false}), 35 | validFrom: schemas.w3cDateTime({required: false}), 36 | validUntil: schemas.w3cDateTime({required: false}) 37 | } 38 | }, 39 | signature: schemas.graphSignature() 40 | } 41 | }; 42 | 43 | module.exports = function(extend) { 44 | if(extend) { 45 | return tools.extend(true, tools.clone(schema), extend); 46 | } 47 | return schema; 48 | }; 49 | -------------------------------------------------------------------------------- /schemas/resources.license.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var schema = { 6 | required: true, 7 | title: 'License', 8 | description: 'A License.', 9 | type: 'object', 10 | properties: { 11 | '@context': schemas.jsonldContext(), 12 | id: schemas.url(), 13 | type: schemas.jsonldType('License'), 14 | licenseTemplate: { 15 | required: true, 16 | type: 'string' 17 | } 18 | } 19 | }; 20 | 21 | module.exports = function(extend) { 22 | if(extend) { 23 | return tools.extend(true, tools.clone(schema), extend); 24 | } 25 | return schema; 26 | }; 27 | -------------------------------------------------------------------------------- /schemas/resources.listing.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var payee = require('./payee'); 6 | var payeeRule = require('./payeeRule'); 7 | var vendor = require('./vendor'); 8 | 9 | var schema = { 10 | required: true, 11 | title: 'Listing', 12 | description: 'A Listing.', 13 | type: 'object', 14 | properties: { 15 | '@context': schemas.jsonldContext(), 16 | id: schemas.url(), 17 | // allow up to 4 additional custom types 18 | type: schemas.jsonldType('Listing', 4), 19 | vendor: vendor(), 20 | payee: payee(), 21 | payeeRule: payeeRule({required: false}), 22 | asset: schemas.url(), 23 | assetHash: { 24 | required: true, 25 | type: 'string' 26 | }, 27 | license: schemas.url(), 28 | licenseHash: { 29 | required: true, 30 | type: 'string' 31 | }, 32 | validFrom: schemas.w3cDateTime(), 33 | validUntil: schemas.w3cDateTime(), 34 | signature: schemas.graphSignature() 35 | }, 36 | additionalProperties: false 37 | }; 38 | 39 | module.exports = function(extend) { 40 | if(extend) { 41 | return tools.extend(true, tools.clone(schema), extend); 42 | } 43 | return schema; 44 | }; 45 | -------------------------------------------------------------------------------- /schemas/services.address.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.module('validation').schemas; 3 | 4 | var address = require('./address'); 5 | var validatedAddress = require('./validatedAddress'); 6 | 7 | var postAddress = { 8 | type: 'object', 9 | properties: { 10 | '@context': schemas.jsonldContext(), 11 | id: schemas.identifier(), 12 | label: schemas.label({required: false}) 13 | }, 14 | additionalProperties: false 15 | }; 16 | 17 | var postAddressesQuery = { 18 | type: 'object', 19 | properties: { 20 | action: { 21 | required: false, 22 | type: 'string', 23 | enum: ['validate'] 24 | } 25 | }, 26 | additionalProperties: true 27 | }; 28 | 29 | var postAddresses = { 30 | type: [address(), validatedAddress()] 31 | }; 32 | 33 | var validateAddress = { 34 | type: [address(), validatedAddress()] 35 | }; 36 | 37 | module.exports.postAddress = function() { 38 | return postAddress; 39 | }; 40 | module.exports.postAddressesQuery = function() { 41 | return postAddressesQuery; 42 | }; 43 | module.exports.postAddresses = function() { 44 | return postAddresses; 45 | }; 46 | module.exports.validateAddress = function() { 47 | return validateAddress; 48 | }; 49 | -------------------------------------------------------------------------------- /schemas/services.identityPreferences.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | 4 | var postPreferences = { 5 | title: 'Post Preferences', 6 | type: 'object', 7 | properties: { 8 | '@context': schemas.jsonldContext(), 9 | type: schemas.jsonldType('IdentityPreferences'), 10 | destination: schemas.url({required: false}), 11 | source: schemas.url({required: false}), 12 | publicKey: { 13 | required: false, 14 | type: [{ 15 | // IRI only 16 | type: 'string' 17 | }, { 18 | // label+pem 19 | type: 'object', 20 | properties: { 21 | label: schemas.label(), 22 | publicKeyPem: schemas.publicKeyPem() 23 | } 24 | }] 25 | } 26 | }, 27 | additionalProperties: false 28 | }; 29 | 30 | module.exports.postPreferences = function() { 31 | return postPreferences; 32 | }; 33 | -------------------------------------------------------------------------------- /schemas/services.license.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | 4 | var cacheLicense = { 5 | title: 'Cache License', 6 | type: 'object', 7 | properties: { 8 | '@context': schemas.jsonldContext(), 9 | license: schemas.url(), 10 | licenseHash: { 11 | required: false, 12 | type: 'string' 13 | }, 14 | signature: schemas.graphSignature({required: false}) 15 | }, 16 | additionalProperties: false 17 | }; 18 | 19 | module.exports.cacheLicense = function() { 20 | return cacheLicense; 21 | }; 22 | -------------------------------------------------------------------------------- /schemas/services.payswarm.identifier.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | 4 | var postFinancialAccountIdentifier = { 5 | type: 'object', 6 | properties: { 7 | owner: schemas.url(), 8 | sysSlug: schemas.slug() 9 | }, 10 | additionalProperties: false 11 | }; 12 | 13 | module.exports.postFinancialAccountIdentifier = function() { 14 | return postFinancialAccountIdentifier; 15 | }; 16 | -------------------------------------------------------------------------------- /schemas/services.promo.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | 4 | var postPromosQuery = { 5 | title: 'Post Promotions Query', 6 | type: 'object', 7 | properties: { 8 | action: { 9 | required: false, 10 | type: 'string', 11 | enum: ['redeem'] 12 | } 13 | }, 14 | additionalProperties: false 15 | }; 16 | 17 | var redeemCode = { 18 | title: 'Redeem Promotional Code', 19 | type: 'object', 20 | properties: { 21 | promoCode: { 22 | required: true, 23 | type: 'string' 24 | }, 25 | account: schemas.url() 26 | }, 27 | additionalProperties: false 28 | }; 29 | 30 | module.exports.postPromosQuery = function() { 31 | return postPromosQuery; 32 | }; 33 | module.exports.redeemCode = function() { 34 | return redeemCode; 35 | }; 36 | -------------------------------------------------------------------------------- /schemas/services.test.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | 4 | var postProfileCreate = { 5 | title: 'Create test profile', 6 | description: 'Create a test profile.', 7 | type: 'object', 8 | properties: { 9 | '@context': schemas.jsonldContext(), 10 | sysSlug: schemas.slug({required: false}), 11 | email: schemas.email(), 12 | sysPassword: schemas.password(), 13 | label: schemas.label({required: false}), 14 | sysPublicKey: { 15 | required: false, 16 | type: 'object', 17 | properties: { 18 | label: schemas.label(), 19 | publicKeyPem: schemas.publicKeyPem() 20 | } 21 | }, 22 | sysIdentity: { 23 | required: true, 24 | type: 'object', 25 | properties: { 26 | type: { 27 | required: true, 28 | type: 'string', 29 | enum: ['PersonalIdentity', 'VendorIdentity'] 30 | }, 31 | sysSlug: schemas.slug(), 32 | label: schemas.label() 33 | } 34 | }, 35 | account: { 36 | required: true, 37 | type: 'object', 38 | properties: { 39 | sysSlug: schemas.slug(), 40 | label: schemas.label() 41 | } 42 | } 43 | }, 44 | additionalProperties: false 45 | }; 46 | 47 | var postIdsCreateQuery = { 48 | title: 'Create test ids', 49 | description: 'Create test ids.', 50 | type: 'object', 51 | properties: { 52 | generator: { 53 | required: false, 54 | type: 'string' 55 | }, 56 | count: { 57 | required: false, 58 | type: 'string' 59 | }, 60 | wait: { 61 | required: false, 62 | type: 'string' 63 | }, 64 | concurrency: { 65 | required: false, 66 | type: 'string' 67 | } 68 | }, 69 | additionalProperties: false 70 | }; 71 | 72 | module.exports.postProfileCreate = function() { 73 | return postProfileCreate; 74 | }; 75 | module.exports.postIdsCreateQuery = function() { 76 | return postIdsCreateQuery; 77 | }; 78 | -------------------------------------------------------------------------------- /schemas/services.vendor.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | 4 | var getRegisterQuery = { 5 | title: 'Get Vendor Register Query', 6 | type: 'object', 7 | properties: { 8 | 'public-key': schemas.publicKeyPem({required: false}), 9 | 'public-key-label': schemas.label({required: false}), 10 | 'registration-callback': schemas.url({required: false}), 11 | 'response-nonce': schemas.nonce({required: false}) 12 | }, 13 | additionalProperties: true 14 | }; 15 | 16 | module.exports.getRegisterQuery = function() { 17 | return getRegisterQuery; 18 | }; 19 | -------------------------------------------------------------------------------- /schemas/transaction.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var transfer = require('./transfer'); 6 | var depositAmount = require('./depositAmount'); 7 | 8 | var schema = { 9 | required: true, 10 | title: 'Transaction', 11 | description: 'A financial Transaction.', 12 | type: 'object', 13 | properties: { 14 | type: schemas.jsonldType('Transaction'), 15 | created: schemas.w3cDateTime(), 16 | // FIXME: seems incorrect to use deposit amount here 17 | amount: depositAmount(), 18 | transfer: { 19 | type: 'array', 20 | items: transfer() 21 | } 22 | }, 23 | additionalProperties: false 24 | }; 25 | 26 | module.exports.schema = function(extend) { 27 | if(extend) { 28 | return tools.extend(true, tools.clone(schema), extend); 29 | } 30 | return schema; 31 | }; 32 | -------------------------------------------------------------------------------- /schemas/transfer.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var currency = require('./currency'); 6 | var money = require('./money'); 7 | 8 | var schema = { 9 | required: true, 10 | title: 'Transfer', 11 | description: 'A financial Transfer.', 12 | type: 'object', 13 | properties: { 14 | type: schemas.jsonldType('Transfer'), 15 | source: schemas.url(), 16 | destination: schemas.url(), 17 | amount: money.precisePositive(), 18 | currency: currency(), 19 | comment: schemas.comment() 20 | }, 21 | additionalProperties: false 22 | }; 23 | 24 | module.exports = function(extend) { 25 | if(extend) { 26 | return tools.extend(true, tools.clone(schema), extend); 27 | } 28 | return schema; 29 | }; 30 | -------------------------------------------------------------------------------- /schemas/validatedAddress.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var address = require('./address'); 5 | 6 | var schema = address({ 7 | properties: { 8 | sysValidated: { 9 | required: false, 10 | type: 'boolean' 11 | }, 12 | sysAddressHash: { 13 | required: false, 14 | type: 'string' 15 | } 16 | } 17 | }); 18 | 19 | module.exports = function(extend) { 20 | if(extend) { 21 | return tools.extend(true, tools.clone(schema), extend); 22 | } 23 | return schema; 24 | }; 25 | -------------------------------------------------------------------------------- /schemas/validityInterval.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: true, 6 | title: 'Validity interval', 7 | description: 'The interval during which a budget is valid.', 8 | type: 'string', 9 | pattern: '^([2-9][0-9]{3}-(0[1-9]|1[0-2])-([0-2][0-9]|3[0-1])T([0-1][0-9]|2[0-3]):([0-5][0-9]):(([0-5][0-9])|60)(\\.[0-9]+)?(Z|((\\+|-)([0-1][0-9]|2[0-3]):([0-5][0-9])))?)|(R(\\d+)?\\/[2-9][0-9]{3}-(0[1-9]|1[0-2])-([0-2][0-9]|3[0-1])T([0-1][0-9]|2[0-3]):([0-5][0-9]):(([0-5][0-9])|60)(\\.[0-9]+)?(Z|((\\+|-)([0-1][0-9]|2[0-3]):([0-5][0-9])))?\\/P((\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?)$', 10 | errors: { 11 | invalid: 'Please enter a valid validity interval.', 12 | missing: 'Please enter a validity interval.' 13 | } 14 | }; 15 | 16 | module.exports = function(extend) { 17 | if(extend) { 18 | return tools.extend(true, tools.clone(schema), extend); 19 | } 20 | return schema; 21 | }; 22 | -------------------------------------------------------------------------------- /schemas/vendor.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var schemas = bedrock.validation.schemas; 3 | var tools = bedrock.tools; 4 | 5 | var schema = { 6 | required: true, 7 | title: 'Vendor', 8 | description: 'A vendor for a Listing or a permitted vendor for a particular Asset.', 9 | type: [ 10 | schemas.url(), 11 | { 12 | type: 'array', 13 | uniqueItems: true, 14 | items: schemas.url(), 15 | errors: { 16 | invalid: 'The vendor is invalid.', 17 | missing: 'The vendor is missing.' 18 | } 19 | } 20 | ] 21 | }; 22 | 23 | module.exports = function(extend) { 24 | if(extend) { 25 | return tools.extend(true, tools.clone(schema), extend); 26 | } 27 | return schema; 28 | }; 29 | -------------------------------------------------------------------------------- /schemas/withdrawalAmount.js: -------------------------------------------------------------------------------- 1 | var bedrock = require('bedrock'); 2 | var tools = bedrock.tools; 3 | 4 | var schema = { 5 | required: true, 6 | title: 'Withdrawal Amount', 7 | description: 'An amount to be withdrawn.', 8 | type: 'string', 9 | pattern: '^([1-9]{1}[0-9]{0,2}(\\,[0-9]{3})*(\\.[0-9]{0,10})?|[1-9]{1}[0-9]{0,}(\\.[0-9]{0,10})?)$', 10 | errors: { 11 | invalid: 'The withdrawal amount is invalid.', 12 | missing: 'Please withdraw a minimum of USD $1.00.' 13 | } 14 | }; 15 | 16 | module.exports = function(extend) { 17 | if(extend) { 18 | return tools.extend(true, tools.clone(schema), extend); 19 | } 20 | return schema; 21 | }; 22 | -------------------------------------------------------------------------------- /site/img-src/cc-logos.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/img-src/cc-logos.xcf -------------------------------------------------------------------------------- /site/static/app/bootstrap.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstraps the Main App module via custom code. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([], function() { 9 | 10 | 'use strict'; 11 | 12 | require.config({ 13 | paths: { 14 | Blob: 'polyfill/Blob', 15 | FileSaver: 'filesaver/FileSaver', 16 | TypedArray: 'polyfill/typedarray', 17 | deflate: 'zip/deflate', 18 | zip: 'zip/zip' 19 | }, 20 | shim: { 21 | // export globals for non-requireJS libs 22 | 'FileSaver': {exports: 'saveAs'}, 23 | 'zip': {exports: 'zip'} 24 | } 25 | }); 26 | 27 | }); 28 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-balance-summary-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Account Balance Summary directive. To be paired w/Account Balance Details. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return { 13 | restrict: 'A', 14 | scope: { 15 | account: '=psAccountBalanceSummary', 16 | expand: '=psExpand' 17 | }, 18 | replace: true, 19 | templateUrl: '/app/components/account/account-balance-summary.html', 20 | link: Link 21 | }; 22 | 23 | function Link(scope) { 24 | var model = scope.model = {}; 25 | scope.$watch('account', function(account) { 26 | // get balance and credit limit 27 | model.balance = parseFloat(account ? account.balance : 0); 28 | model.creditLimit = parseFloat(account ? account.creditLimit || '0' : 0); 29 | 30 | // calculate remaining credit 31 | model.remainingCredit = model.creditLimit; 32 | if(model.balance < 0) { 33 | model.remainingCredit = model.creditLimit + model.balance; 34 | } 35 | 36 | // get total balance (includes remaining credit) 37 | model.totalBalance = model.remainingCredit; 38 | if(model.balance > 0) { 39 | model.totalBalance += model.balance; 40 | } 41 | }, true); 42 | } 43 | } 44 | 45 | return {psAccountBalanceSummary: factory}; 46 | 47 | }); 48 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-balance-summary.html: -------------------------------------------------------------------------------- 1 |
2 | {{account.currency}} {{model.totalBalance | floor | currency:'$'}} 3 | 4 | 5 | 6 |
7 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-balance.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |
4 |
5 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Account Controller. 3 | * 4 | * @author Manu Sporny 5 | * @author David I. Lehn 6 | * @author Dave Longley 7 | */ 8 | define([], function() { 9 | 10 | 'use strict'; 11 | 12 | /* @ngInject */ 13 | function factory( 14 | $scope, brAlertService, brIdentityService, brRefreshService, 15 | psAccountService) { 16 | var self = this; 17 | 18 | self.modals = {}; 19 | self.state = { 20 | accounts: psAccountService.state, 21 | identities: brIdentityService.state 22 | }; 23 | self.account = undefined; 24 | self.isOwner = false; 25 | 26 | brRefreshService.register($scope, function(force) { 27 | var opts = {force: !!force}; 28 | brAlertService.clear(); 29 | self.isOwner = false; 30 | psAccountService.collection.getCurrent(opts) 31 | .then(function(account) { 32 | self.account = account; 33 | self.isOwner = self.account.owner == brIdentityService.identity.id; 34 | }) 35 | .catch(function(err) { 36 | brAlertService.add('error', err); 37 | self.account = null; 38 | self.isOwner = false; 39 | }) 40 | .then(function() { 41 | $scope.$apply(); 42 | }); 43 | })(); 44 | } 45 | 46 | return {AccountController: factory}; 47 | 48 | }); 49 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-routes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Account routes. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Manu Sporny 7 | * @author David I. Lehn 8 | * @author Dave Longley 9 | */ 10 | define([], function() { 11 | 12 | 'use strict'; 13 | 14 | var base = window.data.identityBasePath; 15 | return [{ 16 | path: base + '/:identity/accounts', 17 | options: { 18 | title: 'Accounts', 19 | session: 'required', 20 | templateUrl: '/app/components/account/accounts.html' 21 | } 22 | }, { 23 | path: base + '/:identity/accounts/:account', 24 | options: { 25 | title: 'Account', 26 | session: 'required', 27 | templateUrl: '/app/components/account/account.html' 28 | } 29 | }]; 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-selector-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Account Selector. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function accountSelectorInner(psAccountService) { 12 | return { 13 | restrict: 'A', 14 | require: 'brSelector', 15 | link: Link 16 | }; 17 | 18 | function Link(scope, element, attrs, brSelector) { 19 | var model = scope.model = {}; 20 | model.state = psAccountService.state; 21 | model.accounts = psAccountService.accounts; 22 | 23 | scope.$watch(function() { 24 | return model.accounts; 25 | }, function(accounts) { 26 | if(!accounts) { 27 | return; 28 | } 29 | if(!scope.selected || $.inArray(scope.selected, accounts) === -1) { 30 | scope.selected = accounts[0] || null; 31 | } 32 | }, true); 33 | 34 | // configure brSelector 35 | scope.brSelector = brSelector; 36 | brSelector.itemType = 'Account'; 37 | brSelector.items = model.accounts; 38 | brSelector.addItem = function() { 39 | model.showAddAccountModal = true; 40 | }; 41 | scope.$watch('fixed', function(value) { 42 | brSelector.fixed = value; 43 | }); 44 | 45 | psAccountService.collection.getAll(); 46 | } 47 | } 48 | 49 | /* @ngInject */ 50 | function accountSelector() { 51 | return { 52 | restrict: 'EA', 53 | scope: { 54 | selected: '=psSelected', 55 | invalid: '=psInvalid', 56 | fixed: '=?psFixed', 57 | minBalance: '@psMinBalance', 58 | showDepositButton: '@psShowDepositButton', 59 | instant: '=psInstant', 60 | allowInstantTransfer: '@psAllowInstantTransfer', 61 | instantTransferDeposit: '=?psInstantTransferDeposit' 62 | }, 63 | templateUrl: '/app/components/account/account-selector.html' 64 | }; 65 | } 66 | 67 | return { 68 | psAccountSelector: accountSelector, 69 | psAccountSelectorInner: accountSelectorInner 70 | }; 71 | 72 | }); 73 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-selector.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 |
7 | 14 |
15 |
16 |
17 |
18 | 19 |
20 | 32 |
33 |
34 | 37 |
38 |
39 | -------------------------------------------------------------------------------- /site/static/app/components/account/account-view.html: -------------------------------------------------------------------------------- 1 |
2 |
Id
3 |
4 | 7 |
8 | 9 |
Label
10 |
11 | 14 |
15 | 16 |
Status
17 |
18 | 21 |
22 | 23 |
Balance
24 |
25 | 31 |
32 | 33 |
Owner
34 |
35 | 38 |
39 |
40 | -------------------------------------------------------------------------------- /site/static/app/components/account/accounts.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | 8 | 12 |
13 |
14 | 15 |
16 |
17 |

Accounts

18 |
19 |
20 | 21 |
22 |
23 |
24 |
25 |
26 | 27 |
28 |
29 |
30 |
31 |
32 |
33 | -------------------------------------------------------------------------------- /site/static/app/components/account/add-account-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Add Account Modal. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(psAccountService, brAlertService, brIdentityService, config) { 12 | return { 13 | restrict: 'A', 14 | scope: {}, 15 | require: '^stackable', 16 | templateUrl: '/app/components/account/add-account-modal.html', 17 | link: Link 18 | }; 19 | 20 | function Link(scope, element, attrs, stackable) { 21 | var model = scope.model = {}; 22 | model.identity = brIdentityService.identity; 23 | model.state = psAccountService.state; 24 | var account = model.account = { 25 | '@context': config.data.contextUrl, 26 | currency: 'USD', 27 | sysPublic: [] 28 | }; 29 | model.accountVisibility = 'hidden'; 30 | 31 | model.addAccount = function() { 32 | brAlertService.clearFeedback(); 33 | account.sysPublic = []; 34 | if(model.accountVisibility === 'public') { 35 | account.sysPublic.push('label'); 36 | account.sysPublic.push('owner'); 37 | } 38 | 39 | psAccountService.collection.add(account).then(function(account) { 40 | stackable.close(null, account); 41 | }).catch(function(err) { 42 | brAlertService.add('error', err, {scope: scope}); 43 | scope.$apply(); 44 | }); 45 | }; 46 | } 47 | } 48 | 49 | return {psAddAccountModal: factory}; 50 | 51 | }); 52 | -------------------------------------------------------------------------------- /site/static/app/components/account/add-account-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/account/add-credit-line-complete.html: -------------------------------------------------------------------------------- 1 |

2 | You have opened a credit line of 3 | USD {{account.creditLimit | currency:'$'}} 4 | for your "{{account.label}}" account. 5 |

6 | 7 |

In order to enable your credit line, select a payment method that will be 8 | used to automatically pay back any credit you use on a periodic basis.

9 | 10 |
Please choose a debit card, not a credit 11 | card. Using a credit card to back a credit line may be a violation of your 12 | credit card agreement.
13 | 14 |
The same payment method may not be used to 15 | back more than one credit line.
16 | 17 |

For more information, see our 18 | pricing policy and rates.

19 | 20 |
21 |

Payment Method

22 |
24 |
25 | -------------------------------------------------------------------------------- /site/static/app/components/account/deposit-complete.html: -------------------------------------------------------------------------------- 1 |

2 | You have deposited 3 | 4 | into your 5 | "{{accounts[account.id].label}}" 6 | account. 7 |

8 | 9 |
10 |

Deposit Details

11 |
14 |
15 | 16 |
17 |

Summary

18 |

19 | Including fees, your 20 | 21 | card 22 | bank account 23 | external account 24 | 25 | "{{input.source.label}}" 26 | was charged 27 | 28 | on 29 | {{deposit.created | date:'medium'}}. 30 | "Digital Bazaar" will appear on your billing statement. 31 |

32 | 33 |

A copy of this receipt has been sent to your email address.

34 |
35 | -------------------------------------------------------------------------------- /site/static/app/components/account/deposit-review.html: -------------------------------------------------------------------------------- 1 |
2 | Your deposit is NOT complete, verify your information below. 3 | See our pricing policy and rates 4 | page for fee information. 5 |
6 | 7 |
8 |

Payment Method

9 |
12 |
13 | 14 |
15 |

Deposit Details

16 |
19 |
20 | 21 |

22 | If these details are correct, click the "Deposit" button. 23 |

24 | -------------------------------------------------------------------------------- /site/static/app/components/account/edit-account-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/account/update-account-button-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Update Account Button Directive. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(psAccountService, brAlertService, brIdentityService, config) { 12 | return { 13 | restrict: 'A', 14 | scope: {account: '=psAccount', callback: '&psCallback'}, 15 | templateUrl: '/app/components/account/update-account-button.html', 16 | link: Link 17 | }; 18 | 19 | function Link(scope, element) { 20 | var model = scope.model = {}; 21 | model.identity = brIdentityService.identity; 22 | 23 | model.updateAccount = function() { 24 | // merge in all properties from given account 25 | var account = { 26 | '@context': config.data.contextUrl, 27 | id: scope.account.id 28 | }; 29 | scope.account.forEach(function(property) { 30 | account[property] = scope.account[property]; 31 | }); 32 | 33 | psAccountService.update(account).then(function(account) { 34 | scope.callback(null, account); 35 | }).catch(function(err) { 36 | brAlertService.add('error', err); 37 | scope.callback(err, account); 38 | }); 39 | }; 40 | } 41 | } 42 | 43 | return {psUpdateAccountButton: factory}; 44 | 45 | }); 46 | -------------------------------------------------------------------------------- /site/static/app/components/account/update-account-button.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | -------------------------------------------------------------------------------- /site/static/app/components/account/withdraw-complete.html: -------------------------------------------------------------------------------- 1 |

2 | You have withdrawn 3 | 4 | from your 5 | "{{account.label}}" 6 | account. 7 |

8 | 9 |
10 |

Withdrawal Details

11 |
14 |
15 | 16 |
17 |

Summary

18 |

19 | Your 20 | 21 | bank account 22 | external account 23 | 24 | "{{input.destination.label}}" 25 | was credited 26 | 27 | on 28 | {{withdrawal.created | date:'medium'}}. 29 | "Digital Bazaar" will appear on your bank statement. 30 |

31 | 32 |

A copy of this receipt has been sent to your email address.

33 |
34 | -------------------------------------------------------------------------------- /site/static/app/components/account/withdraw-review.html: -------------------------------------------------------------------------------- 1 |
2 | Your withdrawal is NOT complete, verify your information below. 3 | See our pricing policy and rates 4 | page for fee information. 5 |
6 | 7 |
8 |

Withdrawal Destination

9 |
12 |
13 | 14 |
15 |

Withdrawal Details

16 |
19 |
20 | 21 |

22 | If these details are correct, click the "Withdraw" button. 23 |

24 | -------------------------------------------------------------------------------- /site/static/app/components/address/add-address-edit.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 5 | Enter a memorable label for this address such as 6 | "Home" or "Work". 7 | 8 | 9 | 11 | Please enter both your first name and last name. 12 | 13 | 14 | 16 | Please enter your full street address, including street number, 17 | street, and any apartment number, etc. 18 | 19 | 20 | 22 | Please enter your city or locality. 23 | 24 | 25 | 27 | Please enter your state or region. 28 | 29 | 30 | 32 | Please enter your zip or postal code. 33 | 34 | 35 | 38 | Please choose your country. 39 | 40 |
41 |
42 | -------------------------------------------------------------------------------- /site/static/app/components/address/add-address-modal.html: -------------------------------------------------------------------------------- 1 | 38 | -------------------------------------------------------------------------------- /site/static/app/components/address/add-address-select.html: -------------------------------------------------------------------------------- 1 |

2 | We ran your address through an address validation service, but it could 3 | not be validated. You may still use the address you entered, but if you 4 | would like to make changes please click "Back" below. 5 |

6 |

7 | We have run your address through an address validation service. If the 8 | validated address looks ok, please click "Add" to continue. If the 9 | validated address does not match the address you entered, then you may 10 | click on the one you entered to select it instead. 11 |

12 | 13 |
14 |

Validated Address

15 |
17 |
18 |
19 |
20 |
21 |

Entered Address

22 |
24 |
25 |
26 |
27 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-form.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 5 | Enter a memorable name that describes this address. 6 | 7 |
8 |
9 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-selector-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Address Selector. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function addressSelectorInner(psAddressService, brIdentityService) { 12 | return { 13 | restrict: 'A', 14 | require: 'brSelector', 15 | link: Link 16 | }; 17 | 18 | function Link(scope, element, attrs, brSelector) { 19 | var model = scope.model = {}; 20 | model.services = { 21 | address: psAddressService.state 22 | }; 23 | model.identity = brIdentityService.identity; 24 | model.addresses = psAddressService.addresses; 25 | scope.$watch('model.addresses', function(addresses) { 26 | if(!scope.selected || $.inArray(scope.selected, addresses) === -1) { 27 | scope.selected = addresses[0] || null; 28 | } 29 | }, true); 30 | 31 | // configure brSelector 32 | scope.brSelector = brSelector; 33 | brSelector.itemType = 'Address'; 34 | brSelector.items = model.addresses; 35 | brSelector.addItem = function() { 36 | model.showAddAddressModal = true; 37 | }; 38 | scope.$watch('fixed', function(value) { 39 | brSelector.fixed = value; 40 | }); 41 | 42 | psAddressService.collection.getAll(); 43 | } 44 | } 45 | 46 | /* @ngInject */ 47 | function addressSelector() { 48 | return { 49 | restrict: 'EA', 50 | scope: { 51 | selected: '=psSelected', 52 | invalid: '=psInvalid', 53 | fixed: '=?psFixed' 54 | }, 55 | templateUrl: '/app/components/address/address-selector.html' 56 | }; 57 | } 58 | 59 | return { 60 | psAddressSelector: addressSelector, 61 | psAddressSelectorInner: addressSelectorInner 62 | }; 63 | 64 | }); 65 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-selector.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 |
7 |
8 |
9 |
10 | 11 |
12 | 18 |
19 |
20 | 23 |
24 |
25 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-service.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * PaySwarm Address Service. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory( 12 | $http, $rootScope, $timeout, 13 | brIdentityService, brModelService, brRefreshService, brResourceService) { 14 | var service = {}; 15 | 16 | // create address collection 17 | var identity = brIdentityService.identity; 18 | service.collection = new brResourceService.Collection({ 19 | url: identity.id + '/addresses', 20 | finishLoading: _updateAddresses 21 | }); 22 | service.state = service.collection.state; 23 | service.addresses = service.collection.storage; 24 | 25 | // validate an address 26 | service.validate = function(address) { 27 | return service.collection.add(address, { 28 | params: {action: 'validate'}, 29 | update: false 30 | }); 31 | }; 32 | 33 | function _updateAddresses() { 34 | // update identity addresses 35 | brModelService.replaceArray(identity.address, service.addresses); 36 | } 37 | 38 | // register for system-wide refreshes 39 | brRefreshService.register(service.collection); 40 | 41 | // expose service to scope 42 | $rootScope.app.services.address = service; 43 | 44 | return service; 45 | } 46 | 47 | return {psAddressService: factory}; 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-settings.html: -------------------------------------------------------------------------------- 1 |
3 | 4 |
5 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-view-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Address directive. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return { 13 | restrict: 'A', 14 | scope: { 15 | address: '=psAddressView', 16 | noLabel: '=?psNoLabel' 17 | }, 18 | templateUrl: '/app/components/address/address-view.html' 19 | }; 20 | } 21 | 22 | return {psAddressView: factory}; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /site/static/app/components/address/address-view.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | {{address.label}} (Validated)
4 |
5 | {{address.name}}
6 | {{address.streetAddress}}
7 | {{address.addressLocality}}, {{address.addressRegion}} {{address.postalCode}}
8 | {{address.addressCountry}}
9 |
10 | -------------------------------------------------------------------------------- /site/static/app/components/address/address.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Address module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './add-address-modal-directive', 11 | './address-selector-directive', 12 | './address-service', 13 | './address-view-directive', 14 | './addresses-controller', 15 | './addresses-directive', 16 | './edit-address-modal-directive' 17 | ], function( 18 | angular, 19 | addAddressModalDirective, 20 | addressSelectorModalDirective, 21 | addressService, 22 | addressViewDirective, 23 | addressesController, 24 | addressesDirective, 25 | editAddressModalDirective 26 | ) { 27 | 28 | 'use strict'; 29 | 30 | var module = angular.module('app.address', []); 31 | 32 | module.directive(addAddressModalDirective); 33 | module.directive(addressSelectorModalDirective); 34 | module.service(addressService); 35 | module.directive(addressViewDirective); 36 | module.controller(addressesController); 37 | module.directive(addressesDirective); 38 | module.directive(editAddressModalDirective); 39 | 40 | return module.name; 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /site/static/app/components/address/addresses-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Addresses Controller. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | * @author David I. Lehn 8 | */ 9 | define([], function() { 10 | 11 | 'use strict'; 12 | 13 | /* @ngInject */ 14 | function factory($scope, psAddressService, brAlertService, brIdentityService) { 15 | var self = this; 16 | self.identity = brIdentityService.identity; 17 | self.state = psAddressService.state; 18 | self.addresses = psAddressService.addresses; 19 | self.addressToDelete = null; 20 | self.modals = { 21 | showAddAddress: false, 22 | showDeleteAddressAlert: false, 23 | showEditAddress: false, 24 | address: null 25 | }; 26 | 27 | self.deleteAddress = function(address) { 28 | self.modals.showDeleteAddressAlert = true; 29 | self.addressToDelete = address; 30 | }; 31 | self.confirmDeleteAddress = function(err, result) { 32 | if(!err && result === 'ok') { 33 | psAddressService.collection.del(self.addressToDelete.id) 34 | .catch(function(err) { 35 | brAlertService.add('error', err); 36 | }) 37 | .then(function() { 38 | $scope.$apply(); 39 | }); 40 | } 41 | self.addressToDelete = null; 42 | }; 43 | self.editAddress = function(address) { 44 | self.modals.showEditAddress = true; 45 | self.modals.address = address; 46 | }; 47 | 48 | psAddressService.collection.getAll(); 49 | } 50 | 51 | return {AddressesController: factory}; 52 | 53 | }); 54 | -------------------------------------------------------------------------------- /site/static/app/components/address/addresses-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Addresses directive. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author David I. Lehn 7 | * @author Dave Longley 8 | */ 9 | define([], function() { 10 | 11 | 'use strict'; 12 | 13 | /* @ngInject */ 14 | function factory() { 15 | return { 16 | restrict: 'E', 17 | replace: true, 18 | templateUrl: '/app/components/address/addresses-view.html' 19 | }; 20 | } 21 | 22 | return {psAddresses: factory}; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /site/static/app/components/address/edit-address-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Edit Address Modal. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define(['angular'], function(angular) { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(psAddressService, brAlertService, config) { 12 | return { 13 | scope: {sourceAddress: '=psAddress'}, 14 | require: '^stackable', 15 | templateUrl: '/app/components/address/edit-address-modal.html', 16 | link: Link 17 | }; 18 | 19 | function Link(scope, element, attrs, stackable) { 20 | var model = scope.model = {}; 21 | model.mode = 'edit'; 22 | model.loading = false; 23 | // copy source for editing 24 | model.address = {}; 25 | angular.extend(model.address, scope.sourceAddress); 26 | 27 | model.editAddress = function() { 28 | model.loading = true; 29 | // set all fields from UI 30 | var address = { 31 | '@context': config.data.contextUrl, 32 | id: model.address.id, 33 | label: model.address.label 34 | }; 35 | 36 | model.loading = true; 37 | brAlertService.clearFeedback(); 38 | psAddressService.collection.update(address).then(function(address) { 39 | model.loading = false; 40 | stackable.close(null, address); 41 | scope.$apply(); 42 | }).catch(function(err) { 43 | model.loading = false; 44 | brAlertService.add('error', err, {scope: scope}); 45 | scope.$apply(); 46 | }); 47 | }; 48 | } 49 | } 50 | 51 | return {psEditAddressModal: factory}; 52 | 53 | }); 54 | -------------------------------------------------------------------------------- /site/static/app/components/address/edit-address-modal.html: -------------------------------------------------------------------------------- 1 | 24 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/add-asset-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Add Asset Modal. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(brAlertService, psHostedAssetService, config) { 12 | return { 13 | restrict: 'A', 14 | scope: {}, 15 | require: '^stackable', 16 | templateUrl: '/app/components/assetora/add-asset-modal.html', 17 | link: Link 18 | }; 19 | 20 | function Link(scope, element, attrs, stackable) { 21 | // FIXME: use root/global data, move over to model 22 | scope.data = config.data || {}; 23 | scope.identity = scope.data.identity || {}; 24 | scope.feedback = {}; 25 | 26 | scope.model = {}; 27 | scope.model.loading = false; 28 | scope.model.asset = { 29 | '@context': 'https://w3id.org/payswarm/v1', 30 | type: 'Asset', 31 | // FIXME: add more asset details 32 | // FIXME: remove test data 33 | title: 'TITLE', 34 | creator: {name: 'My Full Name'}, 35 | assetProvider: scope.identity.id, 36 | listingRestrictions: {vendor: scope.identity.id}, 37 | assetContent: 'http://wordpress.payswarm.dev/asset-content/test.html', 38 | // FIXME: figure out whether published flag is desirable 39 | sysPublished: window.iso8601.w3cDate() 40 | }; 41 | 42 | scope.addAsset = function() { 43 | var asset = scope.model.asset; 44 | asset.created = window.iso8601.w3cDate(); 45 | 46 | console.log('asset', asset); 47 | psHostedAssetService.add(asset).then(function(asset) { 48 | scope.loading = false; 49 | stackable.close(null, asset); 50 | }).catch(function(err) { 51 | brAlertService.add('error', err, {scope: scope}); 52 | scope.loading = false; 53 | }); 54 | }; 55 | } 56 | } 57 | 58 | return {psAddAssetModal: factory}; 59 | 60 | }); 61 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/add-asset-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/add-invoice-item-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Add Invoice Item Modal. 3 | * 4 | * @author David I. Lehn 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(config) { 12 | return { 13 | restrict: 'A', 14 | scope: { 15 | asset: '=psAsset', 16 | destination: '=psDestination' 17 | }, 18 | require: '^stackable', 19 | templateUrl: '/app/components/add-invoice-item-modal.html', 20 | link: Link 21 | }; 22 | 23 | function Link(scope, element, attrs, stackable) { 24 | // FIXME: use root/global data, move over to model 25 | scope.data = config.data || {}; 26 | scope.identity = config.data.identity || {}; 27 | 28 | console.log('modal-add-invoice-item scope.asset', scope.asset); 29 | console.log('modal-add-invoice-item scope', scope); 30 | scope.model = {}; 31 | scope.model.loading = false; 32 | scope.model.asset = scope.asset; 33 | scope.model.item = { 34 | // @context set in parent Invoice 35 | type: 'InvoiceItem', 36 | title: '', 37 | amount: '', 38 | currency: scope.destination.currency, 39 | comment: '' 40 | // FIXME: add more item details 41 | // - date range of item 42 | // - time used for item 43 | // - who performed item 44 | // ... etc 45 | }; 46 | 47 | scope.addInvoiceItem = function() { 48 | var item = scope.model.item; 49 | scope.model.asset.invoiceItem.push(item); 50 | stackable.close(null, item); 51 | }; 52 | } 53 | } 54 | 55 | return {psAddInvoiceItemModal: factory}; 56 | 57 | }); 58 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/add-invoice-item-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/add-invoice-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/add-listing-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/asset-form.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 5 | Please enter the URL for the Asset content. This is the URL that 6 | your customers will visit to see the content that they have 7 | purchased. 8 | 9 | 10 | 12 | Please enter the title for the Asset. 13 |

14 | Suggestions: How to Bake Like a Boss, View From Atop Rainier 15 |
16 |
17 |
18 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/assetora-routes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Assetora routes. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Manu Sporny 7 | * @author David I. Lehn 8 | * @author Dave Longley 9 | */ 10 | define([], function() { 11 | 12 | 'use strict'; 13 | 14 | var base = window.data.identityBasePath; 15 | return [{ 16 | path: base + '/:identity/assetora', 17 | options: { 18 | templateUrl: '/app/components/assetora.html' 19 | } 20 | }, { 21 | path: base + '/:identity/causes', 22 | options: { 23 | templateUrl: '/app/components/assetora/causes.html' 24 | } 25 | }, { 26 | path: base + '/:identity/invoices', 27 | options: { 28 | templateUrl: '/app/components/assetora/invoices.html' 29 | } 30 | }, { 31 | path: base + '/:identity/tickets', 32 | options: { 33 | templateUrl: '/app/component/assetora/tickets.html' 34 | } 35 | }]; 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/assetora.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Assetora module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular'//, 10 | //'./assetora-controller' 11 | ], function(angular, assetora) { 12 | 13 | 'use strict'; 14 | 15 | var module = angular.module('app.assetora', []); 16 | 17 | module.controller(assetora); 18 | 19 | return module.name; 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/causes-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Causes 3 | * 4 | * @author Digital Bazaar, Inc. 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory($scope, config) { 12 | $scope.model = {}; 13 | $scope.identity = config.data.identity; 14 | } 15 | 16 | return {CausesController: factory}; 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/causes.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

Causes

6 | 7 |

FIXME: Causes description.

8 |
9 |
10 | 11 |
12 |
13 |

FIXME

14 |
15 |
16 | 17 |
18 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/content-portal-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Content Portal Controller. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory($scope, config) { 12 | $scope.model = { 13 | asset: config.data.asset, 14 | encryptedReceipt: config.data.encryptedReceipt 15 | }; 16 | } 17 | 18 | return {ContentPortalController: factory}; 19 | 20 | }); 21 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/edit-asset-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/edit-invoice-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/edit-listing-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/invoice-item-form.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | 5 | Please enter a short title for this item. 6 | 10 | 11 | 12 | 14 | Please enter the amount of this item. 15 |

16 | You must enter a valid monetary amount like 20 or 5.00. 17 |
18 | 19 | 21 | Please enter comments about this item if needed. 22 | 26 | 27 |
28 |
29 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/tickets-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Tickets 3 | * 4 | * @author Digital Bazaar, Inc. 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory($scope, config) { 12 | $scope.model = {}; 13 | $scope.identity = config.data.identity; 14 | } 15 | 16 | return {TicketsController: factory}; 17 | 18 | }); 19 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/tickets.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

Tickets

6 | 7 |

FIXME: Tickets description.

8 |
9 |
10 | 11 |
12 |
13 |

FIXME

14 |
15 |
16 | 17 |
18 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/tools-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Asset Management Tools. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | return { 11 | routes: [{ 12 | path: '/i/:identity/tools', 13 | options: { 14 | templateUrl: '/app/components/assetora/tools.html' 15 | } 16 | }] 17 | }; 18 | 19 | }); 20 | -------------------------------------------------------------------------------- /site/static/app/components/assetora/tools.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

Tools

6 | 7 |

A number of tools are available to help you utilize our financial 8 | capabilities.

9 |
10 |
11 | 12 |
13 |
14 |
15 | 16 |

Sell Digital Content

17 |

A tool to help you easily setup selling digital content from your 18 | own website.

19 |
20 | 21 |
22 | 23 |

Invoice Customers

24 |

Create invoices for your customers.

25 |
26 | 27 |
28 | 29 |

Collect for Causes

30 |

Collect money for your causes.

31 |
32 | 33 |
34 | 35 |

Sell Tickets

36 |

Sell tickets to your events.

37 |
38 | 39 |
40 |
41 | 42 |
43 | -------------------------------------------------------------------------------- /site/static/app/components/budget/add-budget-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget-bar-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Budget Bar directive. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return { 13 | restrict: 'A', 14 | scope: {budget: '=psBudgetBar'}, 15 | replace: true, 16 | templateUrl: '/app/components/budget/budget-bar.html', 17 | link: function(scope) { 18 | var model = scope.model = {}; 19 | model.barPercentage = 0; 20 | model.textPercentage = 0; 21 | 22 | // update progress bar when balance or amount changes 23 | scope.$watch('budget', function(budget) { 24 | var model = scope.model; 25 | var balance = budget ? budget.balance : '0'; 26 | var amount = budget ? budget.amount : '0'; 27 | model.barPercentage = parseFloat(balance) / parseFloat(amount) * 100; 28 | model.barPercentage = Math.max(0, Math.min(model.barPercentage, 100)); 29 | model.textPercentage = 100 / model.barPercentage * 100; 30 | }, true); 31 | } 32 | }; 33 | } 34 | 35 | return {psBudgetBar: factory}; 36 | 37 | }); 38 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget-bar.html: -------------------------------------------------------------------------------- 1 |
2 |
4 |
5 | {{budget.currency}} 6 | {{budget.balance | floor | currency:'$'}} / {{budget.amount | floor | currency:'$'}} 7 |
8 |
14 |
15 | {{budget.currency}} 16 | {{budget.balance | floor | currency:'$'}} / {{budget.amount | floor | currency:'$'}} 17 |
18 |
19 |
20 | 21 | 25 |
26 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget-routes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Budget routes. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Manu Sporny 7 | * @author David I. Lehn 8 | * @author Dave Longley 9 | */ 10 | define([], function() { 11 | 12 | 'use strict'; 13 | 14 | var base = window.data.identityBasePath; 15 | return [{ 16 | path: base + '/:identity/budgets/:budget', 17 | options: { 18 | title: 'Budget', 19 | session: 'required', 20 | templateUrl: '/app/components/budget/budget.html' 21 | } 22 | }]; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget-selection.html: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 | 15 | 16 |
{{budget.label}}
Balance 12 |
13 |
17 |
18 |
20 |
21 |
22 |
23 |
This budget does not have a balance of at least {{budget.currency}} {{minBalance | ceil | currency:'$'}}. The budget's 25 | associated account must also have enough funds unless instant transfer is enabled.
26 |
27 |
28 |
29 |
30 | This budget does not allow a single purchase of at least 31 | {{budget.currency}} 32 | {{minBalance | ceil | currency:'$'}}. 33 |
34 |
35 |
36 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget-selector-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Budget Selector. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function budgetSelectorInner(psBudgetService) { 12 | return { 13 | restrict: 'A', 14 | require: 'brSelector', 15 | link: Link 16 | }; 17 | 18 | function Link(scope, element, attrs, brSelector) { 19 | var model = scope.model = {}; 20 | model.state = psBudgetService.state; 21 | model.budgets = psBudgetService.budgets; 22 | scope.$watch('model.budgets', function(budgets) { 23 | if(!scope.selected || $.inArray(scope.selected, budgets) === -1) { 24 | scope.selected = budgets[0] || null; 25 | } 26 | }, true); 27 | 28 | // configure brSelector 29 | scope.brSelector = brSelector; 30 | brSelector.itemType = 'Budget'; 31 | brSelector.items = model.budgets; 32 | brSelector.addItem = function() { 33 | model.showAddBudgetModal = true; 34 | }; 35 | scope.$watch('fixed', function(value) { 36 | brSelector.fixed = value; 37 | }); 38 | 39 | psBudgetService.collection.getAll(); 40 | } 41 | } 42 | 43 | /* @ngInject */ 44 | function budgetSelector() { 45 | return { 46 | restrict: 'EA', 47 | scope: { 48 | selected: '=psSelected', 49 | invalid: '=psInvalid', 50 | fixed: '=?psFixed', 51 | minBalance: '@psMinBalance' 52 | }, 53 | templateUrl: '/app/components/budget/budget-selector.html' 54 | }; 55 | } 56 | 57 | return { 58 | psBudgetSelector: budgetSelector, 59 | psBudgetSelectorInner: budgetSelectorInner 60 | }; 61 | 62 | }); 63 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget-selector.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 |
7 | 10 |
11 |
12 |
13 |
14 | 15 |
16 | 24 |
25 |
26 | 29 |
30 |
31 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budget.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Budget module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './add-budget-modal-directive', 11 | './budget-bar-directive', 12 | './budget-controller', 13 | './budget-routes', 14 | './budget-selection-directive', 15 | './budget-selector-directive', 16 | './budget-service', 17 | './budgets-directive', 18 | './edit-budget-modal-directive' 19 | ], function( 20 | angular, 21 | addBudgetModalDirective, 22 | budgetBarDirective, 23 | budgetController, 24 | budgetRoutes, 25 | budgetSelectionDirective, 26 | budgetSelectorDirective, 27 | budgetService, 28 | budgetsDirective, 29 | editBudgetModalDirective 30 | ) { 31 | 32 | 'use strict'; 33 | 34 | var module = angular.module('app.budget', []); 35 | 36 | module.directive(addBudgetModalDirective); 37 | module.directive(budgetBarDirective); 38 | module.controller(budgetController); 39 | module.directive(budgetSelectionDirective); 40 | module.directive(budgetSelectorDirective); 41 | module.service(budgetService); 42 | module.directive(budgetsDirective); 43 | module.directive(editBudgetModalDirective); 44 | 45 | /* @ngInject */ 46 | module.config(function($routeProvider) { 47 | angular.forEach(budgetRoutes, function(route) { 48 | $routeProvider.when(route.path, route.options); 49 | }); 50 | }); 51 | 52 | return module.name; 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /site/static/app/components/budget/budgets-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Budgets directive. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | * @author David I. Lehn 8 | */ 9 | define([], function() { 10 | 11 | 'use strict'; 12 | 13 | /* @ngInject */ 14 | function factory(brAlertService, psBudgetService) { 15 | return { 16 | restrict: 'A', 17 | scope: {}, 18 | templateUrl: '/app/components/budget/budgets-view.html', 19 | link: Link 20 | }; 21 | 22 | function Link(scope) { 23 | var model = scope.model = {}; 24 | model.budgets = psBudgetService.budgets; 25 | model.state = { 26 | budgets: psBudgetService.state 27 | }; 28 | model.modals = { 29 | showEditBudget: false, 30 | showAddBudget: false, 31 | budget: null 32 | }; 33 | model.getBudgetRefreshDuration = psBudgetService.getRefreshDuration; 34 | model.deleteBudget = function(budget) { 35 | model.showDeleteBudgetAlert = true; 36 | model.budgetToDelete = budget; 37 | }; 38 | model.confirmDeleteBudget = function(err, result) { 39 | // FIXME: handle errors 40 | if(!err && result === 'ok') { 41 | var budget = model.budgetToDelete; 42 | budget.deleted = true; 43 | scope.$apply(); 44 | // wait to delete so modal can transition 45 | psBudgetService.collection.del(budget.id, {delay: 400}) 46 | .catch(function(err) { 47 | brAlertService.add('error', err); 48 | budget.deleted = false; 49 | scope.$apply(); 50 | }); 51 | } 52 | model.budgetToDelete = null; 53 | }; 54 | 55 | psBudgetService.collection.getAll(); 56 | } 57 | } 58 | 59 | return {psBudgets: factory}; 60 | 61 | }); 62 | -------------------------------------------------------------------------------- /site/static/app/components/budget/edit-budget-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/components.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Components module. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './account/account', 11 | './address/address', 12 | './budget/budget', 13 | './dashboard/dashboard', 14 | './identity-preferences/identity-preferences', 15 | './payment-token/payment-token', 16 | './promo/promo', 17 | './purchase/purchase', 18 | './transaction/transaction', 19 | './vendor/vendor', 20 | 'bedrock/app/components/alert/alert', 21 | 'bedrock/app/components/duplicate-checker/duplicate-checker', 22 | 'bedrock/app/components/form/form', 23 | 'bedrock/app/components/identity/identity', 24 | 'bedrock/app/components/key/key', 25 | 'bedrock/app/components/login/login', 26 | 'bedrock/app/components/modal/modal', 27 | 'bedrock/app/components/navbar/navbar', 28 | 'bedrock/app/components/passcode/passcode', 29 | 'bedrock/app/components/placeholder/placeholder', 30 | 'bedrock/app/components/selector/selector', 31 | 'bedrock/app/components/settings/settings', 32 | 'bedrock/app/components/slug/slug', 33 | 'bedrock/app/components/tabs/tabs', 34 | 'bedrock/app/components/util/util' 35 | ], function(angular) { 36 | 37 | 'use strict'; 38 | 39 | angular.module('app.components', Array.prototype.slice.call(arguments, 1)); 40 | 41 | }); 42 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/dashboard-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Identity Dashboard. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | * @author David I. Lehn 8 | */ 9 | define([], function() { 10 | 11 | 'use strict'; 12 | 13 | /* @ngInject */ 14 | function factory(brIdentityService) { 15 | var self = this; 16 | self.identity = brIdentityService.identity; 17 | // show welcome modal based on whether a regulatory address has been set 18 | self.showWelcomeModal = !self.identity.sysRegulatoryAddress; 19 | } 20 | 21 | return {DashboardController: factory}; 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/dashboard.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 |

Dashboard

6 |
7 |
8 | 9 |
10 |
11 |
12 |
13 | 14 |
15 |
16 |
17 |
18 | 19 |
20 |
21 |
22 |
23 | 24 |
25 | 26 |
27 | 28 |

You have no new messages.

29 |
30 |
31 |
32 | 33 | 35 |
36 |
37 |
38 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/dashboard.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Dashboard module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './dashboard-controller', 11 | './welcome-modal-directive', 12 | 'bedrock/app/components/dashboard/dashboard-routes' 13 | ], function( 14 | angular, 15 | dashboardController, 16 | welcomeModalDirective, 17 | dashboardRoutes) { 18 | 19 | 'use strict'; 20 | 21 | var module = angular.module('app.dashboard', []); 22 | 23 | module.controller(dashboardController); 24 | module.directive(welcomeModalDirective); 25 | 26 | /* @ngInject */ 27 | module.config(function($routeProvider) { 28 | angular.forEach(dashboardRoutes, function(route) { 29 | $routeProvider.when(route.path, route.options); 30 | }); 31 | }); 32 | 33 | return module.name; 34 | 35 | }); 36 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/messages-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Messages directive. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | * @author David I. Lehn 8 | */ 9 | define([], function() { 10 | 11 | 'use strict'; 12 | 13 | /* @ngInject */ 14 | function factory(brIdentityService) { 15 | return { 16 | restrict: 'A', 17 | templateUrl: '/app/components/dashboard/messages-view.html', 18 | link: Link 19 | }; 20 | 21 | function Link(scope) { 22 | var model = scope.model = {}; 23 | model.state = { 24 | identity: brIdentityService.state 25 | }; 26 | model.messages = []; 27 | } 28 | } 29 | 30 | return {psMessages: factory}; 31 | 32 | }); 33 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/messages-view.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |

You have no new messages.

4 |
5 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/welcome-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * New Identity Dashboard Welcome Modal. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define(['angular'], function(angular) { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(psAccountService, brAlertService, brIdentityService, config) { 12 | return { 13 | restrict: 'A', 14 | scope: {}, 15 | require: '^stackable', 16 | templateUrl: '/app/components/dashboard/welcome-modal.html', 17 | link: Link 18 | }; 19 | 20 | function Link(scope, element, attrs, stackable) { 21 | var model = scope.model = {}; 22 | model.data = config.data; 23 | model.identity = brIdentityService.identity; 24 | model.state = psAccountService.state; 25 | model.address = angular.copy(model.identity.sysRegulatoryAddress || {}); 26 | model.countries = config.constants.countries; 27 | 28 | model.setRegulatoryAddress = function() { 29 | brAlertService.clearFeedback(); 30 | psAccountService.setRegulatoryAddress({ 31 | address: { 32 | '@context': config.data.contextUrl, 33 | type: 'Address', 34 | addressRegion: model.address.addressRegion, 35 | addressCountry: model.address.addressCountry 36 | }, 37 | // FIXME: allow user customization? 38 | account: { 39 | '@context': config.data.contextUrl, 40 | // FIXME: use default values from config 41 | label: 'Primary Account', 42 | sysSlug: 'primary', 43 | currency: 'USD', 44 | sysPublic: [] 45 | } 46 | }).then(function() { 47 | scope.$apply(); 48 | stackable.close(null); 49 | }).catch(function(err) { 50 | brAlertService.add('error', err, {scope: scope}); 51 | scope.$apply(); 52 | }); 53 | }; 54 | } 55 | } 56 | 57 | return {psWelcomeModal: factory}; 58 | 59 | }); 60 | -------------------------------------------------------------------------------- /site/static/app/components/dashboard/welcome-modal.html: -------------------------------------------------------------------------------- 1 | 40 | -------------------------------------------------------------------------------- /site/static/app/components/identity-preferences/identity-preferences-service.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * PaySwarm Identity Preferences Service. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory($http, $rootScope, brIdentityService) { 12 | var service = {}; 13 | service.state = { 14 | loading: false 15 | }; 16 | 17 | // get identity preferences 18 | service.get = function(options) { 19 | var url = brIdentityService.identity.id + '/preferences'; 20 | 21 | if(options.responseNonce) { 22 | url += '?response-nonce=' + encodeURIComponent(options.responseNonce); 23 | } 24 | 25 | // FIXME: need loading count since this is called from update 26 | service.state.loading = true; 27 | return Promise.resolve($http.get(url)) 28 | .then(function(response) { 29 | service.state.loading = false; 30 | return response.data; 31 | }) 32 | .catch(function(err) { 33 | service.state.loading = false; 34 | throw err; 35 | }); 36 | }; 37 | 38 | // update identity preferences 39 | service.update = function(preferences, options) { 40 | service.state.loading = true; 41 | var url = brIdentityService.identity.id + '/preferences'; 42 | 43 | service.state.loading = false; 44 | return Promise.resolve($http.post(url, preferences)) 45 | .then(function() { 46 | return service.get(options || {}); 47 | }) 48 | .then(function(preferences) { 49 | service.state.loading = false; 50 | // update preferences 51 | brIdentityService.identity.preferences = preferences; 52 | return preferences; 53 | }) 54 | .catch(function(err) { 55 | service.state.loading = false; 56 | throw err; 57 | }); 58 | }; 59 | 60 | // expose service to scope 61 | $rootScope.app.services.identityPreferences = service; 62 | 63 | return service; 64 | } 65 | 66 | return {psIdentityPreferencesService: factory}; 67 | 68 | }); 69 | -------------------------------------------------------------------------------- /site/static/app/components/identity-preferences/identity-preferences.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Identity Preferences module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './identity-preferences-service' 11 | ], function( 12 | angular, 13 | identityPreferences 14 | ) { 15 | 16 | 'use strict'; 17 | 18 | var module = angular.module('app.identity-preferences', []); 19 | 20 | module.service(identityPreferences); 21 | 22 | return module.name; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/add-payment-token-modal.html: -------------------------------------------------------------------------------- 1 | 27 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/card-brand-filter.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Card brand filter. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return function(input, logo) { 13 | if(input === 'Visa') { 14 | return logo ? 'cc-logo-visa' : 'Visa'; 15 | } 16 | if(input === 'MasterCard') { 17 | return logo ? 'cc-logo-mastercard' : 'MasterCard'; 18 | } 19 | if(input === 'Discover') { 20 | return logo ? 'cc-logo-discover' : 'Discover'; 21 | } 22 | if(input === 'AmericanExpress') { 23 | return logo ? 'cc-logo-amex' : 'American Express'; 24 | } 25 | if(input === 'ChinaUnionPay') { 26 | return logo ? 'cc-logo-china-up' : 'China Union Pay'; 27 | } 28 | }; 29 | } 30 | 31 | return {cardBrand: factory}; 32 | 33 | }); 34 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/cc-number-filter.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Credit/Debit card number filter. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return function(value) { 13 | value = (value === undefined || value === null) ? '****' : value.toString(); 14 | return '**** **** **** ' + value.substr(1); 15 | }; 16 | } 17 | 18 | return {ccNumber: factory}; 19 | 20 | }); 21 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/edit-payment-token-modal.html: -------------------------------------------------------------------------------- 1 | 25 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/external-account-settings.html: -------------------------------------------------------------------------------- 1 |
3 | 4 |
5 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/external-accounts-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Identity Settings. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory($scope, brAlertService, psPaymentTokenService) { 12 | var self = this; 13 | 14 | self.state = psPaymentTokenService.state; 15 | 16 | // types for UI directives 17 | self.allMethods = ['CreditCard', 'BankAccount']; 18 | self.creditCardMethods = ['CreditCard']; 19 | self.bankAccountMethods = ['BankAccount']; 20 | 21 | // service data 22 | self.creditCards = psPaymentTokenService.creditCards; 23 | self.bankAccounts = psPaymentTokenService.bankAccounts; 24 | 25 | // modals 26 | self.modals = { 27 | showAddCreditCard: false, 28 | showAddBankAccount: false 29 | }; 30 | 31 | self.deletePaymentToken = function(paymentToken) { 32 | paymentToken.deleted = true; 33 | psPaymentTokenService.collection.del(paymentToken.id, {update: false}) 34 | .catch(function(err) { 35 | brAlertService.add('error', err); 36 | paymentToken.deleted = false; 37 | $scope.apply(); 38 | }) 39 | .then(function() { 40 | // get token again since deletion is not immediate 41 | return psPaymentTokenService.collection.get( 42 | paymentToken.id, {force: true}); 43 | }); 44 | }; 45 | self.restorePaymentToken = function(paymentToken) { 46 | psPaymentTokenService.restore(paymentToken.id); 47 | }; 48 | 49 | psPaymentTokenService.collection.getAll(); 50 | } 51 | 52 | return {ExternalAccountsController: factory}; 53 | 54 | }); 55 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/external-accounts-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * External Accounts directive. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author David I. Lehn 7 | * @author Dave Longley 8 | */ 9 | define([], function() { 10 | 11 | 'use strict'; 12 | 13 | /* @ngInject */ 14 | function factory() { 15 | return { 16 | restrict: 'E', 17 | replace: true, 18 | templateUrl: '/app/components/payment-token/external-accounts-view.html' 19 | }; 20 | } 21 | 22 | return {psExternalAccounts: factory}; 23 | 24 | }); 25 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/kredit-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Kredit font directive. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define(['jquery'], function($) { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | // FIXME: remove once webkit non-windows font difference is fixed 13 | return function(scope, element, attrs) { 14 | if($.browser.webkit) { 15 | attrs.$observe('psKredit', function(value) { 16 | if(!/windows/.test(navigator.userAgent.toLowerCase())) { 17 | element.css('letter-spacing', '1px'); 18 | } 19 | }); 20 | } 21 | }; 22 | } 23 | 24 | return {psKredit: factory}; 25 | 26 | }); 27 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/payment-token-list-selector-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Payment Token List Selector. 3 | * 4 | * @author Digital Bazaar 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return { 13 | restrict: 'A', 14 | scope: { 15 | instant: '=psInstant', 16 | omit: '=psOmit' 17 | }, 18 | require: '^stackable', 19 | templateUrl: 20 | '/app/components/payment-token/payment-token-list-selector.html', 21 | link: Link 22 | }; 23 | 24 | function Link(scope, element, attrs, stackable) { 25 | var model = scope.model = {}; 26 | model.loading = false; 27 | // payment backup source selected 28 | model.backupSource = null; 29 | 30 | scope.confirm = function() { 31 | stackable.close(null, model.backupSource); 32 | }; 33 | } 34 | } 35 | 36 | return {psPaymentTokenListSelectorModal: factory}; 37 | 38 | }); 39 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/payment-token-list-selector-modal.html: -------------------------------------------------------------------------------- 1 | 32 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/payment-token-selection-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * PaymentToken Selection Display. 3 | * 4 | * @author Digital Bazaar 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory() { 12 | return { 13 | restrict: 'E', 14 | scope: { 15 | token: '=psToken', 16 | selecting: '=psSelecting', 17 | select: '&?psSelect' 18 | }, 19 | templateUrl: '/app/components/payment-token/payment-token-selection.html' 20 | }; 21 | } 22 | 23 | return {psPaymentTokenSelection: factory}; 24 | 25 | }); 26 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/payment-token-selector.html: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 | 6 |
7 | 8 |
9 |
10 |
11 |
12 | 13 |
14 |
15 |
16 |
17 | 18 |
19 |
20 |
21 |
22 |
23 | 26 |
27 |
28 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/verify-bank-account-complete.html: -------------------------------------------------------------------------------- 1 |

2 | You have deposited 3 | 4 | into your 5 | "{{accounts[depositDestination].label}}" 6 | account. 7 |

8 | 9 |
10 |

Verification and Deposit Details

11 |
14 |
15 | 16 |

17 | Including fees, your 18 | 19 | credit card 20 | bank account 21 | external account 22 | 23 | was charged 24 | 25 | on 26 | {{deposit.created | date:'medium'}}. 27 | "Digital Bazaar" will appear on your billing statement. 28 |

29 | 30 |

A copy of this receipt has been sent to your email address.

31 | -------------------------------------------------------------------------------- /site/static/app/components/payment-token/verify-bank-account-review.html: -------------------------------------------------------------------------------- 1 |
2 | Your bank account verification and deposit is NOT complete, verify your information below. 3 | See our pricing policy and rates 4 | page for fee information. 5 |
6 | 7 |
8 |

Payment Method

9 |
12 |
13 | 14 |
15 |

Verification and Deposit Details

16 |
19 |
20 | 21 |

22 | If these details are correct, click the "Verify and Deposit" button. 23 |

24 | -------------------------------------------------------------------------------- /site/static/app/components/promo/promo-service.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * PaySwarm Promo Service. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory( 12 | $http, $rootScope, psAccountService, psTransactionService, config) { 13 | var service = {}; 14 | 15 | service.state = { 16 | loading: false 17 | }; 18 | 19 | // redeem a promo code 20 | service.redeemCode = function(code, accountId) { 21 | service.state.loading = true; 22 | return Promise.resolve($http.post('/promos?action=redeem', { 23 | promoCode: code, 24 | account: accountId 25 | })).then(function() { 26 | service.state.loading = false; 27 | // refresh related account 28 | psAccountService.collection.get(accountId, { 29 | delay: 500, 30 | force: true 31 | }).then(function() { 32 | // refresh latest transactions 33 | psTransactionService.getRecent({force: true}); 34 | }); 35 | }).catch(function(err) { 36 | service.state.loading = false; 37 | throw err; 38 | }); 39 | }; 40 | 41 | // expose service to scope 42 | $rootScope.app.services.promo = service; 43 | 44 | return service; 45 | } 46 | 47 | return {psPromoService: factory}; 48 | 49 | }); 50 | -------------------------------------------------------------------------------- /site/static/app/components/promo/promo.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Promo module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './promo-code-checker-directive', 11 | './promo-service', 12 | './redeem-promo-code-modal-directive' 13 | ], function( 14 | angular, 15 | promoCodeCheckerDirective, 16 | promoService, 17 | redeemPromoCodeModalDirective 18 | ) { 19 | 20 | 'use strict'; 21 | 22 | var module = angular.module('app.promo', []); 23 | 24 | module.directive(promoCodeCheckerDirective); 25 | module.service(promoService); 26 | module.directive(redeemPromoCodeModalDirective); 27 | 28 | return module.name; 29 | 30 | }); 31 | -------------------------------------------------------------------------------- /site/static/app/components/promo/redeem-promo-code-modal-directive.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Redeem Promo Code Modal. 3 | * 4 | * @author Dave Longley 5 | */ 6 | define([], function() { 7 | 8 | 'use strict'; 9 | 10 | /* @ngInject */ 11 | function factory(brAlertService, psPromoService) { 12 | return { 13 | restrict: 'A', 14 | scope: {account: '=psAccount'}, 15 | require: '^stackable', 16 | templateUrl: '/app/components/promo/redeem-promo-code-modal.html', 17 | link: Link 18 | }; 19 | 20 | function Link(scope) { 21 | scope.model = {}; 22 | scope.services = {promo: psPromoService}; 23 | 24 | scope.redeemPromoCode = function() { 25 | psPromoService.redeemCode(scope.model.promoCode, scope.account.id) 26 | .then(function(promo) { 27 | scope.model.success = true; 28 | scope.model.promo = promo; 29 | }) 30 | .catch(function(err) { 31 | brAlertService.add('error', err, {scope: scope}); 32 | }) 33 | .then(function() { 34 | scope.$apply(); 35 | }); 36 | }; 37 | } 38 | } 39 | 40 | return {psRedeemPromoCodeModal: factory}; 41 | 42 | }); 43 | -------------------------------------------------------------------------------- /site/static/app/components/purchase/purchase.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Purchase module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './purchase-controller' 11 | ], function(angular, purchaseController) { 12 | 13 | 'use strict'; 14 | 15 | var module = angular.module('app.purchase', []); 16 | 17 | module.controller(purchaseController); 18 | 19 | return module.name; 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /site/static/app/components/system/system.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * System module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './dashboard.controller' 11 | ], function(angular, dashboard) { 12 | 13 | 'use strict'; 14 | 15 | var module = angular.module('app.system', []); 16 | 17 | module.controller(dashboard); 18 | 19 | return module.name; 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /site/static/app/components/transaction/money.html: -------------------------------------------------------------------------------- 1 | 4 | {{money.currency}} 5 | {{symbol}}{{formattedAmount}} 6 | {{symbol}}{{formattedAmount}} 7 | 8 | -------------------------------------------------------------------------------- /site/static/app/components/transaction/transaction-controller.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Transaction Controller. 3 | * 4 | * @author Manu Sporny 5 | * @author David I. Lehn 6 | * @author Dave Longley 7 | */ 8 | define(['jsonld'], function(jsonld) { 9 | 10 | 'use strict'; 11 | 12 | /* @ngInject */ 13 | function factory( 14 | $scope, psTransactionService, brAlertService, brRefreshService, config) { 15 | var self = this; 16 | 17 | self.modals = {}; 18 | self.state = { 19 | txns: psTransactionService.state 20 | }; 21 | self.txn = undefined; 22 | 23 | brRefreshService.register($scope, function(force) { 24 | var opts = {force: !!force}; 25 | brAlertService.clear(); 26 | psTransactionService.collection.getCurrent(opts) 27 | .then(function(txn) { 28 | self.txn = txn; 29 | self.isContract = jsonld.hasValue(txn, 'type', 'Contract'); 30 | self.isDeposit = jsonld.hasValue(txn, 'type', 'Deposit'); 31 | self.isWithdrawal = jsonld.hasValue(txn, 'type', 'Withdrawal'); 32 | $scope.$apply(); 33 | }) 34 | .catch(function(err) { 35 | brAlertService.add('error', err); 36 | self.txn = null; 37 | $scope.$apply(); 38 | }); 39 | })(); 40 | } 41 | 42 | return {TransactionController: factory}; 43 | 44 | }); 45 | -------------------------------------------------------------------------------- /site/static/app/components/transaction/transaction-routes.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Transaction routes. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Manu Sporny 7 | * @author David I. Lehn 8 | * @author Dave Longley 9 | */ 10 | define([], function() { 11 | 12 | 'use strict'; 13 | 14 | return [{ 15 | path: '/transactions/:transaction', 16 | options: { 17 | title: 'Transaction', 18 | session: 'required', 19 | templateUrl: '/app/components/transaction/transaction.html' 20 | } 21 | }]; 22 | 23 | }); 24 | -------------------------------------------------------------------------------- /site/static/app/components/transaction/transaction.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |
5 | 8 | 13 |
14 |
15 | 16 |
17 |
18 | 19 |
20 | Error! Transaction not found or access not allowed. 21 |
22 |
23 |
24 | 25 |
26 |
27 |
28 |
29 |
30 |
31 | -------------------------------------------------------------------------------- /site/static/app/components/transaction/transaction.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Transaction module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './money-directive', 11 | './transaction-controller', 12 | './transaction-service', 13 | './transaction-details-directive', 14 | './transaction-routes', 15 | './transactions-directive' 16 | ], function( 17 | angular, 18 | moneyDirective, 19 | transactionController, 20 | transactionService, 21 | transactionDetailsDirective, 22 | transactionRoutes, 23 | transactionsDirective 24 | ) { 25 | 26 | 'use strict'; 27 | 28 | var module = angular.module('app.transaction', []); 29 | 30 | module.directive(moneyDirective); 31 | module.controller(transactionController); 32 | module.service(transactionService); 33 | module.directive(transactionDetailsDirective); 34 | module.directive(transactionsDirective); 35 | 36 | /* @ngInject */ 37 | module.config(function($routeProvider) { 38 | angular.forEach(transactionRoutes, function(route) { 39 | $routeProvider.when(route.path, route.options); 40 | }); 41 | }); 42 | 43 | return module.name; 44 | 45 | }); 46 | -------------------------------------------------------------------------------- /site/static/app/components/vendor/vendor.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Vendor module. 3 | * 4 | * Copyright (c) 2012-2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author Dave Longley 7 | */ 8 | define([ 9 | 'angular', 10 | './register-controller' 11 | ], function(angular, register) { 12 | 13 | 'use strict'; 14 | 15 | var module = angular.module('app.vendor', []); 16 | 17 | module.controller(register); 18 | 19 | return module.name; 20 | 21 | }); 22 | -------------------------------------------------------------------------------- /site/static/app/configs.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Configs module. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author David I. Lehn 7 | */ 8 | define([ 9 | 'angular', 10 | 'app/configs/settings', 11 | 'app/configs/site', 12 | 'bedrock/app/configs/constants', 13 | 'bedrock/app/configs/data' 14 | ], function(angular) { 15 | 16 | 'use strict'; 17 | 18 | // register configs 19 | var module = angular.module('app.configs', []); 20 | var configs = Array.prototype.slice.call(arguments, 1); 21 | var moduleConfig = {}; 22 | angular.forEach(configs, function(config) { 23 | angular.forEach(config, function(value, key) { 24 | moduleConfig[key] = value; 25 | }); 26 | }); 27 | module.value('config', moduleConfig); 28 | }); 29 | -------------------------------------------------------------------------------- /site/static/app/configs/settings.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Settings config. 3 | * 4 | * Copyright (c) 2014 Digital Bazaar, Inc. All rights reserved. 5 | * 6 | * @author David I. Lehn 7 | */ 8 | define([], function() { 9 | 10 | 'use strict'; 11 | 12 | return { 13 | settings: { 14 | panes: [ 15 | { 16 | templateUrl: '/app/components/identity/identity-settings.html' 17 | }, 18 | { 19 | templateUrl: '/app/components/key/key-settings.html' 20 | }, 21 | { 22 | templateUrl: '/app/components/address/address-settings.html' 23 | }, 24 | { 25 | templateUrl: '/app/components/payment-token/external-account-settings.html' 26 | } 27 | ] 28 | } 29 | }; 30 | 31 | }); 32 | -------------------------------------------------------------------------------- /site/static/css/admin.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010-2012 Digital Bazaar, Inc. All rights reserved. 3 | */ 4 | 5 | /* Admin navigation bar */ 6 | .anav { 7 | background-color: #845; 8 | filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#956', endColorstr='#845'); 9 | background: -webkit-gradient(linear, left top, left bottom, from(#956), to(#845)); 10 | background: -moz-linear-gradient(top, #956, #845); 11 | } 12 | 13 | .anav .tabs a:hover { 14 | background-color: #a67; 15 | } 16 | 17 | 18 | .data { 19 | clear: both; 20 | margin-top: 10px; 21 | padding-top: 10px; 22 | border-top: 1px dotted #eee; 23 | } 24 | 25 | .managers p { 26 | padding: 10px; 27 | border-left: 5px solid #888; 28 | background-color: #eee; 29 | 30 | -moz-box-sizing: border-box; 31 | -webkit-box-sizing: border-box; 32 | box-sizing: border-box; 33 | } 34 | 35 | #select-all { 36 | margin: 0 6px; 37 | } 38 | 39 | .col-select { 40 | width: 20px; 41 | text-align: center; 42 | } 43 | 44 | .col-act { 45 | width: 24px; 46 | text-align: center; 47 | } 48 | 49 | .col-click { 50 | cursor: pointer; 51 | } 52 | 53 | .group-row { 54 | color: #666; 55 | background-color: #eee; 56 | font-weight: bold; 57 | } 58 | 59 | div.details, div.options { 60 | float: left; 61 | width: 50%; 62 | } 63 | 64 | #roles { 65 | position: relative; 66 | } 67 | 68 | table.admin td { 69 | padding: 6px; 70 | } 71 | 72 | table.permission { 73 | width: 100%; 74 | } 75 | 76 | table.permission td { 77 | border-top: 1px solid #ccc; 78 | } 79 | 80 | .permission-row label { 81 | font-weight: normal; 82 | } 83 | -------------------------------------------------------------------------------- /site/static/css/custom.css: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/css/custom.css -------------------------------------------------------------------------------- /site/static/css/ie.css: -------------------------------------------------------------------------------- 1 | /* IE9 rounded corners+gradient bug, fix with SVG */ 2 | .cc-table { 3 | background-image: url("../img/cc-background.svg"); 4 | background-repeat: no-repeat; 5 | background-size: 100% 100%; 6 | filter: none; 7 | } 8 | -------------------------------------------------------------------------------- /site/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/favicon.ico -------------------------------------------------------------------------------- /site/static/fonts/GnuMICR.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/GnuMICR.eot -------------------------------------------------------------------------------- /site/static/fonts/GnuMICR.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/GnuMICR.ttf -------------------------------------------------------------------------------- /site/static/fonts/GnuMICR.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/GnuMICR.woff -------------------------------------------------------------------------------- /site/static/fonts/KreditBack.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditBack.eot -------------------------------------------------------------------------------- /site/static/fonts/KreditBack.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditBack.ttf -------------------------------------------------------------------------------- /site/static/fonts/KreditBack.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditBack.woff -------------------------------------------------------------------------------- /site/static/fonts/KreditFront.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditFront.eot -------------------------------------------------------------------------------- /site/static/fonts/KreditFront.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditFront.ttf -------------------------------------------------------------------------------- /site/static/fonts/KreditFront.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditFront.woff -------------------------------------------------------------------------------- /site/static/fonts/KreditShine.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditShine.eot -------------------------------------------------------------------------------- /site/static/fonts/KreditShine.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditShine.ttf -------------------------------------------------------------------------------- /site/static/fonts/KreditShine.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/fonts/KreditShine.woff -------------------------------------------------------------------------------- /site/static/img/bank-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/img/bank-icon.png -------------------------------------------------------------------------------- /site/static/img/cc-background.svg: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /site/static/img/cc-logos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/img/cc-logos.png -------------------------------------------------------------------------------- /site/static/img/payswarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/img/payswarm.png -------------------------------------------------------------------------------- /site/static/img/scode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/img/scode.png -------------------------------------------------------------------------------- /site/static/img/swarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/digitalbazaar/p3/8709631dc6eb9e2824e5ea8f0aa637cce4b39206/site/static/img/swarm.png -------------------------------------------------------------------------------- /site/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /api/ 3 | Disallow: /session/ 4 | -------------------------------------------------------------------------------- /site/views/about.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% set pageTitle = "About" %} 4 | 5 | {% block content %} 6 | 7 |

{{pageTitle}}

8 | 9 |

PaySwarm enables people that create digital content such as blog posts, 10 | music, film, episodic content, photos, virtual goods, and documents to 11 | distribute their creations through their website and receive payment 12 | directly from their fans and customers. It is an open, patent and royalty 13 | free, universal payment standard for the Web. If you have a passion for 14 | creating things on the Web, or would like to support people doing great things - 15 | PaySwarm is for you. If you would like to learn more about PaySwarm, the 16 | official community website is a good 17 | place to start.

18 | 19 | {% include "credits.html" %} 20 | 21 | {% endblock %} 22 | -------------------------------------------------------------------------------- /site/views/assetora.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% set pageTitle = "Assetora" %} 4 | {% set inav = "assetora" %} 5 | 6 | {% block content %} 7 | 8 | {% raw %} 9 |
10 |
11 |
12 | {% endraw %} 13 | 14 | {% include "demo-warning.html" %} 15 | 16 | {% endblock %} 17 | -------------------------------------------------------------------------------- /site/views/contact.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% set pageTitle = "Contact" %} 4 | 5 | {% block content %} 6 | 7 |

{{pageTitle}}

8 | 9 |
10 |

11 | You may use any of the following methods to contact Digital Bazaar, the 12 | company that operates this PaySwarm developer sandbox. 13 |

14 | 59 |
60 | 61 | {% endblock %} 62 | -------------------------------------------------------------------------------- /site/views/content-portal.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% set pageTitle = "Content Portal" %} 4 | 5 | {% block content %} 6 | 7 | {% raw %} 8 |
9 | 10 |
11 |
12 |

Content Portal

13 |
14 |
15 | 16 |
17 |
18 |
19 | Click the button below to see the content you purchased. 20 |
21 |
23 |
24 | 27 |
28 |
29 | 30 |
31 |
32 |
33 | View content 34 |
35 |
36 |
37 | 38 |
39 | {% endraw %} 40 | 41 | {% include "demo-warning.html" %} 42 | 43 | {% endblock %} 44 | -------------------------------------------------------------------------------- /site/views/demo-warning.html: -------------------------------------------------------------------------------- 1 | {# demo mode alert #} 2 | {% if productionMode == false %} 3 |
4 |
5 | Note: This is a demonstration website that does not use real money. Please do not enter any sensitive personal information. [more info...] 6 |
7 | {% endif %} 8 | -------------------------------------------------------------------------------- /site/views/docs/index.html: -------------------------------------------------------------------------------- 1 | {% extends '../docs/index-base.html' %} 2 | 3 | {% block docsFeaturesListItems %} 4 | {% parent %} 5 |
  • Initiate transactions
  • 6 |
  • Get transaction history
  • 7 | {% endblock %} 8 | -------------------------------------------------------------------------------- /site/views/docs/services.budget.deleteBudget.html: -------------------------------------------------------------------------------- 1 | {% extends '../layout.html' %} 2 | 3 | {% set category = "Budgets" %} 4 | {% set freeLimit = ["by-user"] %} 5 | {% set authentication = ["signature"] %} 6 | {% set validation = null %} 7 | {% set shortDescription = "Removes an existing budget from the system." %} 8 | 9 | {% block content %} 10 | 11 |

    12 |
    13 | {{method}} 14 | {{path}} 15 |
    16 |

    17 | 18 |
    19 | 20 | 21 | 22 | 23 | 24 |
    TopicBudgets
    Rate Limit{{freeLimit[0]}}
    Authentication{{authentication[0]}}
    25 | 26 |
    27 |
    28 |

    29 | {{shortDescription}} 30 |

    31 |
    32 |
    33 | 34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /site/views/identity.disabled.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% set pageTitle = "Identity" %} 4 | {% set clientData.pageTitle = "Identity" %} 5 | 6 | {% block content %} 7 | 8 |

    FIXME: need this to be included in the common bedrock template

    9 | 10 |
    Financial Accounts
    11 | {% if accounts.length > 0 %} 12 |
    13 | 25 |
    26 | {% else %} 27 |
    28 | 31 |
    32 | {% endif %} 33 | 34 | {% endblock %} 35 | -------------------------------------------------------------------------------- /site/views/index.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout.html' %} 2 | 3 | {% set pageTitle = "Welcome" %} 4 | {% set clientData.pageTitle = "Welcome" %} 5 | 6 | {% block content %} 7 | 8 |
    9 |
    10 |

    Welcome

    11 |
    12 |
    13 | 14 |
    15 | 16 |
    17 |
    18 |

    [INTRODUCTION]

    19 |
    20 |
    21 | 22 | {% endblock %} 23 | -------------------------------------------------------------------------------- /site/views/layout.html: -------------------------------------------------------------------------------- 1 | {% extends 'layout-base.html' %} 2 | 3 | {% block prefixes %} 4 | {% parent %} 5 | com: https://w3id.org/commerce# 6 | gr: http://purl.org/goodrelations/v1# 7 | ps: https://w3id.org/payswarm# 8 | {% endblock %} 9 | 10 | {% block headAttrs %} 11 | {% parent %} 12 | {# debug="true" #} 13 | {% endblock %} 14 | 15 | {% block forcedFonts %} 16 | {% parent %} 17 | 18 |
    19 | 20 | 21 | 22 | 23 |
    24 | {% endblock %} 25 | 26 | {% block faqLink %}
  • FAQ
  • {% endblock %} 27 | 28 | {% block copyrightDate %}2013-2014{% endblock %} 29 | -------------------------------------------------------------------------------- /site/views/licenses/blogging.html: -------------------------------------------------------------------------------- 1 | 3 | 7 | 8 | 9 | 10 | Personal Use License for Articles 11 | 12 | 14 |

    Personal Use License for Articles

    15 | 16 |

    17 | The article content owner grants the buyer a non-exclusive perpetual 18 | personal-use license to view, download and copy the article, subject to the 19 | following restrictions: 20 |

    21 | 22 |
      23 |
    1. This license is for personal use only. Personal use means non-commercial 24 | use of the article(s) for display on personal websites and computers, or 25 | making prints for personal use. The articles(s) may not be used in any way 26 | whatsoever in which you charge money, collect fees, or receive any form of 27 | remuneration. The article(s) may not be used in advertising. The articles(s) 28 | may not be resold, relicensed, or sub-licensed. 29 |
    2. 30 |
    3. Title and ownership, and all rights now and in the future, of and for the 31 | article(s) remain exclusively with the content owner. 32 |
    4. 33 |
    5. There are no warranties, express or implied. The articles(s) are provided 34 | 'as is.'
    6. 35 |
    7. Neither the writer, payment processing service, nor hosting service will 36 | be liable for any third party claims or incidental, consequential or other 37 | damages arising out of this license or buyer's use of the article(s). 38 |
    8. 39 |
    40 | 41 | 42 | -------------------------------------------------------------------------------- /site/views/system/dashboard.html: -------------------------------------------------------------------------------- 1 | {% extends '../layout.html' %} 2 | 3 | {% set pageTitle = "System Dashboard" %} 4 | {% set cssList.push("css/system-dashboard") %} 5 | {% set jsList.push("d3/d3.v3") %} 6 | {% set jsList.push("cubism/cubism.v1") %} 7 | {% set jsList.push("modules/system.dashboard") %} 8 | {% set inav = "system-dashboard" %} 9 | 10 | {% block content %} 11 | 12 |
    13 |
    14 |
    15 |

    System Dashboard

    16 |
    17 |
    18 |
    19 | 20 |
    21 |
    22 |
    23 |
    24 |
    25 |
    26 | 27 | {% include "../demo-warning.html" %} 28 | 29 | {% endblock %} 30 | -------------------------------------------------------------------------------- /tests/address-examples/blacksburg.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://w3id.org/payswarm/v1", 3 | "type": "Address", 4 | "name": "First Last", 5 | "streetAddress": "1700 Kraft Drive, Suite 2408", 6 | "addressLocality": "Blacksburg", 7 | "addressRegion": "VA", 8 | "postalCode": "24060", 9 | "addressCountry": "US" 10 | } 11 | -------------------------------------------------------------------------------- /tests/address-examples/london.json: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://w3id.org/payswarm/v1", 3 | "type": "Address", 4 | "name": "British Prime Minister", 5 | "streetAddress": "10 Downing Street", 6 | "addressLocality": "London", 7 | "addressRegion": "", 8 | "postalCode": "", 9 | "addressCountry": "UK" 10 | } 11 | -------------------------------------------------------------------------------- /tests/frontend/e2e/adminLogin.js: -------------------------------------------------------------------------------- 1 | var helper = require('../helper'); 2 | 3 | describe('admin login', function() { 4 | 5 | it('should login from the navbar', function() { 6 | helper.login('admin', 'password'); 7 | helper.waitForUrl('/i/admin/dashboard'); 8 | }); 9 | 10 | it('should logout from the navbar', function() { 11 | helper.logout(); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /tests/frontend/helper.js: -------------------------------------------------------------------------------- 1 | // get bedrock helper 2 | var api = require('../../node_modules/bedrock/tests/frontend/helper'); 3 | module.exports = api; 4 | 5 | api.on('init', function() { 6 | api.selectors = require('./selectors'); 7 | api.pages = require('./pages'); 8 | }); 9 | -------------------------------------------------------------------------------- /tests/frontend/pages/dashboard.js: -------------------------------------------------------------------------------- 1 | var helper = require('../helper.js'); 2 | 3 | // extend bedrock dashboard 4 | var api = require( 5 | '../../../node_modules/bedrock/tests/frontend/pages/dashboard'); 6 | module.exports = api; 7 | 8 | var by = GLOBAL.by; 9 | var element = GLOBAL.element; 10 | var expect = GLOBAL.expect; 11 | 12 | // TODO: implement 13 | -------------------------------------------------------------------------------- /tests/frontend/pages/index.js: -------------------------------------------------------------------------------- 1 | // inherit from bedrock pages 2 | var pages = require('../../../node_modules/bedrock/tests/frontend/pages'); 3 | module.exports = pages; 4 | 5 | // overrides/new 6 | //pages.dashboard = require('./dashboard'); 7 | -------------------------------------------------------------------------------- /tests/frontend/selectors/index.js: -------------------------------------------------------------------------------- 1 | // inherit from bedrock selectors 2 | var selectors = require( 3 | '../../../node_modules/bedrock/tests/frontend/selectors'); 4 | module.exports = selectors; 5 | 6 | // overrides/new 7 | //selectors.paymentToken = require('./paymentToken'); 8 | -------------------------------------------------------------------------------- /tests/payflow-examples/authorize.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "A", 3 | "TENDER": "C", 4 | "ACCT": "4111111111111111", 5 | "EXPDATE": "0113", 6 | "CVV2": "999", 7 | "FIRSTNAME": "Full Name", 8 | "STREET": "1700 Kraft Dr. Ste. 2408", 9 | "CITY": "Blacksburg", 10 | "STATE": "VA", 11 | "ZIP": "24060", 12 | "BILLTOCOUNTRY": "840", 13 | "AMT": "1.00", 14 | "CURRENCY": "USD" 15 | } -------------------------------------------------------------------------------- /tests/payflow-examples/capture.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "D", 3 | "TENDER": "C", 4 | "AMT": "1.00", 5 | "CURRENCY": "USD", 6 | "ORIGID": "12345" 7 | } -------------------------------------------------------------------------------- /tests/payflow-examples/charge-ach.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "S", 3 | "TENDER": "A", 4 | "AUTHTYPE": "WEB", 5 | "FIRSTNAME": "Full Name", 6 | "ACCT": "12345", 7 | "ABA": "12345", 8 | "ACCTTYPE": "C", 9 | "AMT": "1.00" 10 | } -------------------------------------------------------------------------------- /tests/payflow-examples/charge.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "S", 3 | "TENDER": "C", 4 | "ACCT": "4111111111111111", 5 | "EXPDATE": "0113", 6 | "CVV2": "000", 7 | "FIRSTNAME": "Full Name", 8 | "STREET": "123 Elm St.", 9 | "CITY": "Blacksburg", 10 | "STATE": "VA", 11 | "ZIP": "24060", 12 | "BILLTOCOUNTRY": "840", 13 | "AMT": "1.00", 14 | "CURRENCY": "USD" 15 | } -------------------------------------------------------------------------------- /tests/payflow-examples/inquire.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "I", 3 | "ORIGID": "12345" 4 | } -------------------------------------------------------------------------------- /tests/payflow-examples/verify-ach.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "A", 3 | "TENDER": "A", 4 | "AUTHTYPE": "WEB", 5 | "FIRSTNAME": "Full Name", 6 | "ACCT": "12345", 7 | "ABA": "12345", 8 | "ACCTTYPE": "C", 9 | "PRENOTE": "Y", 10 | "AMT": "0.00" 11 | } -------------------------------------------------------------------------------- /tests/payflow-examples/verify-cc.jsonld: -------------------------------------------------------------------------------- 1 | { 2 | "@context": "https://w3id.org/payswarm/v1", 3 | "type": "CreditCard", 4 | "cardBrand": "Visa", 5 | "cardNumber": "4111111111111111", 6 | "cardExpMonth": 1, 7 | "cardExpYear": 2016, 8 | "cardCvm": "000", 9 | "address": { 10 | "name": "Full Name", 11 | "streetAddress": "123 Elm St.", 12 | "addressLocality": "Blacksburg", 13 | "addressRegion": "VA", 14 | "postalCode": "24060", 15 | "addressCountry": "US" 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /tests/payflow-examples/verify.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "A", 3 | "TENDER": "C", 4 | "ACCT": "4111111111111111", 5 | "EXPDATE": "0113", 6 | "CVV2": "999", 7 | "FIRSTNAME": "Full Name", 8 | "STREET": "1700 Kraft Dr. Ste. 2408", 9 | "CITY": "Blacksburg", 10 | "STATE": "VA", 11 | "ZIP": "24060", 12 | "BILLTOCOUNTRY": "840", 13 | "AMT": "0", 14 | "CURRENCY": "USD" 15 | } -------------------------------------------------------------------------------- /tests/payflow-examples/void.json: -------------------------------------------------------------------------------- 1 | { 2 | "TRXTYPE": "V", 3 | "ORIGID": "12345" 4 | } -------------------------------------------------------------------------------- /tests/usaepay-examples/bankaccount.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "BankAccount", 3 | "bankRoutingNumber": "123456789", 4 | "bankAccount": "00001234", 5 | "bankAccountType": "Checking", 6 | "address": { 7 | "name": "Baron Von Test", 8 | "streetAddress": "1700 Kraft Dr. Ste. 2408", 9 | "addressLocality": "Blacksburg", 10 | "addressRegion": "VA", 11 | "postalCode": "24060", 12 | "addressCountry": "US" 13 | } 14 | } 15 | --------------------------------------------------------------------------------