Skip to content

Commit

Permalink
Update document for change from dollars to cents
Browse files Browse the repository at this point in the history
  • Loading branch information
fangpenlin committed Oct 15, 2013
1 parent 31063ff commit d68a0b2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
18 changes: 9 additions & 9 deletions docs/source/api_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Parameters
closest day to the started one in a month will be selected for following
transactions. For example, the started date time is 2013-01-30, then
following transactions will occur at 2013-02-28, 2013-03-30 and so on.
- **amount** - The amount in USD dollar to charge or payout to customer
- **amount** - The amount in USD cents to charge or payout to customer
- **interval** - (optional) The interval of frequency period to multiply,
the default value is 1. For example, to charge or payout a customer
by two weeks frequency, you can set the frequency to **weekly**, and set
Expand All @@ -139,7 +139,7 @@ Example:
curl https://billing.balancedpayments.com/v1/plans \
-u 6w9KwCPCmCQJpEYgCCtjaPmbLNQSavv5sX4mCZ9Sf6pb: \
-d "plan_type=charge" \
-d "amount=5" \
-d "amount=500" \
-d "frequency=monthly"

Response:
Expand All @@ -151,7 +151,7 @@ Response:
"company_guid": "CPMM8C8Uhkt4pDeJ8oqJu8Nj",
"plan_type": "charge",
"interval": 1,
"amount": "5.00",
"amount": 500,
"frequency": "monthly",
"deleted": false,
"created_at": "2013-10-02T05:48:26.210843",
Expand Down Expand Up @@ -184,7 +184,7 @@ Response:
"company_guid": "CPMM8C8Uhkt4pDeJ8oqJu8Nj",
"plan_type": "charge",
"interval": 1,
"amount": "5.00",
"amount": 500,
"frequency": "monthly",
"deleted": false,
"created_at": "2013-10-02T05:48:26.210843",
Expand Down Expand Up @@ -218,7 +218,7 @@ Response:
"company_guid": "CPMM8C8Uhkt4pDeJ8oqJu8Nj",
"plan_type": "charge",
"interval": 1,
"amount": "5.00",
"amount": 500,
"frequency": "monthly",
"deleted": true,
"created_at": "2013-10-02T05:48:26.210843",
Expand Down Expand Up @@ -256,7 +256,7 @@ Response:
"company_guid": "CPMM8C8Uhkt4pDeJ8oqJu8Nj",
"plan_type": "charge",
"interval": 1,
"amount": "5.00",
"amount": 500,
"frequency": "monthly",
"deleted": false,
"created_at": "2013-10-02T05:48:26.210843",
Expand Down Expand Up @@ -436,7 +436,7 @@ Parameters
- **customer_guid** - The GUID of customer to subscribe
- **payment_uri** - (optional) The URI to funding source in Balanced,
could be a tokenlized credit card or bank account URI
- **amount** - (optional) The amount in USD dollar of this subscription for
- **amount** - (optional) The amount in USD cents of this subscription for
overwriting the one from plan, useful for giving a discount to customer
- **started_at** - (optional) The date time of this subscription to started
at, should be in ISO 8601 format.
Expand Down Expand Up @@ -640,7 +640,7 @@ Response:
"subscription_guid": "SUWRtr1b8s5tejhEPejybvwR",
"status": "done",
"transaction_type": "charge",
"amount": "5.00",
"amount": 500,
"payment_uri": "/v1/marketplaces/TEST-MP7hkE8rvpbtYu2dlO1jU2wg/cards/CC5ildoSnySGnXRfrYvH49eo",
"external_id": "/v1/marketplaces/TEST-MP7hkE8rvpbtYu2dlO1jU2wg/debits/WD5P9jvc7fLSoA6gYXxHkPd4",
"failure_count": 0,
Expand Down Expand Up @@ -681,7 +681,7 @@ Response:
"subscription_guid": "SUWRtr1b8s5tejhEPejybvwR",
"status": "done",
"transaction_type": "charge",
"amount": "5.00",
"amount": 500,
"payment_uri": "/v1/marketplaces/TEST-MP7hkE8rvpbtYu2dlO1jU2wg/cards/CC5ildoSnySGnXRfrYvH49eo",
"external_id": "/v1/marketplaces/TEST-MP7hkE8rvpbtYu2dlO1jU2wg/debits/WD5P9jvc7fLSoA6gYXxHkPd4",
"failure_count": 0,
Expand Down
15 changes: 8 additions & 7 deletions docs/source/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,17 @@ want to create a Billy plan for the first hosting plan, then here we call
-X POST \
-u 6w9KwCPCmCQJpEYgCCtjaPmbLNQSavv5sX4mCZ9Sf6pb: \
-d "plan_type=charge" \
-d "amount=5" \
-d "amount=500" \
-d "frequency=monthly"


As we mentioned above, to call API other than the one for registering a
company, you need to pass your API key, it's simple, all you need to do is
set it as the username for HTTP authentication. You want to charge your hosting
service customer periodically, so the `plan_type` is `charge` here. The price
for the plan is 5 USD dollars, so here you set the `amount` to `5`. And
finally, it is a monthly plan, so you set the `frequency` to `monthly`.
for the plan is 5 USD dollars, but all amounts of Billy are in cents, so here
you set the `amount` to `500`. And finally, it is a monthly plan, so you set the
`frequency` to `monthly`.

Here we are, you should see the response

Expand All @@ -88,7 +89,7 @@ Here we are, you should see the response
"company_guid": "CPMM8C8Uhkt4pDeJ8oqJu8Nj",
"plan_type": "charge",
"interval": 1,
"amount": "5.00",
"amount": 500,
"frequency": "monthly",
"deleted": false,
"created_at": "2013-10-02T05:48:26.210843",
Expand Down Expand Up @@ -188,7 +189,7 @@ to one of your old customers. In this case, you can pass an optional parameter

In the context of our hosting plan story, you want to give a 30% discount to
an old customer, the original price is $5 USD, so the discounted amount would be
3.5. Then here you can call
350 cents. Then here you can call

::

Expand All @@ -197,7 +198,7 @@ an old customer, the original price is $5 USD, so the discounted amount would be
-d "customer_guid=CUR1omRKGYYhqNaK1SyZqSbZ" \
-d "plan_guid=PL97ZvyeA4wzM3WUyEG8xwps" \
-d "payment_uri=/v1/marketplaces/TEST-MP7hkE8rvpbtYu2dlO1jU2wg/cards/CC1dEUPMmL1ljk4hWqeJxGno"
-d "amount=3.5"
-d "amount=350"

Schedule your subscription at a specific time
---------------------------------------------
Expand Down Expand Up @@ -280,5 +281,5 @@ customer, just call

curl https://billing.balancedpayments.com/v1/subscriptions/SUR6jKqqSyaFfGeeAsGaXFqZ/cancel \
-u 6w9KwCPCmCQJpEYgCCtjaPmbLNQSavv5sX4mCZ9Sf6pb: \
-d "refund_amount=5"
-d "refund_amount=500"

0 comments on commit d68a0b2

Please sign in to comment.