GithubHelp home page GithubHelp logo

Comments (9)

umutm avatar umutm commented on July 17, 2024 1

Here it is:

  $lineItemsArray = array("name" => $productName, "type" => 'product', "quantity" => $quantity, "price" => $productPrice);
    try {
        $charge = Twocheckout_Charge::auth(array(
            "merchantOrderId" => $uniqueID,
            "token" => $twoCheckoutToken,
            "currency" => $paymentCurrency,
            "lineItems" => array(
                $lineItemsArray
            ),
            "billingAddr" => array(
                "name" => $userBillingName,
                "addrLine1" => $userBillingAddress,

and so..

Hope it helps.

from 2checkout-php.

umutm avatar umutm commented on July 17, 2024

Just realized that lineItems has to be a multi-dimensional array and things worked that way :).

from 2checkout-php.

JAW-Dev avatar JAW-Dev commented on July 17, 2024

Can you supply the code you used I'm having the same problem.

from 2checkout-php.

JAW-Dev avatar JAW-Dev commented on July 17, 2024

Hey thanks. That's what I've been doing, but I can't get it to send or the response just isn't reflecting it.

from 2checkout-php.

umutm avatar umutm commented on July 17, 2024

I can at least tell that 2CO's system (live system.. not sure about the dev. system) is working fine and there shall be something with the code.

I'll suggest sending very realistic data (in the address) with all the fields as I remember "bla bla data, addresses without zip" was causing issues.

from 2checkout-php.

premhunt avatar premhunt commented on July 17, 2024

You have to use lineItem under two arrays. Please find below example. You replace lineItem with this. It will work.
"lineItems" => array(
array(
"type" => 'product',
"price" => "5.00",
"productId" => "123",
"name" => "Test Product",
"quantity" => "1",
"tangible" => "N",
"startupFee" => "1.00",
"recurrence" => "1 Month",
"description" => "This is a test"
)
),

from 2checkout-php.

kamleshpal1311 avatar kamleshpal1311 commented on July 17, 2024

Hi

Can i remove this is it mandatory or not.

"billingAddr" => array(
"name" => 'Testing Tester',
"addrLine1" => '123 Test St',
"city" => 'Columbus',
"state" => 'OH',
"zipCode" => '43123',
"country" => 'USA',
"email" => '[email protected]',
"phoneNumber" => '555-555-5555'
)

from 2checkout-php.

craigchristenson avatar craigchristenson commented on July 17, 2024

The billing address is mandatory. More information on the required data can be found in the payment API documentation.

from 2checkout-php.

wiloke avatar wiloke commented on July 17, 2024

It should be
"lineItems" => array( array( "type" => "product", "name" => "Tet", "price" => "10.00", "tangible" => "Y", "recurrence" => "1 Week", "duration" => "1 Week", "quantity" => 1, "startupFee" => "1.00", "productId" => "123", "description" => "This is a test" ) )
lineItems not lineItem ;)

from 2checkout-php.

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.