I'm using the stripe api with php, and the basic process is as follows:
Submitted with the payment form and a stripe token is created via php stripe sdk.
If the customer exists in the local database, I grab their customer_id and fingerprint. Otherwise a new customer is created using the token as the source/card.
If the customer and same fingerprint exists in the local database, if the token object response fingerprint and my local database fingerprint different means.
I retrieve the customer details using existing customer id and I create a new card using customer source create api($customer->sources->create(array("source" => "tok_18hAe4DdoStEhOoYr2TTQlaL")); ).
Card creation time: how can I validate cvc, expmonth and year?
Yes, you can create multiple cards with a single customer in Stripe.
To validate the basic card details you can use Stripe.js library. It by default check for CVC, expiry date, and card details. A user is not allowed to enter wrong details.
If you are creating token directly from backend code then still Stripe verify the details and not return's the token in case of wrong details.
Backend and js also checking cvc length only .
Example: If i put my real card details and cvc for 123 means stripe returning the token object.
Related
Our implementation is as follows:
Authorize a credit card associated with Google Pay. Get the nonce.
Using the nonce received, create a Customer account. Save the token for future reference.
Complete transaction using saved token.
The question is how to validate the token before starting a new transaction. Token verification is important because, transaction happens after a few days from customer creation.
Tried Braintree\CreditCard::find($token). This worked for customer accounts created with a credit card. Since we are using a nonce from Google Pay instead of Credit card, it will return a message of:
credit card with token $token not found
How to validate a token in above case?
PaymentMethod::find() will resolve the problem
Reference
https://developers.braintreepayments.com/reference/request/payment-method/find/php
I have an issue with Braintree,
Suppose a customer logged in on my site, then I create client token for that customer (By passing customer id in Braintree\ClientToken::generate() function ),
so that if he have any existing payment method then it will be loaded automatically at client side.
But if customer selects new payment method which already in vault:
for card same card number, for Paypal same email address,
then it automatically added in vault for that customer, either it exists or not,
So in my case, i don't want to store same payment method(either Paypal or Card) twice or more for same user,
How can i restrict so that same payment method should not store multiple times in vault?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact
support.
There is actually a parameter you can set in the Client Token generate options called failOnDuplicatePaymentMethod. If this option is passed as True and the payment method has already been added to the Vault, the request will fail. This can only be passed if a customer_id is passed as well. If the check fails, this option will stop the Drop-in from returning a payment_method_nonce. Unfortunately, this will not work for Paypal Payment methods, and there are a few workarounds for that.
Not Storing in the Vault
You would first need to collect the customer's PayPal email account in the client-side callback. When the payment type is a PayPalAccount , you can then run a Braintree::Customer.search() request on the user's email. If this brings up any customers that have the PayPal email account you specified (which was retrieved from the client-side integration), you wouldn't need to vault the account, you can simply proceed with creating another transaction on the existing token.
Deleting Duplicate Accounts
The second workaround is similar to the first.You collect the customer's PayPal payment method as usual (collect the nonce and pass it to your server) and then use it in a Braintree::PaymentMethod.create or Braintree::Customer.create API request as usual. In the result object returned, you can then check the details of this PayPal transaction, paypal_details and inspect this to find the email address. If this email matches one for a PayPal account for that customer, you can choose to delete the new payment method immediately.
Don't hesitate to reach out to Braintree Support if you need more help.
Hi i have been using stripe for the first time in my project where i ask user to provide their Credit card details for payment & i generate stripe token and charge the customer. I have provided a checkbox where customer can save the card details for future transactions & the requirement by the client is that if checkbox is checked, the details have to be saved once the payment successfully done. I am only getting the stripeToken in the processing via POST method and not the card details. Is it possible to get the card details back from the stripeToken in programming way or what can be an equivalent & convenient option to do it?
I tried adding the name attribute to the fields required by stripe for the token generation but in the form POST it is coming empty.
Stripe Only provides the Last 4 Digits of the card .
You can save the CustomerId provided by the Stripe API that can be used later for payments,
When the checkbox is checked you can use the token to create a new customer (or update if it already exist ).
Into the link of #vher2 you can find an example to follow.
EDIT:
Inside the token generated from Stripe.js do you have all the information you need. See the Example Response into Api Stripe of token creation.
there I would like to create a customer on stripe without the user entering their card information to begin with. When a user signs-up to my website, i would like them to also have an account created with stripe. I want information such as address to be stored on stripe from signing up on my website. So when the user does want to purchase an item the information can then be retrieved from stripe. How can I do this.
Stripe is for processing payments. It isn't a customer management platform.
If you want to store user information like addresses prior to taking payments through Stripe, you'll need to store them yourself.
I need to integrate PayUMoney for my freelancer job portal, which is developed in PHP Codeigniter.
There are 3 types of user :
1) Employer (Job provider)
2) Freelancer (Person who's doing the job)
3) Broker (the portal takes commission for the transaction)
Currently the employer transfers fund to broker then broker transfers to freelancer. I need to transfer amounts from employer to freelancer directly by transferring the commission to the broker ? With this transaction the broker can get the commission and he doesn't need to track the balances and transfer to freelancer .
In order to set up Payu Gateway with your codeigniter application you need to follow the following steps :
Go to http://test.payumoney.com
Signup as a merchant and use any of your valid email address.
Complete the Business Details and Bank Account Details, you can use any random values as they are not going to verify it.
Go to Seller Dashboard -> Setting -> My account -> Profile Settings and note down the merchant Id
Now go to Seller Dashboard -> Setting -> My account -> Merchant Key Salt and email the Merchant Id to the email Id provided at that screen asking for Merchant Key Salt.
You can also download the payu money integration kit for php and modify the code provided in that kit according to your website
You can simply replace your test keys with the real ones provided to your customer on behalf of their bank account details after verification.
Some issues that might occur while submitting form will be regarding the product info field, make sure that the value field in the product info sums up to the total amount of transaction.
P.S. The product info is in the form of JSON.
NOTE : For breaking the amount you can modify the productInfo(required) parameter into which is in the form of JSON data providing the name and value key-value pairs. Also make sure that the sum of the value keys is equal to the total amount of transaction.