This file contains hidden or 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
| const getRawBody = require("raw-body"); | |
| const { updateUserByCustomerId } = require("./_db.js"); | |
| const stripe = require("stripe")(process.env.STRIPE_SECRET_KEY, { | |
| apiVersion: process.env.STRIPE_API_VERSION, | |
| }); | |
| // Disable next.js body parsing (stripe needs the raw body to validate the event) | |
| export const config = { | |
| api: { |
This file contains hidden or 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
| <?php | |
| /** | |
| * Handle calculating a percentage/fraction (proration) we should charge the | |
| * user for based on the current day of the month before their next bill cycle. | |
| * To use yourself, implement a getSubscription method which returns an object | |
| * containing current_period_start and current_period_end DateTime objects. | |
| * | |
| * @access public | |
| * @return float |
This file contains hidden or 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
| // SPDX-License-Identifier: AGPL-3.0-or-later | |
| // The ABI encoder is necessary, but older Solidity versions should work | |
| pragma solidity ^0.7.0; | |
| pragma experimental ABIEncoderV2; | |
| // These definitions are taken from across multiple dydx contracts, and are | |
| // limited to just the bare minimum necessary to make flash loans work. | |
| library Types { | |
| enum AssetDenomination { Wei, Par } |