ACH Payment status

61 views
Skip to first unread message

Avgeorge

unread,
Jan 10, 2017, 7:21:05 AM1/10/17
to Stripe API Discussion
Hello,

I am unable to pull the status of an ACH payment via the API.

I am creating the charge successfully as follows:

chargeDetails = stripe.Charge.create(
                            amount=total_inv_amount_cents,
                            currency="usd",
                            description=inv_description,
                            application_fee=agg_claim_amount_cents,
                            source=chargeToken,
                            stripe_account=seller_stripe_details.stripe_user_id
                        )

CHARGE DETAILS
(Pdb) chargeDetails
<Charge charge id=py_19aJvnGVSJlmBwscYPWGQhIN at 0x96127e8> JSON: {
  "amount": 101750,
  "amount_refunded": 0,
  "application": "ca_9qLPd2LPRduB1z15gqlGuqKFhUMyf2uk",
  "application_fee": "fee_9u8C4T8agepdfb",
  "balance_transaction": "txn_19aJvnGVSJlmBwscFLjlSbsz",
  "captured": true,
  "created": 1484032831,
  "currency": "usd",
  "customer": null,
  "description": "Delivery dated: 2017-01-10. ",
  "destination": null,
  "dispute": null,
  "failure_code": null,
  "failure_message": null,
  "fraud_details": {},
  "id": "py_19aJvnGVSJlmBwscYPWGQhIN",
  "invoice": null,
  "livemode": false,
  "metadata": {},
  "object": "charge",
  "order": null,
  "outcome": {
    "network_status": "approved_by_network",
    "reason": null,
    "risk_level": "not_assessed",
    "seller_message": "Payment complete.",
    "type": "authorized"
  },
  "paid": false,
  "receipt_email": null,
  "receipt_number": null,
  "refunded": false,
  "refunds": {
    "data": [],
    "has_more": false,
    "object": "list",
    "total_count": 0,
    "url": "/v1/charges/py_19aJvnGVSJlmBwscYPWGQhIN/refunds"
  },
  "review": null,
  "shipping": null,
  "source": {
    "account_holder_name": "Avran TEst",
    "account_holder_type": "company",
    "bank_name": "STRIPE TEST BANK",
    "country": "US",
    "currency": "usd",
    "customer": null,
    "fingerprint": "xPoVfiqSCXQQhAMC",
    "id": "ba_19aJvbGVSJlmBwsch9I3W40J",
    "last4": "6789",
    "metadata": {},
    "object": "bank_account",
    "routing_number": "110000000",
    "status": "verified"
  },
  "source_transfer": null,
  "statement_descriptor": null,
  "status": "pending"
}

The charge ID
(Pdb) chargeDetails.id
u'py_19aJvnGVSJlmBwscYPWGQhIN'

Retriging the charge details throws an error
(Pdb) stripe.Charge.retrieve(chargeDetails.id)
[INFO 2017-01-10 13:05:10,352] util.py [:98] log_info: Request to Stripe api
[DEBUG 2017-01-10 13:05:10,354] util.py [:92] log_debug: Post details
[INFO 2017-01-10 13:05:10,357] connectionpool.py [:805] _new_conn: Starting new HTTPS connection (1
[DEBUG 2017-01-10 13:05:11,665] connectionpool.py [:401] _make_request: "GET /v1/charges/py_19aJvnG
[INFO 2017-01-10 13:05:11,671] util.py [:98] log_info: Stripe API response
[DEBUG 2017-01-10 13:05:11,673] util.py [:92] log_debug: API response body
[DEBUG 2017-01-10 13:05:11,673] util.py [:92] log_debug: Dashboard link for request
[INFO 2017-01-10 13:05:11,674] util.py [:98] log_info: Stripe API error received
*** InvalidRequestError: Request req_9u8Qp2SVvvelnu: No such charge: py_19aJvnGVSJlmBwscYPWGQhIN

I am able to do a refund on the same ID (py_19aJvnGVSJlmBwscYPWGQhIN) so I'm unsure why I cant retrieve the status of the payment.

An ACH payment is set to 'pending' until the payment is complete and we would like to check for the status of this payment. Any help in doing so would be appreciated.

Thank you,
Avran

Remi J.

unread,
Jan 10, 2017, 7:29:19 AM1/10/17
to api-d...@lists.stripe.com
Hey Avran,

The issue here is the way you are trying to retrieve the charge. You have created the charge on one of your connected accounts by passing that account's id in the `stripe_account` parameter. Since that Charge is on the connected account, you can't retrieve it on your platform account as it doesn't exist there. You have to explicitly tell us on which account you want to make the Retrieve Charge API [1] request. This is done by using the same `stripe_account` parameter in all your API requests that you make on behalf of a connected account as covered in the `Stripe-Account` documentation [2].

In Python, your code to retrieve the Charge would be:

stripe.Charge.retrieve(id=chargeDetails.id, stripe_account=seller_stripe_details.stripe_user_id)

Once you do this, you'll get that Charge object and you can then check the `status` field as expected.

Hope this helps!
Remi


--
You received this message because you are subscribed to the Google Groups "Stripe API Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss+unsubscribe@lists.stripe.com.
To post to this group, send email to api-d...@lists.stripe.com.
Visit this group at https://groups.google.com/a/lists.stripe.com/group/api-discuss/.

Avgeorge

unread,
Jan 11, 2017, 8:36:01 AM1/11/17
to Stripe API Discussion
Thanks a lot Remi. I was able to figure it out but couldn't update the moderated message.

Avran
To unsubscribe from this group and stop receiving emails from it, send an email to api-discuss...@lists.stripe.com.
Reply all
Reply to author
Forward
0 new messages