Braintree - Hosted Fields PayPal amount unable to change - braintree

I am using Braintree Hosted Fields for checkout. I have added Paypal button like this
paypal: {
container: "paypal-container",
amount: 20.00,
singleUse: true,
currency: 'EUR',
}
I want the customer to enter the amount as much as he wants. I have checked the docs but unable to find how it can be done with hosted fields.
One option I have is to refresh the page once customer change the amount in the form text fields but that will wasted a lot of time.

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
One way to do this is to have a two step process. Have the user provide the amount prior to calling braintree.setup. Once they enter the value, you can call braintree.setup in javascript, using the same parameters you currently have but setting the amount parameter to be whatever the user just entered. The user can then go through the rest of the authorization flow, and you can send the amount to your server, which will be used in a Brantree.Transaction.sale call to complete the purchase.

Related

Paypal recurring payment for custom billing cycle

I am working on a website in PHP that needs custom cycle for paypal recurring payment. Ex: a customer wants to receive a product in every 15 days. So paypal should process billing in every 15 days for the customer. Others can ask for the same in 30 days, and so on.
I also need the payment status to be updated. I guess paypal will send some data when a recurring payment is done. Not getting clear instructions on implementing the recurring. What I am getting is to create the recurring payment button from paypal account.
Can anyone help me on this?
Assuming the number of days is chosen at checkout time and never changes for that particular customer's custom billing cycle...
Quick solution:
You can generate a "Subscribe" button via http://www.paypal.com/buttons for a certain number of days, say 15 days. In "Step 2", uncheck the option to save the button at PayPal. Once you have generated the code, click the option to remove the code protection.
This will give you plain HTML, and "15" will be one of the variables there. Possible variables are documented at https://developer.paypal.com/docs/classic/paypal-payments-standard/integration-guide/Appx_websitestandard_htmlvariables/
So, you can change that hidden input to be of type "text" -- or alternatively to still be hidden but set by your javascript or server-side code, and have a dynamic button for X number of days. The image can also be changed to one of your own, of course.
More involved solution: integrate one of PayPal's recurring subscription APIs, which will accomplish much the same thing as that HTML button. This seems to be the newest API: https://developer.paypal.com/docs/subscriptions/
(The API and the HTML button are separate products , and not interchangeable in terms of how you manage existing recurring profiles later on, so if you need a full-fledged API, best integrate it from day 1 rather than using the HTML button)
If the first assumption does not hold, and you need customers to be able to adjust the billing cycle at a later date after checkout, then things get more complicated.
As far as getting payment status updates, you can integrate PayPal's webhook service: https://developer.paypal.com/docs/integration/direct/webhooks/
There is also an older IPN service that is similar in function

Braintree hosted fields integration - edit existing card data

I'm using Braintree hosted fields to allow credit card payments, and users can use multiple cards.
How can I allow users to edit existing cards? For example, when a card is renewed by the bank, it keeps the same card number, but the expiration date and CVV change. I want users to be able to edit the expiration date and CVV to keep the card active. Is this possible, or does the user have to enter in a new card from scratch with the same card number?
Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support
Once your customer has their payment method stored in a Vault record you can use their associated payment method token to run a PaymentMethod.update() call. Using the payment method update you can change most attributes of the stored method, and you can find a full list of those attributes here. When updating actual card information, such as CC number, expiration date, etc. it is recommended that you generate a nonce with the new information rather than entering it manually, but either will work just fine.

What is the difference between USPS label and postage paid label

