Deciding on customer id and saving payment method after transaction in Braintree - braintree

I would like to have the following workflow on our website with Braintree payment gateway: a customer which is or isn't logged in pays with a credit card (using Braintree hosted fields). If the payment is successful and customer is not logged in, we offer him to login or register in order to save the payment method.
Unfortunately, that means that in Transaction.sale I cannot use the existing customer id, since the customer is not yet logged in our system. And after the transaction is complete, I cannot reuse payment nonce to create payment method and assign it to our customer.
One possibility I am considering is to always vault the payment method during transaction (with a new Braintree customer id) and than to assign this customer id to our user's account if he logs in. However, that can result in one user having multiple Braintree customer ids which would complicate later payments with saved cards. (Plus I have to vault a lot of fake customers and payment methods that will never be used again since majority of our customers never create user accounts.) Is there a better way?

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
You are correct. To achieve this flow you would need to create a new customer and payment method each time. The good news is that Transaction.sale does not require a customer id, just a payment method token, so you can associate the payment method token with your app's customer id and you won't need to maintain a relation to the customers in the Braintree control panel.
For clean up, you could do the following:
1) If the user declines the option to save the payment method, delete the customer and payment method token immediately.
2) If the user closes the application without making a decision one way or the other, you could have a periodic process to clean up unclaimed customers and payment method tokens.

Related

Laravel - Paypal user to user money transfer

i have a donation website where users post their cases and any other user can donate to them, i want to implement paypal integration but my question is what do i write in the paypal clientid and secret key if the receipient is different for each case? every tutorial i see, it has a fixed receipient so they just write the clientid of their merchant account, but in my website there is no fixed receipient as each user that posts a case can receive donations.
sorry if my question is too basic but this is my first time working with paypal. any help is really appreciated!
For payments directly to another account, there are two different integration options:
Checkout flow :: specify the payee.email_address of the recipient's PayPal account when creating the order. See the documentation.
Donation flow :: specify the recipient account as the business parameter. See the documentation. Do not specify a hosted_button_id. Specifying a fixed amt is optional.

Is there any way to use same payment method for multiple user subscription in laravel cashier?

In my laravel project I have one super admin and many users. Super admin need to pay the subscription amount of each user using cashier.
I tried to subscribe for each users using the payment method of super
admin it doesn't support.
I tried to add payment method of super admin to all the users it
doesn't support.
I am trying to buy multiple quantities product in super admin account using $user->subscription('default')->incrementQuantity(5); but I don't know how to allocate this purchased quantity to another user according to cashier concept.
Or is there any other method to use same payment method for multiple user subscription(except simple charge)

Magento Paid user registration for Customer Group

I have different types of Customer group (General, School, Publisher, Corporate). Customer select our Customer group on registration page from frontend.
But I need charge some amount ($100) when customer register as Publisher.
Please give any suggestion that how to implement.
Thanks.
If you want to charge a particular customer group for registration,
Rough flow will be as follows :
Catch an event at the <customer_register_success> observer.
Fetch Customer Model from observer event data.
Inspect if the customer's group belongs to "Publisher"
If it's Publisher, redirect them to checkout, you may provide payment option for this.
If the publisher is successful at payment, you need to remove pending status from his registration
Return to registration success page.
Notes.
You need to create virtual product for registration fee.
You need to create a pending step similar to confirmation email before the target customer group user activation

How do I login with PayPal to save user_id?

Is it possible to use a "login with PayPal" button through the PayPal API? I want to use it as a twitter signin to link your paypal account once to the app, then have it store a user_id.
Is this possible?
I want some kind of 'connect to paypal' behaviour. Think about a shop where goods are sold and get paid to the shop onwers paypal account. The shop owner must verify (connnect) once his paypal account and the app will then know where all payments must go.
It is also possible to just ask for the shop owners paypal email account, but this ain't really low level in my opinion.
If this even was posssible to do I wouldn't do such a thing for authentication.
The reason is, the user could easily assign that he has to pay for every login with this procedure.

PayPal Money Request automation in mvc 3

I have a button on my page (ASP.NET MVC 3) redirecting to the PayPal service.
I want to automate some process in my system, and I want to allow users to send the Money Request using PayPal.
But, is it possible to pass to the PayPal service (via URL ?) the Recipient's email address, amount and Request payment type (Goods/Services) ?
After the user is logged in, all that fields will be filled in. I'm totally new with that scenario, is it possible ?
You need to create a checkout form in your site and use paypal IPN.
When you create the check out form, you need to store in your database all the values the user gives you. Then send paypal the information you want using the IPN.
The IPN will come back telling you that the transaction was approved or not.
Here is a good tutorial.

Resources