Coder Social home page Coder Social logo

Comments (4)

minhlt82 avatar minhlt82 commented on April 24, 2024

Can you tell me the error message? Have you enter a valid credit card in facebook billing form?

from facebook-php-business-sdk.

pruno avatar pruno commented on April 24, 2024

Hi @airdomain,

as mentioned by @minhsepteni, the details of the error you are facing are necessary to understand the issue. Few notes:

  • in order to create an AdGroup, the parent AdAccount needs to have a valid payment method associated with it:
  • to fully understand issues you need to catch the RequestException that the SDK throws:
use FacebookAds\Http\Exception\RequestException;

try {

// Your code here

} catch (RequestException $e) {
  echo 'Caught Exception: '.$e->getMessage().PHP_EOL
    .'Code: '.$e->getCode().PHP_EOL
    .'HTTP status Code: '.$e->getHttpStatusCode().PHP_EOL
    .'Error Subcode: '.$e->getErrorSubcode().PHP_EOL
    .'Error User Title: '.$e->getErrorUserTitle().PHP_EOL
    .'Error User Message: '.$e->getErrorUserMessage().PHP_EOL;
}

from facebook-php-business-sdk.

airdomain avatar airdomain commented on April 24, 2024

Ok, Thanks for your attention and wonderful answers.

I show you error codes as following,

Caught Exception : Invalid parameter
Code : 100
HTTP status Code : 500
Error Subcode:1359101
Error User Title : Add Payment Method
Error User Message : You need to have a valid payment method associated with your ad account
before you can create ads.

from facebook-php-business-sdk.

pruno avatar pruno commented on April 24, 2024

@airdomain, as mentioned above, you need to setup a payment method for your ad account.
You can do it here: https://www.facebook.com/ads/manager/billing/payment_methods/

from facebook-php-business-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.