I can't seem to pass the shippingPhone or billingPhone to put it here
This is my code
$cardInput = array(
'firstName' => 'John',
'lastName' => 'Doe',
'billingAddress1' => 'My Address',
'billingPhone' => 'XXXXXXX', //or the shippingPhone
'billingCity' => 'Miami',
'billingState' => 'Florida',
'billingPostCode' => '33133',
'email' => 'email#gmail.com',
);
$card = Omnipay::creditCard($cardInput);
$response = Omnipay::purchase([
'amount' => '100.00',
'returnUrl' => 'http://site.org/?return=success',
'cancelUrl' => 'http://site.org/?return=canceled',
'card' => $card,
'description'=>'This is the description',
])->send();
Did I miss something?
Related
I'm having some problems with Paypal express in magento 2, I've migrated from magento 1, and now all is working, expect for paypal express.
I've debug paypal express and I get what I will post, for what I see the problem is maybe because o the prodcut prices are with tax included.
I've already acomplished to have the price without tax in checkout, but he always get the price with tax, what can I do? I've already disabled "Transfer cart line items".
The log is:
'AMT' => '16.70',
'CURRENCYCODE' => 'EUR',
'INVNUM' => '1000012787',
'SHIPPINGAMT' => '3.75',
'ITEMAMT' => '12.95',
'TAXAMT' => '2.42',
'BUSINESS' => 'rtr',
'NOTETEXT' => NULL,
'EMAIL' => 'info#test.pt',
'FIRSTNAME' => 'ertr',
'LASTNAME' => 'trt',
'MIDDLENAME' => NULL,
'SALUTATION' => NULL,
'SUFFIX' => NULL,
'COUNTRYCODE' => 'PT',
'STATE' => 'PR',
'CITY' => 'rt',
'STREET' => 'tr',
'ZIP' => '2335',
'PHONENUM' => 'rtrtrt',
'SHIPTOCOUNTRYCODE' => 'PT',
'SHIPTOSTATE' => 'PR',
'SHIPTOCITY' => 'rt',
'SHIPTOSTREET' => 'tr',
'SHIPTOZIP' => '2335',
'SHIPTOPHONENUM' => 'rtrtrt',
'SHIPTOSTREET2' => 'trt',
'STREET2' => 'trt',
'SHIPTONAME' => 'ertr trt',
'ADDROVERRIDE' => 1,
'METHOD' => 'SetExpressCheckout',
'VERSION' => '72.0',
'USER' => '****',
'PWD' => '****',
'SIGNATURE' => '****',
'BUTTONSOURCE' => 'Magento_Cart_Community',
'TIMESTAMP' => '2019-09-03T11:20:28Z',
'CORRELATIONID' => '403c3d4df0570',
'ACK' => 'Failure',
'VERSION' => '72.0',
'BUILD' => '53481737',
'L_ERRORCODE0' => '10413',
'L_SHORTMESSAGE0' => 'Transaction refused because of an invalid argument. See additional error messages for details.',
'L_LONGMESSAGE0' => 'The totals of the cart item amounts do not match order amounts.',
'L_SEVERITYCODE0' => 'Error',
Can anyone help me?
Best regards,
Leonel Nunes
I am trying to build a cart system, after successfully entering the item to the cart. how can I display items according shop. I was a bit constrained here.
Controllers
function to_cart () {
$data = array(
array(
'id' => '1',
'qty' => 1,
'price' => 2.400,
'name' => 'Asus Eeepc',
'store' => 'My_store 1'
),
array(
'id' => '2',
'qty' => 1,
'price' => 1.500,
'name' => 'Accer AspireOne',
'store' => 'My_store 1'
),
array(
'id' => '3',
'qty' => 1,
'price' => 4.000,
'name' => 'Toshiba Satelite',
'store' => 'My_store 2'
),
array(
'id' => '4',
'qty' => 1,
'price' => 2.700,
'name' => 'Lenova ThinkCare',
'store' => 'My_store 1'
)
);
$this->cart->insert($data);
redirect($this->agent->referrer());
}
Views
<?php foreach ($this->cart->contents() as $item) {
echo '<td>'.$item['no'].'</td>';
echo '<td>'.$item['name'].'</td>';
echo '<td>'.$item['price'].'</td>';
echo '<td>'.$item['qty'].'</td>';
echo '<td>'.$item['store'].'</td>';
?>
When calling GetExpressCheckoutDetails the SHIPTONAME and EMAIL fields are missing from the response. I know that SHIPTONAME is deprecated, but the replacement field is missing as well. Full response below.
I can adjust for the missing name, but need the email for customer communications.
What would cause these fields to be missing from the response?
array(
'TOKEN' => 'XXXXXX',
'BILLINGAGREEMENTACCEPTEDSTATUS' => '0',
'CHECKOUTSTATUS' => 'PaymentActionCompleted',
'TIMESTAMP' => '2015-08-12T16:36:24Z',
'CORRELATIONID' => 'XXXXXX',
'ACK' => 'Success',
'VERSION' => '113',
'BUILD' => '000000',
'PAYERID' => 'XXXXXXXX',
'PAYERSTATUS' => 'verified',
'COUNTRYCODE' => 'US',
'SHIPTOSTREET' => 'XXXXXX',
'SHIPTOCITY' => 'XXXXXX',
'SHIPTOSTATE' => 'XX',
'SHIPTOZIP' => 'XXXXX',
'SHIPTOCOUNTRYCODE' => 'US',
'SHIPTOCOUNTRYNAME' => 'United States',
'ADDRESSSTATUS' => 'Confirmed',
'CURRENCYCODE' => 'USD',
'AMT' => '27.90',
'SHIPPINGAMT' => '0.00',
'HANDLINGAMT' => '0.00',
'TAXAMT' => '0.00',
'NOTIFYURL' => 'https://xxxxx.xxx/xxx',
'INSURANCEAMT' => '0.00',
'SHIPDISCAMT' => '0.00',
'TRANSACTIONID' => 'XXXXXX',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
'PAYMENTREQUEST_0_AMT' => '27.90',
'PAYMENTREQUEST_0_SHIPPINGAMT' => '0.00',
'PAYMENTREQUEST_0_HANDLINGAMT' => '0.00',
'PAYMENTREQUEST_0_TAXAMT' => '0.00',
'PAYMENTREQUEST_0_NOTIFYURL' => 'https://xxxxx.xxx/xxx',
'PAYMENTREQUEST_0_INSURANCEAMT' => '0.00',
'PAYMENTREQUEST_0_SHIPDISCAMT' => '0.00',
'PAYMENTREQUEST_0_TRANSACTIONID' => 'XXXXXX',
'PAYMENTREQUEST_0_SHIPTOSTREET' => 'XXXXXX',
'PAYMENTREQUEST_0_SHIPTOCITY' => 'XXXXXX',
'PAYMENTREQUEST_0_SHIPTOSTATE' => 'XX',
'PAYMENTREQUEST_0_SHIPTOZIP' => 'XXXXX',
'PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE' => 'US',
'PAYMENTREQUEST_0_SHIPTOCOUNTRYNAME' => 'United States',
'PAYMENTREQUEST_0_ADDRESSSTATUS' => 'Confirmed',
'PAYMENTREQUESTINFO_0_TRANSACTIONID' => 'XXXXX',
'PAYMENTREQUESTINFO_0_ERRORCODE' => '0'
)
There is an issue open with PayPal regarding this and they have acknowledged it as a bug. We suffer the same problems, once in a while the PayerId and any personal detail fields (email address etc) are omitted.
You need to take the correlation ID field that they would have returned to you from the faulty API call and ask them to investigate / open a ticket. That's the only way to get them to respond positively.
Saying that, this has been going on a while now and it is still not solved. But at least you know it's not just you.
I have a function to reset a password.
At the point where I have to compare the password and the password_confirm field, I get a strange behavior:
My form
echo $this->Form->hidden('tkn', array('value' => $tkn));
echo $this->Form->hidden('uid', array('value' => $uid));
echo $this->Form->input('password',array('type' => 'password', 'name' => 'data[Appuser][password]'));
echo $this->Form->input('password_confirm',array('type' => 'password', 'name' => 'data[Appuser][password_confirm]'));
My model validation:
var $validate = array(
'password' => array(
'rule' => array('minLength', '6'),
'message' => '{password} minLength 6!'
),
'password_confirm' => array(
'rule' => array('equaltofield','password'),
'message' => '{password_confirm} not equal!'
),
);
function equaltofield($val1, $val2){
return $this->data[$this->alias][key($val1)] == $this->data[$this->alias][$val2];
}
My Controller:
if($this->Appuser->save($this->data)){
$this->Session->setFlash(__('Password has been updated'));
}else{
debug($this->Appuser->invalidFields());
}
Now:
When I submit an empty form I get the following returned from the invalidFields()
array(
'password' => '*****',
'password_confirm' => array(
(int) 0 => '{password_confirm} not equal!',
(int) 1 => '{password_confirm} not equal!'
)
)
Question 1: Why do I not get the message, that the password has not its minlength?
Question 2: Why do I get the second message twice for comparing the password?
When typing in 2 different password with min length, I get this again:
array(
'password_confirm' => array(
(int) 0 => '{password_confirm} not equal!',
(int) 1 => '{password_confirm} not equal!'
)
)
When debug($this->data) I also get this (if that helps somehow)
array(
'Api' => array(
'tkn' => '6837d241bf1076c3c55a95abbcfafa04dc19a33c',
'uid' => '1'
),
'Appuser' => array(
'password' => '*****',
'password_confirm' => 'asdfgh'
)
)
Any ideas regarding my two questions above?
Thanks in advance!!
Try this
var $validate = array(
'password' => array(
'rule' => array('minLength', '6'),
'message' => '{password} minLength 6!'
),
'password_confirm' => array(
'rule' => 'equaltofield',
'message' => '{password_confirm} not equal!'
),
);
function equaltofield($data){
return $this->data[$this->alias]['password'] == $this->data[$this->alias]['password_confirm'];
}
I have the following code:
`$attachment = array(
'message' => "test",
'text' => 'Download',
'name' => 'name',
'href' => 'http://www.mydomain.com',
'description' => 'description!',
'media' => array(array(
'type' => 'mp3',
'src' => "http://www.mydomain.com/mp3.mp3",
'href' => 'http://www.mydomain.com/',
'title' => "title",
'artist'=> 'artist',
'album'=> 'the album')));
$facebook->api('/me/feed', 'post', $attachment);`
But when I publish the POST in my profile, it only shows the message "test". The mp3 file doesn't appear. What is the problem?
$attachment = array(
'message' => "test",
'text' => 'Download',
'name' => 'name',
'href' => 'http://www.mydomain.com',
'description' => 'description!',
'media' => array(
'type' => 'mp3',
'src' => "http://www.mydomain.com/mp3.mp3",
'href' => 'http://www.mydomain.com/',
'title' => "title",
'artist'=> 'artist',
'album'=> 'the album'));
$facebook->api('/me/feed', 'post', $attachment);