Skip to content

Instantly share code, notes, and snippets.

@appsgenii
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save appsgenii/916ad4d2439ff30c7c34 to your computer and use it in GitHub Desktop.

Select an option

Save appsgenii/916ad4d2439ff30c7c34 to your computer and use it in GitHub Desktop.
Stripe Payment Issue
When I am trying to authorized charge then I am getting sucess response with
stripe_charge = Stripe::Charge.create(
{
amount: 1000,
currency: "usd",
source: stripe_token.id,
description: "Charge for Invoice",
application_fee: 100,
capture: false
},
merchant.stripe_access_token
)
#<Stripe::Charge:0x5b79f1c id=ch_16JuiSFmS48Gei9NoOg2EHvK> JSON: {
"id": "ch_16JuiSFmS48Gei9NoOg2EHvK",
"object": "charge",
"created": 1435793648,
"livemode": false,
"paid": true,
"status": "succeeded",
"amount": 7978,
"currency": "usd",
"refunded": false,
"source": {"id":"card_16JuiSFmS48Gei9NbRkIBnGA","object":"card","last4":"0005","brand":"American Express","funding":"credit","exp_month":7,"exp_year":2015,"fingerprint":"lxL3hSEmg0ZWIOXd","country":"US","name":"Keeley Parisian","address_line1":null,"address_line2":null,"address_city":null,"address_state":null,"address_zip":null,"address_country":null,"cvc_check":null,"address_line1_check":null,"address_zip_check":null,"tokenization_method":null,"dynamic_last4":null,"metadata":{},"customer":null},
"captured": false,
"balance_transaction": null,
"failure_message": null,
"failure_code": null,
"amount_refunded": 0,
"customer": null,
"invoice": null,
"description": "Charge for Invoice #60z34d786d",
"dispute": null,
"metadata": {},
"statement_descriptor": null,
"fraud_details": {},
"receipt_email": null,
"receipt_number": null,
"shipping": null,
"destination": null,
"application_fee": null,
"refunds": {"object":"list","total_count":0,"has_more":false,"url":"/v1/charges/ch_16JuiSFmS48Gei9NoOg2EHvK/refunds","data":[]}
}
Now when I am trying to capture then I am getting error.
charge = Stripe::Charge.retrieve("ch_16JuiSFmS48Gei9NoOg2EHvK")
#<Stripe::InvalidRequestError: (Status 404) There is no payment with ID ch_16JuiSFmS48Gei9NoOg2EHvK.>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment