forked from rauversion/rauversion-phx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* orders stripe * QR code, ticket display * order test * controller tests * orders, activate ticket * tweaks * tests * fix player dup * app * tbk mall * oauth token twitch * transbank pst code * my tickets * ticket filters * events comment sections * events overview, purchases info * handle purchase order with zero count tickets * ticket purchase from tbk * fix duplicate tbk gen tickets * Event performers (rauversion#65) * blob utils, dry * event performers, added * pot extract * prose invert on track description * Auto stash before checking out "origin/orders" * user invitations * live view upgrade * hosts * free ticket added, handled success message * forms * pot extract * profile header image * event tickets force to log in
- Loading branch information
Showing
85 changed files
with
3,529 additions
and
997 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Accounts | ||
|
||
```elixir | ||
alias Rauversion.Accounts | ||
alias Rauversion.Accounts.User | ||
``` | ||
|
||
## send invitation | ||
|
||
```elixir | ||
user = Accounts.invite_user(%User{}, %{email: "[email protected]"}) | ||
``` | ||
|
||
```elixir | ||
alias RauversionWeb.Router.Helpers, as: Routes | ||
|
||
conn = RauversionWeb.Endpoint | ||
|
||
Accounts.deliver_user_invitation_instructions( | ||
user, | ||
&Routes.user_invitation_url(conn, :accept, &1) | ||
) | ||
``` | ||
|
||
```elixir | ||
Routes.user_invitation_path(conn, :update_user, "123", 1, []) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Rauversion | ||
|
||
## Transbank account | ||
|
||
Card type Detail Outcome | ||
VISA 4051 8856 0044 6623 CVV 123 any expiration date Generate approved transactions. | ||
|
||
AMEX 3700 0000 0002 032 CVV 1234 any expiration date Generate approved transactions. | ||
|
||
MASTERCARD 5186 0595 5959 0568 CVV 123 any expiration date Generate declined transactions. | ||
|
||
Redcompra 4051 8842 3993 7763 Genera transacciones aprobadas (para operaciones que permiten débito Redcompra) | ||
|
||
Redcompra 4511 3466 6003 7060 Genera transacciones aprobadas (para operaciones que permiten débito Redcompra) | ||
|
||
Redcompra 5186 0085 4123 3829 Genera transacciones rechazadas (para operaciones que permiten débito Redcompra) | ||
|
||
Prepago VISA 4051 8860 0005 6590 CVV 123 cualquier fecha de expiración Generate approved transactions. | ||
|
||
Prepago MASTERCARD 5186 1741 1062 9480 CVV 123 | ||
|
||
cualquier fecha de expiración Generate declined transactions. | ||
When an authentication form with RUT and password appears, RUT 11.111.111-1 and password 123 must be used . | ||
|
||
<!-- livebook:{"break_markdown":true} --> | ||
|
||
### STATUS OF TRANSATION | ||
|
||
```elixir | ||
commerce_code = Transbank.Common.IntegrationCommerceCodes.webpay_plus_mall() | ||
api_key = Transbank.Common.IntegrationApiKeys.webpay() | ||
environment = Transbank.Webpay.WebpayPlus.MallTransaction.default_environment() | ||
trx = Transbank.Webpay.WebpayPlus.MallTransaction.new(commerce_code, api_key, environment) | ||
# token = "01abd19e55cbd787859f2345ae09b8c9c52e22388d72921c074ddb6d42c6aecf" | ||
token = "01ab5bd6112f806c74b54ec640de73373a86190444b03d75973633367a100d62" | ||
|
||
trx = Transbank.Webpay.WebpayPlus.MallTransaction.new(commerce_code, api_key, environment) | ||
|
||
{:ok, data} = Transbank.Webpay.WebpayPlus.MallTransaction.commit(trx, token) | ||
|
||
IO.inspect(data) | ||
|
||
Transbank.Webpay.WebpayPlus.MallTransaction.status(trx, token) | ||
``` | ||
|
||
```elixir | ||
a = %{data: [%{count: 0, ticket_id: 1}, %{count: 0, ticket_id: 2}]} | ||
|
||
a[:data] |> Enum.filter(fn x -> x.count != 0 end) | ||
|
||
Enum.to_list(1..1) | ||
``` | ||
|
||
```elixir | ||
{platform_fee, _} = Float.parse(Application.get_env(:rauversion, :platform_event_fee)) | ||
total = 2000 | ||
fee_amount = total / (platform_fee * 100.0) | ||
|
||
platform_fee | ||
Kernel.round(fee_amount) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
defmodule Rauversion.Accounts.Settings do | ||
use Ecto.Schema | ||
import Ecto.Changeset | ||
|
||
embedded_schema do | ||
field :pst_enabled, :boolean | ||
field :tbk_commerce_code, :string | ||
field :tbk_test_mode, :boolean | ||
end | ||
|
||
@required_fields [] | ||
@optional_fields [ | ||
:pst_enabled, | ||
:tbk_commerce_code, | ||
:tbk_test_mode | ||
] | ||
|
||
def changeset(struct, attrs) do | ||
struct | ||
|> cast(attrs, @required_fields ++ @optional_fields) | ||
|> validate_required(@required_fields) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.