Is getting label using USPS api such as "USPS TRACKING (https://www.usps.com/business/web-tools-apis/usps-tracking-v3-3.htm)" any different than postage paid label obtained from 3rd parties such as endicia.com, stamps.com?
Is it possible to purchase prepaid postage on usps.com website, then calling the USPS label api to generate postage paid label? I mean when we call the API to generate the label, appropriate amount to be deducted from my USPS account.
I dont understand the use of the label generated by USPS API. I mean, I have activated my account at USPS and now working on production server. Now if I generate any label using the API (https://www.usps.com/business/web-tools-apis/usps-tracking-v3-3.htm), and generate a label. I didn't see any data in my history at online account. I mean, this generated label is of no value? or still my account is not activated? as I think, i have not yet done this -
reference pdf:Development-Guide-v3-1d.pdf
Step 7: Receive Printer Approval from ICCC Implementing the Delivery
Confirmation and Electronic Merchandise Return Service with Delivery
Confirmation APIs requires this additional interim step. The NCSC will
review your labels within two business days. If the labels fail the
certification test, the NCSC will contact the person listed on the
submission form directly. If the labels pass, you will be notified by
the Internet Customer Care Center and you will be able to send XML
transactions using your “live” data and receive “live” responses. Once
you are approved to generate “live” labels from the production server,
and you need to print additional test labels for any reason, be sure
to use the “Sample” XML request. Otherwise, the USPS will send a
manifest of the PIC numbers issued to the USPS Postal Tracking System
and will be looking for the Delivery Confirmation labels to scan.
Does, receiving "Printer Approval" will solve my issue?
Answers to your questions are below:
It's different in that you're ordering through a 3rd party provider, but not different in that you're paying the same amount for a shipping label, and that shipping label has a value and can be used in the USPS system. This holds for Stamps, Endicia, and other 3rd party API integrations like Easypost
You should be able to do that entire action through the API.
Did you check back on your account? This information should definitely update in your account. Unless you are using an API key that's tied to a different USPS account?
Let me know, happy to help further.
If you want an api that prints postage, use Shiprush or another developer tool that is made to generate complete, ready to use shipping labels.
Labels generated using the API DeliveryConfirmationV4 do not include postage. Per the documentation,
Please note that the API labels are printed without postage. Postage
must be purchased and applied separately.
See https://www.usps.com/business/web-tools-apis/delivery-confirmation-domestic-shipping-label-api.pdf

What is an accepted way to submit form data to sites like paypal?

I'm setting up a website that uses paypal to process payments.
The easiest way to implement the checkout form would be to create an HTML form that submits directly to paypal, sending the order details and redirecting the user to paypal in order to finalize the transaction.
However, there is a security vulnerability with this process. The client could edit the information submitted to paypal, such as changing the price of the checkout to $0.00.
What is an accepted way to handle this type of situation? Is it to submit the form back to my server, then do some processing in PHP, then submit verified data to paypal and redirect the user to paypal? Is this possible?
Thanks!
There are two main ways to handle this issue.
The first is somewhat like what you outline: You send the filled in form to PayPal, and provide a callback-url. When PayPal has processed the payment, they will call your provided url, and you can check whether or not the information given in that call is the same as what you provided. For this to work, you need to store the information in the meantime, like in a database. You will then only give access to the product after the validation has happened.
You can also encrypt the information you send to PayPal, making it practically impossible to alter information in your form.
See https://www.x.com/developers/paypal for details.

How to void authorized transaction in authorize.net gateway using ActiveMerchant

Goal: Only have successful purchases show up on a customer's billing statement. I don't want declined authorizations showing up on their billing statement (as seen in an online banking system) as pending. A customer often will accidentally input an incorrect billing address, for example, followed by a correct one. Together, the two attempts, one successful and one not both show up on their billing statement as pending prior to settlement. This can scare the customer as it looks potentially like they will be charged twice.
Details: When I do an AUTH_CAPTURE (via ActiveMerchant's purchase) or an AUTH (via ActiveMerchant's authorize) which is declined and subsequently want to void that authorization (via ActiveMerchant's void) so as not to have it appear on a customer's billing statement as pending (even though it will settle out after a few days), the gateway can't find the transaction to void using the authorization code returned from the authorization or capture method calls on the gateway.
This is specific to the authorize.net AIM gateway.
Please advise.
Thanks!
If I understand your question correctly, I'm not sure there is a way to do what you want.
This is a limitation of the gateway / merchant account system.
I just stayed at a hotel this past weekend, and when I checked in I was warned that an 'authorization charge' would appear on my card and then go away. The hotel situation is similar to what you are dealing with, and I don't think there is a way around it. Gas stations do it, restaurants, hotels, etc.
It's so common that I wouldn't worry about customers being alarmed. You might put a statement on your payment form saying something about an authorization charge - I've done that in the past on projects.
And for the auth.net specifics - I'm pretty sure you cannot void an auth, thus the error you are getting. The auth code returned is used later on to capture the amount, if needed.

Resources