Comments (9)
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.
Just realized that lineItems has to be a multi-dimensional array and things worked that way :).
from 2checkout-php.
Can you supply the code you used I'm having the same problem.
from 2checkout-php.
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.
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.
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.
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.
The billing address is mandatory. More information on the required data can be found in the payment API documentation.
from 2checkout-php.
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)
- Twocheckout_Sale::stop Recurring item problem HOT 2
- Start recurring billing after a period of time. HOT 1
- Note on Refunds
- Note on Charges
- Translations HOT 1
- Fatal error: Class 'Twocheckout_Charge' not found
- Email addresses with tags (e.g. [email protected])
- Sell already created product on https://sandbox.2checkout.com/sandbox/products/list_products HOT 1
- Bad request - parameter error HOT 6
- "2Checkout Payments Failed: ‘Unauthorized’" HOT 1
- Unable to process the request HOT 1
- twocheckoutpp- Item Id / product description not present in order notification from 2co
- <!-- Bad browser, no cookie --> HOT 3
- Tangible won't set up to 'Y' HOT 1
- Private key Deprecated in 2checkout
- how to save user token information ?
- Call to undefined method Twocheckout::sandbox() HOT 2
- Authorization Failed HOT 1
- Doesn't work with PHP8.1 HOT 1
- 2checkout pho cash square
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from 2checkout-php.