Using Venmo Touch, I'd client side validation and post the encrypted credit card details to our application server.
Application server retrieves the params inside the post method, and posts the retrieved params to Braintree server.
<?php $result = Braintree_Transaction::sale(array(
'amount' => '10.00',
'credit_card' => array(
'number' => $_POST['encrypted_card_number'],
'expirationMonth' => $_POST['encrypted_expiration_month'],
'expirationYear' => $_POST['encrypted_expiration_year']
),
'options' => array(
'venmo_sdk_session' => $_POST['venmo_sdk_session']
)));?>
If we ignore the 'options' tag, payment is successful. Upon introducing the 'options' array with element venmo_sdk_session Braintree server doesn't responds.
I'd doubt the key spelling/case sensitive "venmo_sdk_session".
Problem is not within the code.
We need to enable Venmo Touch, Payment Method Verification on settings screen of Braintree site using our account.
Related
I am trying to pass the Stripe idempotency key to a Stripe payment intent in Laravel. The actual payments gets processed fine but I don't see the Idempotency key appear in the request (in the Stripe logs). Any guidance is really appreciated:
Code snippet below
$intent = $this->createPaymentIntent([
'amount' => $stripe_amount,
'currency' => config('services.stripe.currency'),
'payment_method' => $paymentMethod,
'transfer_data' => $transferDataArray,
"metadata" => $metaDataArray,
], [
'idempotency_key' => '**********'
]);
The idempotency key, if used, should appear in the upper section of your request log panel (green box):
The "original request" (blue box) points you to the initial request if the one you're looking at was a replay.
I'm currently setting a recurring paypal payment.
I'm not sure to understand when the first payment is done.
In my case, I want to first payment to be done when the user subscribe, and automaticaly renew after 3 month.
I'm not sure if the "INITAMT" parameter if the good way to do that.
Moreover, when I try to set the parameter "INITAMT" in sandbox, the résulting profile is always "PengindProfile"
Here is my parameters :
'METHOD' => 'CreateRecurringPaymentsProfile',
'TOKEN' => $token,
'PAYERID' => $payerId,
'USER' => $user,
'SIGNATURE' => $signature,
'PWD' =>$password,
'VERSION' => 74.0,
'PROFILESTARTDATE' => gmdate("Y-m-d\TH:i:s\Z"),
'DESC' => 'My subscription',
'BILLINGPERIOD' => 'Month',
'BILLINGFREQUENCY' => '3',
'AMT' => 10,
'CURRENCYCODE' => 'EUR',
'PAYERID' => XXX,
'MAXFAILEDPAYMENTS' => 3,
'INITAMT' => 10
And a finale question, how does the reccuring Payment works ? Paypal send the money on my account each 3 month ? It is possible to get a notification on a PHP serveur to update the subscription status ?
Thanks for your help !
I'd definitely look into using the PayPal PHP SDK instead of trying to use their REST API directly or via some minimal library. Their SDK provides much convenience working with the service and has plenty of use-case based examples including recurring billing and subscriptions.
I have a working application that makes payments via adaptive chained payments. This works fine, however I'm now implementing an IPN Listener to handle refunds. I'm testing in the sandbox.
I've confirmed that when a refund is made in PayPal directly the IPN Listener gets a refund message however I don't see any of the Variables that the document talks about regarding refund amounts.
The response I see is in the post data is:
11/Mar/2015:09:33:01] (ipn_handler) [-1-] : POST
array (
'transaction' =>
array (
0 => 'NONE',
1 => 'Refunded',
),
'log_default_shipping_address_in_transaction' => 'false',
'action_type' => 'PAY',
'ipn_notification_url' => 'http://example.com/paypal/ipn_handler.php',
'charset' => 'windows-1252',
'transaction_type' => 'Adjustment',
'notify_version' => 'UNVERSIONED',
'reason_code' => 'Refund',
'cancel_url' => 'http://example.com/paymentCancel.php',
'verify_sign' => 'AFcWxxxxxxxxxxxxxxxxxxxxwy5O5OqOKKa.xxxx',
'sender_email' => 'zakbuyer#gmail.com',
'fees_payer' => 'EACHRECEIVER',
'return_url' => 'http://example.com/paymentSuccess.php',
'memo' => 'purchase of item Gear Shift cufflink',
'reverse_all_parallel_payments_on_error' => 'false',
'pay_key' => 'AP-5KHxxxxxxxxxxxxxxx',
'status' => 'COMPLETED',
'test_ipn' => '1',
'payment_request_date' => 'Thu Mar 05 01:09:00 PST 2015',
)
I was expecting to find mc_gross and mc_currency etc.
With the data provided I can look up the transaction no problem but I can't handle if a partial refund is done.
I'm finding my information at https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables/
When working with Adaptive Payments there are actually two separate IPN listeners that need to be acknowledged.
The value that you're setting in the IPNNotificationURL parameter of your Adaptive Payments API requests is an application specific IPN. The data sent to that listener is data that an application owner might want to help track transactions that are getting run through their app, but this data is very limited in terms of actual transaction details.
To get the parameters you're expecting, IPN would need to be configured in the seller account (in this case, the refunder's account). Then when the refund takes place PayPal would send an IPN to that listener with the parameters you're expecting to see.
I'm trying to tame the PayPal API with moderate success. I use PHP for sending the request and processing the response. So far I've managed to compose a valid array containing the request parameters and send it to the Paypal for validation. The request goes through validation and returns transaction token as expected. Here's my array:
$requestParams = array(
'RETURNURL' => 'http://www.myurl.com/#success',
'CANCELURL' => 'http://www.myurl.com/#cancel',
'PAYMENTREQUEST_0_AMT' => 30,
'PAYMENTREQUEST_0_SHIPPINGAMT' => '10',
'PAYMENTREQUEST_0_CURRENCYCODE' => 'USD',
'PAYMENTREQUEST_0_ITEMAMT' => '20',
'ALLOWNOTE' => 1,
'L_PAYMENTREQUEST_0_NAME1' => 'Black kitten',
'L_PAYMENTREQUEST_0_DESC1' => 'Nice and fluffy cute guy',
'L_PAYMENTREQUEST_0_QTY1' => '1',
'L_PAYMENTREQUEST_0_AMT1' => '10',
'L_PAYMENTREQUEST_0_NAME0' => 'Ginger kitten',
'L_PAYMENTREQUEST_0_DESC0' => 'Super cute ginger dude',
'L_PAYMENTREQUEST_0_QTY0' => '1',
'L_PAYMENTREQUEST_0_AMT0' => '10'
);
THE QUESTION
I want to send the same request but to form a recurring payment. Which means I want to charge the user's PayPal account every month. I was surfing throught PayPal API docs, but the way it's written seems super confusing for me and provides no answers whatsoever.
Maybe I should just insert another parameter to the $requestParams or maybe I should compose a completely different array or what? Please assist!
I actually just wrote an article about this a few days ago. It's a pretty quick run-through of the process so if you have more questions let me know, but I'd definitely recommend taking a look as it lays out everything you'll need to do, and it does it with my class library which makes this all very simple for you.
One of the way to implement recurring payment is using Express Checkout with creation of Billing Agreement and Reference Transactions. You can find details in official documentation here and here.
I am trying to integrate Pin.net.au CC processing into my site. I am using Omnipay library to make the calls.
To not store CC details in my server, I am using the Pin.js token method.
On form submit page (after user fills in personal and CC details) javascript does a 'prevent default' and sends the data from forms (browser) straight to pin.net.au servers. Server sends a card_token in response and resubmits the form to my server.
This token is recieved successfully and I can output it in my tests.
I get into trouble when I take that token and send a purchase request to pin.net.au. According to the API docs, I need not send user and card details when I send the token (the entire point of the token, really). I send this token along with other compulsory bits like email, amount, description etc.
This works when I cURL on my terminal and I get a charge success.
However, sending this purchase/charge request using the Omnipay library, each time I get a 422 (invalid resource) that asks for the user details and CC information. It should have populated this stuff from the token I sent.
I have scoured the API docs of both Omnipay and Pin.net.au. I don't seem to be doing anything wrong. What am I missing?
Here's my charge request:
$gateway = GatewayFactory::create('Pin');
$gateway->setSecretKey('MY_SECRET_KEY');
$response = $gateway->purchase([
'email' => 'user#email.com',
'description' => 'Package',
'amount' => '99',
'currency' => 'AUD',
'card_token' => Input::get('card_token'),
'ip_address' => Input::get('ip_address')
])->send();
Finally, it shouldn't really matter but if you'd like to know, I'm using Laravel 4.
Your example request has an amount of 99, the minimum amount for a Pin Payments charge is $1 (amount = 100).
I don't think this is the problem you are referring to though, it looks like Omnipay does not support using the card_token gear. If you go look over here - https://github.com/adrianmacneil/omnipay/blob/master/src/Omnipay/Pin/Message/PurchaseRequest.php#L34 - you can see Omnipay isn't sending the card_token field with it's request, it only tries to send card details, which obviously aren't present from your example!
Perhaps you could get in touch with the Omnipay developers or write a pull request yourself!
This is fixed in Omnipay v1.0.4 - you should be able to use the token like this:
$gateway = GatewayFactory::create('Pin');
$gateway->setSecretKey('MY_SECRET_KEY');
$response = $gateway->purchase([
'description' => 'Package',
'amount' => '99.00',
'currency' => 'AUD',
'token' => Input::get('token'),
'ip_address' => Input::get('ip_address'),
'card' => ['email' => 'user#email.com'],
])->send();