Kraken API <-> PHP withdrawl issue - php

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.

Related

How to set Currency Format in braintree transaction sale

I create a APP in which i use Braintree Payment Gateway. In my application i make options to set different currency, am just know that how to set currency when i set sale transaction param.
here is my code
$result = Braintree\Transaction::sale([
'amount' => '50.00',
'creditCard' => array(
'cardholderName' => 'Test Name',
'number' => '4000111111111511',
'expirationDate' => '12/2018',
'cvv' => '123',
),
'options' => [ 'submitForSettlement' => true]
]);
All of my transaction made in US Dollar, but i want to make transaction in different currencies.
Please someone give me the solution.
thanks
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
You will need to set up a different merchant account for each currency you would like to process. Then, when processing a transaction for a specific currency, you can pass in the merchant account id to the transaction sale method.
In addition, to keep your PCI compliance burden low, you will want to pass a nonce to your server in place of the credit card details.
$merchantAccountId = someFunctionToLookupCorrectMerchantIdBasedOnCurrency();
$result = Braintree\Transaction::sale([
'amount' => '100.00',
'paymentMethodNonce' => nonceFromTheClient,
'merchantAccountId' => $merchantAccountId,
'options' => [
'submitForSettlement' => True
]
]);

Braintree marketplace - What happens if Master Merchant do charge client at time time of sale, but has to pay to submerchant

I have implemented PHP braintree API in a project, I want to use Marketplace api for the same.
Now, we have promotional events and we do not charge client, but we have to pay amount to sub-merchant who has delivered goods.
So below is the code to add service fees, which is clear that at the time of sale we have to add sub-merchant id for merchantAccountId, amount will be payment charged from client, what is paymentMethodNonce?
$result = Braintree_Transaction::sale(array(
'merchantAccountId' => 'provider_sub_merchant_account',
'amount' => '10.00',
'paymentMethodNonce' => 'nonce-from-the-client',
'serviceFeeAmount' => "1.00"
));
Another query is, at the time of sale we have to pass credit card details of the client? What if client is already in vault ?
Below is another code from Braintree document with creditCard details
$result = Braintree_Transaction::sale(
array(
'amount' => "100",
'merchantAccountId' => "blue_ladders_store",
'creditCard' => array(
'number' => "4111111111111111",
'expirationDate' => "12/20",
),
'options' => array(
'submitForSettlement' => true,
'holdInEscrow' => true,
),
'serviceFeeAmount' => "10.00"
)
);
If we do not add creditCard number and have to pay sub-merchant then how can that be done.
Thanks

Mercado Pago only CreditCard

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...

Paypal PHP API integration

Recently I'm playing with paypal API PHP.
I have downloaded a code from this url.
https://github.com/paypal/rest-api-curlsamples/blob/master/execute_all_calls.php
The code really works good with test creditcard(type:mastercard). The code looks like this
$url = $host.'/v1/payments/payment';
$payment = array(
'intent' => 'sale',
'payer' => array(
'payment_method' => 'credit_card',
'funding_instruments' => array ( array(
'credit_card' => array (
'number' => '540xxxxxxxxxxxx6',
'type' => 'mastercard',
'expire_month' => 12,
'expire_year' => 2018,
'cvv2' => 111,
'first_name' => 'First Name',
'last_name' => 'Last Name'
)
))
),
'transactions' => array (array(
'amount' => array(
'total' => '2',
'currency' => 'USD'
),
'description' => 'payment by a credit card using a test script'
))
);
Now if i try to use the same code to make the payment using my VISA(American Express) with test card number 37xxxxxxxxxx005, how shall i obtain this? What are the parameters to be altered?
In other words I would like to make the payment using Diner's Club,Discover and JCB. How shall I achieve this?
Edit: I have got two comments from Stack Overflow users, and you can check it at the bottom of my question. I'm not clear with the comments. Do they tell that I don't need to think about the parameters and paypal will take care of the card details and make the transaction?
Got reply from Paypal Tech Team for my above question
{snip}
You need to alter the code for 'type'. Below shows the code for the credit card type :l
- Visa
- MasterCard
- Discover
- Amex
And also make sure you need to input correct credit card number based on the type if you not you will receive an error message.
{/snip}
In other words, it is more than enough if I change the 'type' => 'mastercard' to 'type' => 'visa' (or) 'type' => 'amex' (or) 'type' => 'discover'
And also please make sure you give the correct test card numbers. You can view the dummy credit card numbers here.
http://www.paypalobjects.com/en_US/vhelp/paypalmanager_help/credit_card_numbers.htm
Hope this will help someone if they are struck with the paypal PHP API integration.
Thanks for all the tech support & SOF-Users.
Thanks again,
Haan

How track by Tracking Number Unique Identifier?

I'm having issues attempting to track a package by Tracking Number Unique Identifier. I'm working with the sample PHP code from Fedex Developer Resource Center.
How can I track it using the TrackingNumberUniqueIdentifier?
$path_to_wsdl = __DIR__ . "/WSDL/FEDEX/TrackService_v6.wsdl";
ini_set("soap.wsdl_cache_enabled", "0");
$client = new \Soapclient($path_to_wsdl, array('trace' => 1));
$request = array(
'WebAuthenticationDetail' => array(
'UserCredential' => array(
'Key' => #KEY#,
'Password' => #PASSWORD#
)
),
'ClientDetail' => array(
'AccountNumber' => #SHIPACCOUNT#,
'MeterNumber' => #METER#
),
'Version' => array(
'ServiceId' => 'trck',
'Major' => '6',
'Intermediate' => '0',
'Minor' => '0'
),
'PackageIdentifier' => array(
'Type' => 'TRACKING_NUMBER_OR_DOORTAG',
'Value' => '123456789012',
),
'IncludeDetailedScans' => 1
'TrackingNumberUniqueIdentifier' => '510987654321~123456789012~FX'
);
When you desire to track a package using the FedEx API, you simply provided the tracking number or the door tag number; however, FedEx reuses the tracking numbers, so you may find that one of your tracking numbers has more than one set of events (or more than two shipments associated with it). When that happens, you must use the FedEx tracking number unique identifier (which has the tracking number as prefix) to get the desired set of events.
In case of your request, you are using a non-valid tracking number (123456789012) for the FedEx test environment and an unrelated tracking number unique identifier (510987654321~123456789012~FX). Notice that the suffix of the unique identifier is not the tracking number.
Sadly, FedEx does not provide test tracking number, so I recommend you to switch the endpoint to the production URL, and test the tracking service using real tracking numbers because the production tracking numbers don't work in the test environment.
Remember, don't use the tracking number unique identifier unless your tracking number has two shipments associated with it.
Regards,

Categories