php parallel payment - transaction fee - php

How can i achieve this below scenario? taken fron payPal site.
Receiver Pays the Fee in a Parallel Payment
If the receivers pay the fee in a parallel payment, each receiver pays a portion of the fee, based on their assessment. The following example shows the receivers paying the fees:
My paremeters:
$bodyParams = array (
"actionType" => "PAY",
"currencyCode" => "USD",
"receiverList.receiver(0).email" => $receiver_p,
"receiverList.receiver(0).amount" => $amount_primary,
//"receiverList.receiver(0).primary"=>true,
"receiverList.receiver(1).email" => $receiver["paypal_id"][0],
"receiverList.receiver(1).amount" => $amount[0],
"receiverList.receiver(2).email" => $receiver["paypal_id"][1],
"receiverList.receiver(2).amount" => $amount[1],
"receiverList.receiver(3).email" => $receiver["paypal_id"][2],
"receiverList.receiver(3).amount" => $amount[2],
"receiverList.receiver(4).email" => $receiver["paypal_id"][3],
"receiverList.receiver(4).amount" => $amount[3],
"returnUrl" => APP_WEB_ROOT.'/checkout.php?cmd=paid',
"cancelUrl" => APP_WEB_ROOT.'/checkout.php',
"requestEnvelope.errorLanguage" => "en_US",
'FeesPayer' => 'EACHRECEIVER'
);
is 'FeesPayer' => 'EACHRECEIVER' is enough parameter to pass to achive the above scenario. how can i check this in sandbox?

Yes, EACHRECEIVER is what you want. You can test this in the sandbox by creating multiple sandbox accounts and then setting up a payment that gets split among those receivers. When you complete that checkout in the sandbox you could then login to each receiver account and see the fee they paid.

Related

how to get refunded transactions details using payflow pro api php

I have integrated Payflow pro payment gateway into my php application and processing payment requests using Payflow as payment gateway.
I need to retrieve transaction history which includes refunds too for specific profile ID.
Below is the code that I am using: ref - (https://github.com/rcastera/Paypal-PayFlow-API-Wrapper-Class).
require_once(__DIR__.'/Class.PayFlow.php');
$PayFlowAuth = new PayFlow($Vendor, $Partner, $User, $Password, 'single');
$PayFlowAuth->setTransactionType('R');
$PayFlowAuth->setProfileAction('I');
$PayFlowAuth->setCustomField('ORIGPROFILEID', 'RP0000000XYZ' );
$PayFlowAuth->setCustomField('PAYMENTHISTORY', 'Y' );
$PayFlowAuth->setEnvironment('live');
$PayFlowAuth->processTransaction();
$response = $PayFlowAuth->getResponse();
echo '<pre>';
print_r($response);
I get below response:
Array
(
[RESULT] => 0
[RPREF] => RHX51F5D3XYZ
[PROFILEID] => RP0000000XYZ
[P_PNREF1] => BK0P6E1C2XYZ
[P_TRANSTIME1] => 19-Jun-19 04:42 AM
[P_RESULT1] => 0
[P_TENDER1] => C
[P_AMT1] => 30.00
[P_TRANSTATE1] => 8
[P_PNREF2] => BK0P6EB8DXYZ
[P_TRANSTIME2] => 21-Jul-19 04:44 AM
[P_RESULT2] => 12
[P_TENDER2] => C
[P_AMT2] => 30.00
[P_TRANSTATE2] => 1
[P_PNREF3] => BR0P6482FXYZ
[P_TRANSTIME3] => 19-Aug-19 04:52 AM
[P_RESULT3] => 0
[P_TENDER3] => C
[P_AMT3] => 30.00
[P_TRANSTATE3] => 8
)
However it does not include refunded transaction. When I search in paypal manager, I can see these 3 transactions along with 1 refund transaction too. I tried changing TRXTYPE to C (credit) but it gives the error: Invalid tender
So I am looking for any such parameter change where I can retrieve refunded transaction history or may be any method in payflow pro api.
At the end asked paypal support and they replied.
unfortunately, there is no API to get refunded transactions. I'll
contact our engineers for possible feature request. I apologize for
the inconvenience.
That is correct. Credits are issued outside of the profile so they are not tied to it and as a result do not show up when doing a PAYMENTHISTORY call.

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

Paypal Payflow refund issue

Hi am trying to create a refunding function for the paypal payflow.
This is code what exactly am created.
public function refund()
{
$this->load->helper('paypal_helper');
$request = array(
"PARTNER" => PARTNER,
"VENDOR" => VENDOR,
"USER" => USER,
"PWD" => PWD,
"TRXTYPE" => 'C',
"AMT" => '11',
"CURRENCY" => CURRENCY,
"CREATESECURETOKEN" => "N",
"SECURETOKENID" => uniqid('213'.time()),
"RETURNURL" => site_url().'test/refund',
"CANCELURL" => site_url().'test/refund',
"ERRORURL" => site_url().'test/refund',
"ORIGID" => 'A70A6DBF0A8C'
);
$response = run_payflow_call($request);
printr($response);
return $response;
}
Here ORGID is set as the PNREF what i got after the success payment.
$response = run_payflow_call($request); is defined in the helper and it just post the details in to the https://pilot-payflowpro.paypal.com/ (sandbox). But after the action i got the result like this
[RESULT] => 23
[PNREF] => A1X06F928D52
[RESPMSG] => Invalid account number
Any one can tell me why this happen ??
am using the same "PARTNER" "VENDOR" "USER" for the purchase section also. But in the purchase everything going fine. I get the success report and the amount properly credited.
To refund a transaction using the Payflow you just need to pass the below parameters :
TRXTYPE =C (value is "C" for credit )
TENDER =C ( Value can be "C" if the payment was done using the credit card or "P" if its a PayPal payment)
ORIGID = A70A6DBF0A8C( Id to refund)
AMT = Optional parameter ( If not provided whole amount will be refunded)
Secure token is not required while doing the refund .

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