Quantcast
Channel: Square Developer Forums - Latest topics
Viewing all articles
Browse latest Browse all 1491

Square Payment Api

$
0
0

I am having issues with the payment api for customers on file. I am able to obtain the source ID but the actual creation of payment is failing in production even though it was working in sandbox. I have updated the tokens for production. I have also verfied the cutsomer_id. I just don’t know what I am doing wrong. Here is my request random_uuid = uuid.uuid4()
idempotency_key = f"{int(time.time())}_{str(random_uuid)[:15]}"

                response = square_client.payments.create_payment(
                    body={
                        "source_id": "ccof:customer-card-id-ok",
                        "idempotency_key": idempotency_key,
                        "amount_money": {
                            'amount': amount_in_cents,
                            'currency': 'USD',
                        },
                        "autocomplete": False,
                        "customer_id": customer_id,
                        "accept_partial_authorization": False
                  

                    }


                )

And the Response {
“errors”: [
{
“code”: “NOT_FOUND”,
“detail”: “Did not find matching card”,
“field”: “source_id”,
“category”: “INVALID_REQUEST_ERROR”
}
]
}. My Square ID is sq0idp-2fg-YHsBRXzYeZT3EjRZXA

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 1491

Latest Images

Trending Articles



Latest Images