Search code examples
pythonapiyandex-api

Yandex_money_api: illegal_param_ext_auth_success_uri


I try to do a payment with api yandex money. I use

instance_id = ExternalPayment.get_instance_id(client_id)['instance_id']
api = ExternalPayment(instance_id)
def wallet_payments(access_token, ym_account, total, api):
    wallet = Wallet(access_token)
    request_options = {
    "pattern_id": "p2p",
    "to": ym_account,
    "amount_due": total,
    "comment": "test payment comment from yandex-money-python",
    "message": "test payment message from yandex-money-python",
    "label": "testPayment",
    "test_payment": True,
    "test_result": "success"
    }

    request_result = api.request(request_options)
    process_payment = api.process({
    "request_id": request_result['request_id'],
    })
    return process_payment['status']

request_result['status'] returns success, but after

`process_payment = api.process({
    "request_id": request_result['request_id'],
    })`

I get {'status': 'refused', 'error': 'illegal_param_ext_auth_success_uri'}. How can I solve that?


Solution

  • From the yandex documentation:

    illegal_param_ext_auth_success_uri:
    The ext_auth_success_uri parameter has a missing or invalid value.

    So you probably need to define a ext_auth_success_uri parameter which will be a listener url that receive yandex api response in case of success.

    And you probably will need this one too which is the same but in case of error:

    illegal_param_ext_auth_fail_uri:
    The ext_auth_fail_uri parameter has a missing or invalid value.

    source: https://tech.yandex.com/money/doc/dg/reference/process-payment-docpage/