8000 move usage charge · n00bdevel/example-ruby-app@f1ea428 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1ea428

Browse files
committed
move usage charge
1 parent 5662409 commit f1ea428

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

02 Charging For Your App/app.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ def initialize
7979
return [403, "You're not authorized to perform this action."]
8080
end
8181

82-
create_usage_charge
8382
# parse the request body as JSON data
8483
json_data = JSON.parse data
8584

@@ -92,6 +91,7 @@ def initialize
9291

9392
variant.metafields.each do |field|
9493
if field.key == 'ingredients'
94+
create_usage_charge
9595
items = field.value.split(',')
9696

9797
items.each do |item|

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Shopify App Examples
22

3-
This repository is home to the code examples highlighted in various [Shopify API tutorials](http://docs.myshopify.io/api/tutorials/). They are designed solely for the purposes of introducing new developers to the Shopify API. The example apps are written in [Sinatra](https://github.com/sinatra/sinatra), but the concepts presented will also apply to developers building applications in other languages such as Python, Node.js and PHP.
3+
This repository is home to the code examples highlighted in various [Shopify API tutorials](http://docs.myshopify.io/api/tutorials/). They are designed solely for the purpose of introducing new developers to the Shopify API. The example apps are written in [Sinatra](https://github.com/sinatra/sinatra), but the concepts presented will also apply to developers building applications in other languages such as Python, Node.js and PHP.
44

55
## Tutorial index
66

@@ -35,13 +35,5 @@ This tutorial series uses [ngrok](https://ngrok.com/) to create a secure tunnel
3535

3636
## Running the app
3737

38-
``` sh
39-
# navigate to the correct tutorial
40-
$ cd 01\ Getting\ Started/
41-
# create the .env and copy your API key and API secret values
42-
$ echo $'API_KEY=YOUR_API_KEY\nAPI_SECRET=YOUR_SECRET_KEY' >.env
43-
# install dependencies
44-
$ bundle install
45-
# run the app
46-
$ ruby app.rb
47-
```
38+
`bundle install`
39+
`ruby app.rb`

0 commit comments

Comments
 (0)
0