创建新的结算设置Google-ads-api时是否为NO_SIGNUP_PERMISSION?

时间:2019-09-13 07:59:43

标签: google-adwords google-ads-api

我正在尝试设置帐户级别的Biiling设置,然后再设置google-ads-api creating new billing setups。如其建议

  

要使用现有的Payments帐户进行注册,请将pays_account设置为有效的Payments帐户的资源ID(不应设置payments_account_info)。

我对以下代码感到厌倦:

INFO:tensorflow:Running local_init_op.
INFO:tensorflow:Done running local_init_op.
INFO:tensorflow:Saving checkpoints for 0 into /data/translation/multi-problem/hi2en/model/512-3-1-1024/de2en.hi2en/c19cfad259cad911/model.ckpt.
bash: line 1:  4153 Segmentation fault      (core dumped) env "CUDA_VISIBLE_DEVICES"="0" "LIBRARY_ROOTS"="/Users/username/Library/Caches/PyCharm2018.2/remote_sou...

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

执行脚本后,我得到如下错误:


from __future__ import absolute_import

import argparse
import six
import sys
import os
import google.ads.google_ads.client

GG_DEVELOP_TOKEN = "GG_DEVELOP_TOKEN"


def main(client, customer_id):
    billing_setup_service = client.get_service('BillingSetupService',
                                               version='v2')

    # Create billing setup operation.
    billing_setup_operation = client.get_type('BillingSetupOperation',
                                              version='v2')
    setup = billing_setup_operation.create
    payments_accounts_path = "customers/{}/paymentsAccounts/{}".format(customer_id, "payments_account_id")

    setup.payments_account.value = payments_accounts_path
    setup.start_time_type = client.get_type("TimeTypeEnum").NOW

    try:
        billing_setup_response = billing_setup_service.mutate_billing_setup(
            customer_id, billing_setup_operation)
        print(billing_setup_response)
    except google.ads.google_ads.errors.GoogleAdsException as ex:
        print(ex)


if __name__ == '__main__':
    # GoogleAdsClient will read the google-ads.yaml configuration file in the
    # home directory if none is specified.

    credentials_dict_lb = {"token_uri": "https://oauth2.googleapis.com/token", "token": None, "scopes": ["https://www.googleapis.com/auth/adwords", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/userinfo.email", "openid"], "client_id": "client_id", "refresh_token": "refresh_token", "client_secret": "client_secret"}

    credentials_m = google.oauth2.credentials.Credentials(**credentials_dict_lb)

    google_ads_client = google.ads.google_ads.client.GoogleAdsClient(credentials_m, GG_DEVELOP_TOKEN, login_customer_id='6384836037')


    parser = argparse.ArgumentParser(
        description=('Removes billing setup for specified customer and billing '
                     'setup ID.'))
    # The following argument(s) should be provided to run the example.
    parser.add_argument('-c', '--customer_id', type=six.text_type,
                        required=True, help='The Google Ads customer ID.')
    args = parser.parse_args()

    main(google_ads_client, args.customer_id)

但是当我在客户下输出帐单设置时,我会得到一个新的Biiling设置,状态为“ PENDING”

Request made: ClientCustomerId: 6384836037, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v2.services.Bil                         lingSetupService/MutateBillingSetup, RequestId: pG9Dfss2kjObc5P4Cjazpw, IsFault: True, FaultMessage: The customer does not ha                         ve permission to signup for billing.
(<_Rendezvous of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "{"created":"@1568360172.261203468","description":"Error received from peer ipv4:10.0.0.19:8118"                         ,"file":"src/core/lib/surface/call.cc","file_line":1052,"grpc_message":"Request contains an invalid argument.","grpc_status":                         3}"
>, <_Rendezvous of RPC that terminated with:
        status = StatusCode.INVALID_ARGUMENT
        details = "Request contains an invalid argument."
        debug_error_string = "{"created":"@1568360172.261203468","description":"Error received from peer ipv4:10.0.0.19:8118"                         ,"file":"src/core/lib/surface/call.cc","file_line":1052,"grpc_message":"Request contains an invalid argument.","grpc_status":                         3}"
>, errors {
  error_code {
    billing_setup_error: NO_SIGNUP_PERMISSION
  }
  message: "The customer does not have permission to signup for billing."
}
, 'pG9Dfss2kjObc5P4Cjazpw')


似乎新的结算设置已成功创建,但出现错误,为什么会这样?为何为什么在显示新的paying-profile_id时在新的帐单设置中不显示payments_account_name?

0 个答案:

没有答案