Active merchant and Paypal API for recurring payment - ruby-on-rails

I have few questions on paypal's recurring payments, I went trough the paypal documentation to find some answers but, it didn't help me much.
Here are the stuffs that I need to know, hope someone can help me on these.
I'm using paypal's standard payment account. So far I managed to create recurring payments with paypal by posting NVP's to paypal from merchant website to paypal.
Now I need to show recurring payment profiles on merchant web site. So that customers can cancel, modify recurring payments from merchant website without redirecting to paypal.Is this possible?
Think I should use paypal's SOAP API for this as I can't get the job done with NVP API. So I installed active merchant as described in this post. But I always get an error
This transaction is invalid. Please
return to the recipient's website to
complete your transaction using their
regular checkout flow.
from paypal and it never send me the token back.
Also I got this on my log
Security header is not
valid
Is it because I use sandbox API credentials or is it because I can't use paypal's standard account with SOAP API?

Usually the "security header is not valid" response comes from using sandbox credentials in the live environment or vice-versa. AM will use the sandbox when your Rails app is in development mode, so be sure you are using the right set of credentials.
When I was integrating PayPal's recurring payment profiles into the SaaS Rails Kit (using ActiveMerchant) I ended up just canceling a user's current profile and creating a new one when they wanted to change their subscription.

Related

How to send payment to the customer from Stripe account using API in Rails?

One of my client Ruby on Rails project have a functionality of get payment from customer in his stripe account.
Now, He needs to pay that payment to the item owner after deducted commission. So, how we can pay from stripe account to particular customer account using API in Rails?
I have checked many API's but not clear which exactly use for it.
Any one have a idea or experience in it?
Thanks
See the Stripe guide on Using Checkout with Rails.
I am not positive if a customer token can be used to send funds to, but if so or not, the following still applies.
If the customer has a connected account (or customer token), you can then use "transfer" to transfer the funds to them.

ios Stripe payment(Account to Account Transfer)

I am making an application in Objective-C(iOS). I want to transfer some amount from my account to the other account using my application.
Case: The transfers will be user specific.
1.There will be a user who will post his need for money.
2.The other person who wants to help him will contact him in personal chat.
3.There will be a payment option from where the donator will send money to the person in need.
Please help if anybody is having knowledge about it, as I haven't worked with stripe before.
Thanks in advance.
The first step would be setting up Stripe
https://www.youtube.com/watch?v=NdszUvzroxQ
The tutorial uses Heroku which handles the backend side of the payments.
Here is the documentation https://devcenter.heroku.com
Just incase you're looking for a way to do this with Firebase, check out my answer here Swift Firebase Stripe Connect
The next step would be altering your Stripe project to work for Stripe Connect
The documentation for Stripe connect is here https://stripe.com/docs/connect
You basically need to setup your account to allow for users to sign up as 'Connected accounts' that can receive payments. Your stripe account takes the payment and then dishes out to the connected account accordingly, it needs to be setup in the node server.
Stripe has an example project that uses Stripe connect which is what you're looking for, this handles marketplace style payments.
Take a look at their project. The concept is that users can sign up online and be accepted for payments.
Here is the project https://github.com/stripe/stripe-connect-rocketrides
and the demo website https://rocketrides.io

How to do payment using stripe

I am using Stripe to make payment in my application. I got the token Successfully.
I want to know that how the charges will be done, as there is no changes reflected in my Stripe dashboard. I'm using my Stripe Account TestPublish Key.
Tokens only represent a card or payment method, not an actual transaction.
Once you've collected and tokenized a customer's payment information, you need to send the token to your backend server so you can use it in an API request, e.g. a charge creation request or customer creation request.
You can find more information in this tutorial: https://stripe.com/docs/charges
Common error - you need to test on a real device, not the simulator. Just one of the gotchas of the Stripe API.

Credit card payments via PayPal REST API without being PCI-compliant

Can't understand which PayPal API to use.
I have Rails app and I'd like to accept credit card recurring payments via PayPal. At first I was thinking to use Express Checkout API that supports recurring billing and can work even if a user doesn't have PayPal account. But then I saw that their official ruby gem merchant-sdk-ruby https://github.com/paypal/merchant-sdk-ruby will be deprecated:
This Classic SDK is not actively supported and will be deprecated in
the future. For full support on new integrations, please use the Ruby
Rest SDK
So I don't want to use something that will be deprecated soon. But I can't understand whether I can use REST API to accept credit cards without being PCI-compliant.
I'd like to redirect user to PayPal where he could enter his credit card info and return back to my site like in Express Checkout, but I see only examples where credit card info is collected on my site and passed to PayPal via API that implies more security headache on my site.
UPD: I found some information regarding this question in Accept a PayPal payment section of REST API documentation that is a bit odd because I expected to find it in Accept credit card payments section. They say:
Important: To receive Guest Checkout payments, which allow credit cards, ensure that PayPal Account Optional is enabled on your account
settings. For example, here is the path for US accounts:
Profile > My selling tools > Website preferences > PayPal Account Optional
But I'm still not sure whether it will work in my case. Now I have the following question:
Can I use Guest Checkout feature to accept recurring payments?
Can I test Guest Checkout in Sandbox? And if I can what credit card number to use?
Can I show by default form for entering credit card info when user gets to the PayPal site rather than for entering PayPal credentials?
Ughh... why it is so complicated?
There are couple of samples in PHP code, that could help you understand recurring payment options in REST API.
https://github.com/paypal/PayPal-PHP-SDK/tree/master/sample/billing
Or you could follow up the docs on : https://developer.paypal.com/webapps/developer/docs/api/#billing-plans-and-agreements
I will look into this specifically and get back to you
For trying it out on sandbox, you can create an account here at https://developer.paypal.com/webapps/developer/applications/myapps You need to create an app, and it would generate a valid credit card for you.
This may be very unlikely to do, but I can ask the internal team if they know of any such option.
Railscast #289 is on this. It requires that you sign up for the pro version. Looks pretty involved but he walks you through it.

Migration Questions from Paypal MPL to PaypalMobile iOS SDK

We are migrating from MPL to Paypal Mobile iOS SDK and we have what you call classic app. We could not find the migration guide and are having following questions.
The new sdk needs client id. Is the client id same as API Key?
According to the guide
"You need two credentials:
clientId: Available on the PayPal developer site.
receiverEmail: Your PayPal account email address
These are used to identify you as the recipient of payments. Both are public credentials; there is no need to attempt to obscure them or keep them private.
Important The receiverEmail should match the account used to get your client_id and secret."
We are not a receiver. We only facilitate payments between our users. Also we don't have a secret key. How do we let our users pay to other users?
In our app, user can pay their peers and also service providers. How do we make the distinction?
Your help is really appreciated!
Josh from PayPal here.
The PayPal iOS SDK does not currently have support for peer to peer payments.
The client_id is not the same as an API Key. You can get one from the PayPal developer website.
If you don't need support for direct credit card payments (sender has no PayPal account) you don't need the client_id. There is an option in the SDK to suppress direct credit card option. All you need to do is pass the payee's email address when initializing PaymentViewController. You can see the code snippet at https://developer.paypal.com/webapps/developer/docs/integration/mobile/ios-integration-guide/.

Resources