This repository was archived by the owner on Feb 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Expand file tree Collapse file tree 1 file changed +2
-24
lines changed Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ def log_info(message)
37
37
key . to_json
38
38
end
39
39
40
- post '/charge ' do
40
+ post '/capture_payment ' do
41
41
authenticate!
42
42
# Get the credit card details submitted
43
43
payload = params
@@ -91,31 +91,9 @@ def authenticate!
91
91
@customer
92
92
end
93
93
94
- # This endpoint is used by the Obj-C and Android example apps to create a charge.
95
- post '/create_charge' do
96
- # Create and capture the PaymentIntent via Stripe's API - this will charge the user's card
97
- begin
98
- payment_intent = create_and_capture_payment_intent (
99
- params [ :amount ] ,
100
- params [ :source ] ,
101
- params [ :payment_method ] ,
102
- nil ,
103
- params [ :metadata ] ,
104
- 'usd' ,
105
- nil
106
- )
107
- rescue Stripe ::StripeError => e
108
- status 402
109
- return log_info ( "Error: #{ e . message } " )
110
- end
111
-
112
- status 200
113
- return payment_intent . to_json
114
- end
115
-
116
94
# This endpoint is used by the mobile example apps to create a PaymentIntent.
117
95
# https://stripe.com/docs/api/payment_intents/create
118
- # Just like the `/create_charge ` endpoint, a real implementation would include controls
96
+ # Just like the `/capture_payment ` endpoint, a real implementation would include controls
119
97
# to prevent misuse
120
98
post '/create_intent' do
121
99
begin
You can’t perform that action at this time.
0 commit comments