Mercado Pago only CreditCard - php

I'm learning Mercado-Pago SDK...
I'd like to only be able to use credit card's, and for that I'm trying to use, "excluded_payment_types", so my array looks like this:
$preference_data = array(
"items" => array(
array(
"title" => "Puppy Dalmata",
"description" => "Nice description of the item",
"quantity" => 1,
"currency_id" => "MXN",
"picture_url" => "http://domain.com/dal2.jpg",
"unit_price" => 1500,
"payment_methods" => array (
"excluded_payment_types" => array (
"id" => "ticket",
"id" => "bank_transfer",
"id" => "atm",
"id" => "debit_card",
"id" => "account_money"
),
"installments" => 12
),
)
)
);
$preference = $mp->create_preference($preference_data);
With that I'm able to get the URL so that I can process the payment for that item, so, this is working "fine" the client is able to see how much is going to pay and a lot of option to make a payment:
Bank Deposit, Account Money, Debit card, Payment via "7Eleven, OXXO, STRIPES" and Credit card... the idea is to only show Credit Card and nothing else, the user can only select the type of card, Visa Credit or Master Credit ... and nothing else...
but as in the this url shows :https://api.mercadolibre.com/payment_types it doesn't work base on my ARRAY... so I wonder what am I doing wrong? ...
I thank you for any help you can provided
Thank you for taking the time to read my question.

toke me some time to get back to this... anyway, the problem with that array is that I have the key "payment_methods" inside key "items" which is wrong... it should be outside key items ... and that solved to problem of getting "payment_methods" to only accept credit card... btw, after I solved this issue I went back to read and learn more about "mercadopago" API for processing online payments and is quite easy to use I'm not saying is better than... PayPal, but, yes more easy to use...

Related

How to implement stripe SCA in PHP?

As per the stripe documentation here we read all the information and know the ideas about the SCA. But I am not getting any related API documentation. So, I am confusing how to implement in our existing PHP code and what are the parameters we will add. Please find below my example of code:
\Stripe\Stripe::setApiKey(API_KEY_HERE);
$customer = \Stripe\Token::create(
array("card" => array(
"name" => $arg['name'],
"number" => $arg['number'],
"exp_month" => $arg['exp_month'],
"exp_year" => $arg['exp_year'],
"cvc" => $arg['cvc']
))
);
/* some other code here */
$charge = \Stripe\Charge::create(
array(
"amount" => $arg['amount'],
"currency" => "usd",
"description" => "Subscription Charge",
"customer" => $customer->id
)
);
/* some other db related code here */
I have shared the code. Could you please let us know what we need to change for SCA?
I just answered this question where OP did a great job on the question.
Perhaps her code can help you see how you need to implement this using JS in the
front-end and PHP in the backend.
Stripe - Payment Intents (3d secure issue)

Get Card Information from Charge object in Stripe

I have integrated stripe payment method in website . I want to get Card Information. Everything is work fine .After successful payment i successfully retrived payment id from $charge->id variable .So my question is that when i print_r($charge) it also show Card Object Something like That
Stripe_Card Object ( [_apiKey:protected] => sk_test_...
[_values:protected] => Array ( [id] => card_1BLSPnJ6IzxnlSnmegEq6dbH
[object] => card [address_city] => Lahire [address_country] => Pakistan
my stripe process
$customer =Stripe_Customer::create(array(
'email' => $_GET['email'],));
$charge = Stripe_Charge::create(array(
"amount" => $amount_cents,"currency" => "usd","source" =>
$_POST['stripeToken'],"description" => $description,
)
);
I try many times to get card information from $charge variable using $charge->card->address_country But not work any solution .Your help would be greatly appreciated
The payment source of a charge is returned in the source attribute of the charge object, so you should be able to do something like this:
$card = $charge->source;
// Do something with $card, e.g. access the billing address' country
// with $card->address_country

Kraken API <-> PHP withdrawl issue

I need help with the kraken API. I have created the connection and I am able to trade various pairs but now I need to make an automatic withdraw using their API. For the trading pairs I have the following running which buys 0.002 BTC using EURO
$res = $kraken->QueryPrivate('AddOrder', array(
'pair' => 'XBTEUR',
'type' => 'sell',
'ordertype' => 'market',
'volume' => '0.002',
));
print_r($res);
Now... how do I withdraw 0.002 btc using the api and sending these to my wallet: 1BujYrWGkzFdmecXUNgj8nE13gwXtxZxKZ
I can't seem to find this specific information anywhere :(
To answer my own question, this was the code I needed:
$res = $kraken->QueryPrivate('Withdraw', array(
'asset' => 'XBT',
'key' => 'withdrawal key name here',
'amount' => '0.002',
));
print_r($res);
Where as the key, was the name of the account which contained the wallet I wanted to withdraw fund to.

Using a variable for amount in Stripe Payment Gateway

I am trying to integrate Stripe payment onto my site. I have a php variable '$val' set with a price amount sent from a form
$val = $_POST['myFieldName'];
I'm trying to use this variable to charge the amount it holds with stripe
Stripe_Charge::create(array(
"amount" => $val ,
"currency" => "gbp",
"card" => $_POST['stripeToken']));
But it seems Stripe wont except this variable. it puts a 'Missing required param: amount' error on the page It only wants to accept a actuale integer such as '1234' I tried cast to int using => intval($var) nut with no joy. Could someone tell me where Im going wrong
Thnks
you should try this
Stripe_Charge::create(array(
"amount" => 400,
"currency" => "usd",
"card" => "tok_14igbg2eZvKYlo2Cm0Akcrhg", // obtained with Stripe.js
"description" => "Charge for test#example.com"
));
description field is missing as per the documentation
I face same issue but its my coding fault
when you land on payment page
in the end just add this line before form submit button
" name="myFieldName">

Authorize.net AIM refund transaction error 3.2.33

According to authorize.net pdf instructions I use the AIM parameters:
"x_login" => $AimLoginID,
"x_tran_key" => $AimTransKey,
"x_version" => "3.1",
"x_delim_data" => "TRUE",
"x_delim_char" => "|",
"x_relay_response" => "FALSE",
"x_type" => $Type,
"x_trans_id" => $TransID,
"x_amount" => $Amount,
"x_card_num" => $CCLast4,
"x_invoice_num" => $invoicenumber
where
x_tran_key is the original transaction ID as given to my from authorize.net
type = CREDIT as I want to refund
x_amount equals the exact amount I previously charged on the credit card
x_card_num is filled with the last 4 digits from the credit card.
x_invoice_num has my invoice number
the message I get back gives me an error.
Array
(
[0] => 3
[1] => 2
[2] => 33
[3] => Recurring Billing is required.
this does not make any sense as it is not a recurring billing?
at the beginning I tried it without the invoice number, but the retunred errorcode informed me that I need to give them also that. I also tried to give the parameter x_exp_date as '' (i saw a suggestion for this online) but it didn't work, had the same message.
Any idea or suggestion will be highly appreciated.
Please, check x_recurring_billing - perhaps it is enabled as "required".
You need to access your Merchant Interface. Check if this field is set as Required.
Just change the FIELD value to NOT REQUIRED.
See more detailed problem explaination here http://community.developer.authorize.net/t5/Integration-and-Testing/Receiving-Response-3-2-33-Recurring-Billing-is-required/td-p/718

Categories