Code Monkey home page Code Monkey logo

Comments (5)

mickeyreiss avatar mickeyreiss commented on August 25, 2024
  1. Deploy a merchant server with a client library implementation.
    • You can use SampleMerchantServer.
    • Modify config.yml with your API keys.
    • Run it with bundle && rackup.
  2. Configure VTClient in SampleCheckout.
    • In SCAppDelegate.m, change the merchant id and client-side encryption key on lines 53 and 54.
    • In SCViewController.m, change line 98 to point to your sample merchant server.
  3. Feel free to replace Braintree::Customer.create in app.rb line 18 or line 43 with other methods.

Let me know if you need more information, and don't hesitate to contact our support team if you ever need help.

from braintree_ios.

SugarPancakes avatar SugarPancakes commented on August 25, 2024

Hi Mickey, thanks for the help. I was able to save a card in the vault. i couldnt however simulate a purchase.

i used to code below in my app.rb, what am i doing wrong?

Thanks

get "/" do
erb :form
end

post "/card/add" do
result = Braintree::Transaction.sale(
:amount => "10.00",
:credit_card => {
:number => params[:encrypted_card_number],
:expiration_month => params[:encrypted_expiration_month],
:expiration_year => params[:encrypted_expiration_year]
},
:options => {
:venmo_sdk_session => Braintree::Test::VenmoSDK:: InvalidSession
}
)

out = {"success" => result.success?, "error" => nil}

if !result.success?
out["error"] = result.message
halt(422, JSON.generate(out))
elsif !result.customer.credit_cards[0].venmo_sdk?
out["error"] = "Card saved to Braintree vault, but could not be saved to Venmo Touch"
halt(422, JSON.generate(out))
else
out["payment_method_token"] = result.customer.credit_cards[0].token
return JSON.generate(out)
end
end

post "/card/payment_method_code" do
result = Braintree::Customer.create({
"credit_card" => {
"venmo_sdk_payment_method_code" => params[:payment_method_code],
},
})
out = {"success" => result.success?, "error" => nil}

if !result.success?
out["error"] = result.message
halt(422, JSON.generate(out))
elsif !result.customer.credit_cards[0].venmo_sdk?
out["error"] = "Card used successfully, but was not marked as Venmo Touch related"
halt(422, JSON.generate(out))
else
out["payment_method_token"] = result.customer.credit_cards[0].token
return JSON.generate(out)
end
end

from braintree_ios.

mickeyreiss avatar mickeyreiss commented on August 25, 2024

@SugarPancakes I'm not sure about this line:
:venmo_sdk_session => Braintree::Test::VenmoSDK:: InvalidSession.

What happens when you pass in the venmo_sdk_session parameter you receive from paymentViewController:didSubmitCardWithInfo:andCardInfoEncrypted:cardInfoEncrypted
or-encryptedCardDataAndVenmoSDKSessionWithCardDictionary:`

from braintree_ios.

mickeyreiss avatar mickeyreiss commented on August 25, 2024

@SugarPancakes Closing this issue for now. Let me know if you're still having trouble integrating, or feel free to email our support team for individual help.

from braintree_ios.

SugarPancakes avatar SugarPancakes commented on August 25, 2024

Thanks Mickey,

im still playing around. Will let you know if i need further assistance.
Thank you very much for your help.

Cheers,
Mous

On Tue, Feb 25, 2014 at 3:08 PM, Mickey Reiss [email protected]:

Closed #24 #24.

Reply to this email directly or view it on GitHubhttps://github.com//issues/24
.

from braintree_ios.

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.