Commit log

678283b Object representing the backend SGX to use

Click to expand commit body
This is what should know about things like the customer id -> jid mapping, etc.

Stephen Paul Weber created

93919ac Stop polluting Object namespace with Blather DSL

Stephen Paul Weber created

946b50d Work in the presence of em-synchrony

Click to expand commit body
em-synchrony monkeypatches em-http when loaded. The old functionality is still
present, but under different method names.

Stephen Paul Weber created

210ab8c Helper to allow ordering phone number from Bandwidth v2

Click to expand commit body
Uses their gem which uses Faraday. Set Faraday to em-synchrony so their gem is
now using EventMachine but still sync so their code will work unchanged.  Wrap
all uses of the gem in EM.promise_fiber to get a promise back out of that.

Implement a poll helper that can wait until a new order is complete at Bandwidth
before continuing.  They support an HTTP callback method, but only global on
account? This is much easier to work with in our context.

Stephen Paul Weber created

2701f96 Helper to get a promise that resolves after N seconds

Stephen Paul Weber created

82bf4d3 Every payment kind will need the plan, so put it at the top

Stephen Paul Weber created

1448fc7 Use registration pattern for Payment kinds

Click to expand commit body
Instead of a hard-coded case statement.

Stephen Paul Weber created

c08d6ea Method to bill the plan of a Customer

Click to expand commit body
Bills their balance for the cost of one month of plan.
Activates the plan by insert into plan_log, unless already active in which case
extends current plan by one month.

Stephen Paul Weber created

e956460 Use Forwardable for simple delegations

Stephen Paul Weber created

3a0f5bf Helper to allow using sync-style code in a Promise context

Click to expand commit body
This helper spins up a fiber and returns an unresolved EMPromise, then runs the
passed-in block inside the fiber and fulfills the promise with the result of the
block. Because nothing is looking for the Fiber to return it is free to act as a
trampoline for EMPromise#sync and other fiber-sync-style code that does not
block the EM reactor.

Stephen Paul Weber created

d1f8b6a New signup: go to web to choose credit card

Click to expand commit body
This step, if chosen, directs the user to the jmp-pay webapp to add a credit
card.  It includes an OOB element for use by user agents that can handle
that (possibly for webview embed, etc) with a note-based fallback as per XEP.
Once the user chooses "next" the code checks if they have actually added a card,
and if so continues to a yet-unimplemented step and if not repeats the
instruction to go to the web app.

Stephen Paul Weber created

c3795a6 OOB helper

Click to expand commit body
https://xmpp.org/extensions/xep-0066.html

Stephen Paul Weber created

9d3db6e Reject promise on stanza error

Stephen Paul Weber created

f699177 Fix typo

Click to expand commit body
This result variable got renamed to registered

Stephen Paul Weber created

9c5695e Merge branch 'register-command-first-pass'

Click to expand commit body
* register-command-first-pass:
  Add sourcehut CI
  Add Rakefile to run all tests
  Initial registration flow for Bitcoin
  Registrations that start on the web will have a tel selected already
  Helpers for doing Electrum RPC
  Add helper to fetch current BTC sell prices
  Allow skipping tests without being caught in pry

Stephen Paul Weber created

d719f18 Add sourcehut CI

Stephen Paul Weber created

1f37649 Add Rakefile to run all tests

Stephen Paul Weber created

f79ca96 Initial registration flow for Bitcoin

Click to expand commit body
This is the Bitcoin "happy path" where there is already a tel and a customer_id.
Gets all the way to generating a BTC address for payment and quoting an amount.
Stubs out flows for credit card and activation code as well, but does not
implement those flows.

TBD: after bitcoin payment comes in and jmp-pay activates the account, we should
come back here to actually buy the number, select a new one if no longer
available, etc.

Stephen Paul Weber created

39685c1 Registrations that start on the web will have a tel selected already

Click to expand commit body
So, manage any already-known tel selections and allow registration to use them
right away.  In the future this will fall back to letting the user search for a
tel over XMPP, but that is not implemented here.

Stephen Paul Weber created

8cb7c18 Helpers for doing Electrum RPC

Stephen Paul Weber created

829d69d Add helper to fetch current BTC sell prices

Click to expand commit body
Scrapes the sell price for Bitcoin from canadianbitcoins.com
USD price is done by converting this CAD sell price to USD via openexchangerates

Stephen Paul Weber created

963e24d Allow skipping tests without being caught in pry

Stephen Paul Weber created

4be555d Split logic out into testable objects

Click to expand commit body
Rubocop clean. Good test coverage of helper objects.

Stephen Paul Weber created

e5730b6 Currency aware

Click to expand commit body
Look up the user's plan to find out what currency to charge them in.

Stephen Paul Weber created

ef6cc23 Submit for settlement

Click to expand commit body
We'd like to actually get the money, not just be allowed to.

Stephen Paul Weber created

a0c9834 Rubocop fixes

Stephen Paul Weber created

b12d609 README

Stephen Paul Weber created

2de0c42 Always show money with two decimal places

Stephen Paul Weber created

9dd19f4 Only ask which card to use if there is more than one

Stephen Paul Weber created

579c4fe Write initial buy credit command

Stephen Paul Weber created

d0f1728 Initial commit

Click to expand commit body
Supports registering with backend SGX via basic iq:register.

Does not support data forms version with nice labels.

Does not verify billing or anything else yet, just unconditionally registers the user.

Stephen Paul Weber created