Giter VIP home page Giter VIP logo

Comments (6)

jsgv avatar jsgv commented on August 10, 2024

I realized that you can add customer name via Accept.js.

var secureData = {
    cardData: {
        // ...
        fullName: fullName
    }
};
Accept.dispatchData(secureData, function(){});

But I am still unable to set customer email address.
How can I set the customer email address?

from omnipay-authorizenet.

judgej avatar judgej commented on August 10, 2024

You would normally set the email of the customer through the CreditCard object:

$creditCard = new \Omnipay\Common\CreditCard([
    'email' => '[email protected]',
]);

$response = $gateway->purchase([
    'amount' => $amount,
    'opaqueDataDescriptor' => $request->input('dataDescriptor'),
    'opaqueDataValue' => $request->input('dataValue'),
    'card' => $creditCard,
])->send();

Some more details here:

https://omnipay.thephpleague.com/api/cards/

from omnipay-authorizenet.

jsgv avatar jsgv commented on August 10, 2024

Thanks @judgej !
Yes, I do understand how to do it with a regular card purchase.

But for my case I am using Accept.js in the front end to create a token and then using the token to finalize the purchase. Not sure in which step the email address can be added. Authorize.net's documentation on their website isn't very helpful.

from omnipay-authorizenet.

judgej avatar judgej commented on August 10, 2024

It's exactly as shown: when you submit the purchase details to the gateway. You can collect those details however you like - in the original form with the Accept form, from the back-end user account, from an additional form in the process. But it's for you to do, not the Accept.JS front end. That only concerns itself with what it needs to tokenise a card.

from omnipay-authorizenet.

judgej avatar judgej commented on August 10, 2024

@jsgv Did this thread answer your question? Do we need further examples in the main README so this issue can be closed?

from omnipay-authorizenet.

jsgv avatar jsgv commented on August 10, 2024

@judgej
Yes, example above was more than enough.
Thank you.

from omnipay-authorizenet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.