SimpleXMLElement Object
(
[request] => SimpleXMLElement Object
(
[address] => SimpleXMLElement Object
(
)
[citystatezip] => SimpleXMLElement Object
(
)
)
[message] => SimpleXMLElement Object
(
[text] => Error: this account is not authorized to execute this API call
[code] => 6
)
)
Related
When updating Mongo db I want to update a document inside multiple nested arrays. But none of my querys worked when tried to update it. Below is the of existing table:
Array
(
[0] => Array
(
[_id] => MongoId Object
(
[$id] => 5ce268ef6803fa8f237b23c6
)
[member_number] => 26b091bdd3f9505b2103a187f3ac6643
[member_forename] => 1d40521662cc484d7c06992c61303ba6
[member_surname] => 581c78bf6fe11cc0ff53a805a100d441
[certificates] => Array
(
[0] => Array
(
[member_id] => MongoId Object
(
[$id] => 5ce268ef6803fa8f237b23c6
)
[certificate_id] => MongoId Object
(
[$id] => 5ce4dd3d6803fa15454cbed5
)
[skills_completed] => N
[certificate_issued] => N
[details] => Array
(
[0] => Array
(
[member_id] => MongoId Object
(
[$id] => 5ce268ef6803fa8f237b23c6
)
[session_id] => MongoId Object
(
[$id] => 5ce4f1a96803fa574e4cbede
)
[mark_status] => A
[cd_status] => A
[gradeId] => MongoId Object
(
[$id] => 5ca48ccfa36f74db9a8a0620
)
[gradeKey] => NP
[achieved_date] => MongoDate Object
(
[sec] => 1558531565
[usec] => 713000
)
[detail_id] => MongoId Object
(
[$id] => 5ce4dd526803fa1f454cbed7
)
[marked_by] => MongoId Object
(
[$id] => 5cb5622a6803fa640b7b23c7
)
)
)
[certificate_issued_by] =>
[certificate_session_id] =>
[sc_date] =>
)
[updated_at] => MongoDate Object
(
[sec] => 1558341930
[usec] => 482000
)
)
)
I want to update one of the details section that is nested inside certificates.the certificate array is inside member table.
my matching condition is _id = member id ,
certificates.certificate_id=xxxx,
certificates.details.detail_id=xxxx
I have the full array that will replace zeroth position of details array.how to do this?
Assuming there are embedded associations involved, letting Mongoid do the work should be straightforward:
class Foo
include Mongoid::Document
embeds_many :bars
end
class Bar
include Mongoid::Document
has_one :thing
embedded_in :foo
end
class Thing
include Mongoid::Document
belongs_to :bar
end
foo = Foo.new
foo.bars = [Bar.new, Bar.new]
foo.save!
foo.bars[0].thing = Thing.new
foo.save!
foo.reload
foo.bars.map(&:thing)
# => [#<Thing _id: 5ce85f47026d7c20c4c0613a, bar_id: BSON::ObjectId('5ce85f47026d7c20c4c06138')>, nil]
Take note of https://jira.mongodb.org/browse/MONGOID-2951 - in the above example I changed a field of one of the Bar instances but I did not modify the list of Bars.
Error:
The total invoiced amount for xxxxxx#gmail.com does not match the amount in the pay for delayed chain payment.
I am not getting correct response for setPaymentOptions as here I am passing equal amount for both payrequst and invoice data but unable to compare their price. Is this because of currency code as here we pass currency code for payRequest receiver and for invoice data? We don't have any parameter as such for passing currency code. Can anyone help me out for this please?
PayPal\Types\AP\SetPaymentOptionsResponse Object
(
[responseEnvelope] => PayPal\Types\Common\ResponseEnvelope Object
(
[timestamp] => 2016-08-25T00:11:21.138-07:00
[ack] => Failure
[correlationId] => 8cc5bbe5cde59
[build] => 24003818
)
[error] => Array
(
[0] => PayPal\Types\Common\ErrorData Object
(
[errorId] => 580023
[domain] => PLATFORM
[subdomain] => Application
[severity] => Error
[category] => Application
[message] => The total invoiced amount for xxxxxx#gmail.com does not match the amount in the pay request
[exceptionId] =>
[parameter] => Array
(
[0] => PayPal\Types\Common\ErrorParameter Object
(
[name] =>
[value] => invoiceData
)
[1] => PayPal\Types\Common\ErrorParameter Object
(
[name] =>
[value] => xxxxxx#gmail.com
)
)
)
)
)
Parameters I am passing for PayRequest and InvoiceDatas:
PayPal\Types\AP\PayRequest Object
(
[requestEnvelope] => PayPal\Types\Common\RequestEnvelope Object
(
[detailLevel] =>
[errorLanguage] => en_US
)
[clientDetails] =>
[actionType] => PAY_PRIMARY
[cancelUrl] => http://localhost.xyz.com/paymentError?cancel=true
[currencyCode] => USD
[feesPayer] =>
[ipnNotificationUrl] => http://replaceIpnUrl.com
[memo] =>
[pin] =>
[preapprovalKey] =>
[receiverList] => PayPal\Types\AP\ReceiverList Object
(
[receiver] => Array
(
[0] => PayPal\Types\AP\Receiver Object
(
[amount] => 2.00
[email] => ABC-facilitator#gmail.com
[phone] =>
[primary] => false
[invoiceId] =>
[paymentType] =>
[paymentSubType] =>
[accountId] =>
)
[1] => PayPal\Types\AP\Receiver Object
(
[amount] => 8.00
[email] => xxxxxxx#gmail.com
[phone] =>
[primary] => true
[invoiceId] =>
[paymentType] =>
[paymentSubType] =>
[accountId] =>
)
)
)
[reverseAllParallelPaymentsOnError] =>
[senderEmail] =>
[returnUrl] => http://localhost.xyz.com/expressCallback
[trackingId] =>
[fundingConstraint] =>
[sender] =>
[payKeyDuration] =>
)
PayPal\Types\AP\ReceiverOptions Object
(
[description] =>
[customId] =>
[invoiceData] => PayPal\Types\AP\InvoiceData Object
(
[item] => Array
(
[0] => PayPal\Types\AP\InvoiceItem Object
(
[name] => Brand
[identifier] => 1
[price] => 8.00
[itemPrice] => 8.00
[itemCount] => 32
)
)
[totalTax] => 2
[totalShipping] => 27
)
[receiver] => PayPal\Types\AP\ReceiverIdentifier Object
(
[email] => xxxxxx#gmail.com
[phone] =>
[accountId] =>
)
[referrerCode] =>
)
Here 2 things are to be corrected related to price/amount to get rid of the error.
1: In the InvoiceItem object
[name] => Brand
[identifier] => 1
[price] => 256 //THIS IS EQUAL TO itemPrice * itemCount
[itemPrice] => 8.00
[itemCount] => 32
enter code here
2: In the Reciever object
xxxxxxx#gmail.com being the primary receiver should always have the amount equal to the total order amount (item + tax + discount + shipping), irrespective of if the secondary receiver is available or not. So it should be corrected to:
[amount] => 285.00 //256 + 2 + 27
[email] => xxxxxxx#gmail.com
[phone] =>
[primary] => true
[invoiceId] =>
[paymentType] =>
[paymentSubType] =>
[accountId] =>
And this Receiver object of secondary receiver specifies that out of total 285.00, 2.00 will be credited to the secondary receiver:
[amount] => 2.00 //2.00 will be credited to ABC out of 285.00
[email] => ABC-facilitator#gmail.com
[phone] =>
[primary] => false
[invoiceId] =>
[paymentType] =>
[paymentSubType] =>
[accountId] =>
Correct these and do let me know if you are still facing issue with amount mismatch.
I am working with Project theme in word Press..I this theme i am using Adaptive payment method for paypal gateway..But i am unable to do..Can any one please help me to complete this task. I got an array see below for array..
I am using Sandbox details
Array
(
[0] => Array
(
[name] => ns3:FaultMessage
[attributes] => Array
(
[xmlns:ns3] => http://svcs.paypal.com/types/common
[xmlns:ns2] => http://svcs.paypal.com/types/ap
)
[0] => Array
(
[name] => responseEnvelope
[0] => Array
(
[name] => timestamp
[value] => 2015-10-12T02:10:03.535-07:00
)
[1] => Array
(
[name] => ack
[value] => Failure
)
[2] => Array
(
[name] => correlationId
[value] => a7b08f9b701fa
)
[3] => Array
(
[name] => build
[value] => 17820627
)
)
[1] => Array
(
[name] => error
[0] => Array
(
[name] => errorId
[value] => 520009
)
[1] => Array
(
[name] => domain
[value] => PLATFORM
)
[2] => Array
(
[name] => subdomain
[value] => Application
)
[3] => Array
(
[name] => severity
[value] => Error
)
[4] => Array
(
[name] => category
[value] => Application
)
[5] => Array
(
[name] => message
[value] => Account Account not found. Unilateral receiver not allowed in chained payment is restricted
)
[6] => Array
(
[name] => parameter
[value] => Account not found. Unilateral receiver not allowed in chained payment
)
)
)
)
Friend, I can not handle the data that return the call. How can I interact with the data, specifically with attachments. the complete result of calling this the link: http://pastebin.com/fLjV0Zu2
I'm using the conversion method for array, but it seems that this method does not interact at all levels of the object. So I can not reach the data attachments to handle.
$graphObject = $response->getGraphObject()->asArray();
$media = $graphObject->getProperty('attachments')->asArray();
print_r($media);
Result:
Array
(
[0] => stdClass Object
(
[subattachments] => stdClass Object
(
[data] => Array
(
[0] => stdClass Object
(
[media] => stdClass Object
(
[image] => stdClass Object
(
[height] => 483
[src] => https://scontent-a.xx.fbcdn.net/hphotos-xpa1/v/t1.0-9/s720x720/10891987_811524088885970_7055896286836804482_n.jpg?oh=895cce48d5da3e59b374fad2f7ec8f69&oe=55297847
[width] => 720
)
)
[target] => stdClass Object
(
[id] => 811524088885970
[url] => https://www.facebook.com/photo.php?fbid=811524088885970&set=gm.767232516689804&type=1
)
[type] => photo
[url] => https://www.facebook.com/photo.php?fbid=811524088885970&set=gm.767232516689804&type=1
)
[1] => stdClass Object
(
[media] => stdClass Object
(
[image] => stdClass Object
(
[height] => 404
[src] => https://scontent-a.xx.fbcdn.net/hphotos-xaf1/v/t1.0-9/s720x720/10885099_811524235552622_234704175575422999_n.jpg?oh=d94c5f69852665adb5a8bae2217cc900&oe=552A30F4
[width] => 720
)
)
[target] => stdClass Object
(
[id] => 811524235552622
[url] => https://www.facebook.com/photo.php?fbid=811524235552622&set=gm.767232516689804&type=1
)
[type] => photo
[url] => https://www.facebook.com/photo.php?fbid=811524235552622&set=gm.767232516689804&type=1
)
[2] => stdClass Object
(
[media] => stdClass Object
(
[image] => stdClass Object
(
[height] => 404
[src] => https://scontent-b.xx.fbcdn.net/hphotos-xap1/v/t1.0-9/s720x720/10898031_811524285552617_7673546158326216312_n.jpg?oh=3376e9140822a7a79904f58f30214c5d&oe=552D6772
[width] => 720
)
)
[target] => stdClass Object
(
[id] => 811524285552617
[url] => https://www.facebook.com/photo.php?fbid=811524285552617&set=gm.767232516689804&type=1
)
[type] => photo
[url] => https://www.facebook.com/photo.php?fbid=811524285552617&set=gm.767232516689804&type=1
)
)
)
[target] => stdClass Object
(
[id] => 767232516689804
[url] => https://www.facebook.com/media/set/?set=pcb.767232516689804&type=1
)
[title] => Photos from Conceicao Fernandes's post
[type] => album
[url] => https://www.facebook.com/media/set/?set=pcb.767232516689804&type=1
)
)
For those who have the same problem. Or rather doubt.
The friend WizKid cleared my ideas.
Even using the correct method to convert the result of GraphObject using Facebook PHP SDK4, calling asArray(); to access the data, I used the form below with success.
$media = $graphObject->getProperty('attachments')->asArray();
$media[0]->subattachments->data;
To interact with the data I'm using foreach()
$data = $media[0]->subattachments->data;
foreach($data as $k => $v) {
//Here you interacted with the data
}
I find this solution
$metadata = $result->getTable()->info('metadata');
echo $metadata['Continent']['DATA_TYPE'];
Hi,
I want to get enum values in Zend_Db.
My Code:
$select = $this->select();
$result = $select->fetchAll();
print_r($result->getTable());
Output:
Example Object
(
[_name] => country
[query] => Zend_Db_Table_Select Object
(
[_info:protected] => Array
(
[schema] =>
[name] => country
[cols] => Array
(
[0] => Code
[1] => Continent
)
[primary] => Array
(
[1] => Code
)
[metadata] => Array
(
[Continent] => Array
(
[SCHEMA_NAME] =>
[TABLE_NAME] => country
[COLUMN_NAME] => Continent
[COLUMN_POSITION] => 3
[DATA_TYPE] => enum('Asia','Europe','North America','Africa','Oceania','Antarctica','South America')
[DEFAULT] => Asia
[NULLABLE] =>
[LENGTH] =>
[SCALE] =>
[PRECISION] =>
[UNSIGNED] =>
[PRIMARY] =>
[PRIMARY_POSITION] =>
[IDENTITY] =>
)
I see enum values in data_type but i don't get this values. How can get data_type?
I find this solution
$metadata = $result->getTable()->info('metadata');
echo $metadata['Continent']['DATA_TYPE'];