Comments (5)
- 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
.
- 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.
- In
- Feel free to replace
Braintree::Customer.create
inapp.rb
line 18 or line 43 with other methods.- For example, you can simulate a purchase with
Braintree::Transaction.sale
- For example, you can simulate a purchase with
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.
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.
@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.
@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.
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]:
Reply to this email directly or view it on GitHubhttps://github.com//issues/24
.
from braintree_ios.
Related Issues (20)
- Make errors public HOT 4
- Apple Review Rejection for saving the payment method for future transaction HOT 1
- BTVenmoClient `tokenize` async method leaks memory and does not return/throw an error when the user cancels the authorisation. HOT 5
- PayPalDataCollector.h HOT 4
- fetchPaymentMethodNonces in BTAPIClient return wrong nonce types HOT 4
- Staging URLs present in production code - Security Issue - For our Customer HOT 18
- Error on pod install after the release of Braintree version 6.8.0 HOT 5
- Unable to Publish Build to App Store with Xcode 15.0 HOT 7
- Unable to Use The Package HOT 5
- policy required: Xcode15 requires Privacy Manifest HOT 22
- V6 Migration guide has incorrect system requirement HOT 2
- Production Access HOT 1
- Better Error Handling HOT 3
- BTThreeDSecureClient.initializeChallenge never completes HOT 3
- Expose SDK struct definitions to consumer apps to enable overridability exclusively for writing unit tests. HOT 4
- ErrorCode 2 and ErrorMessage is 無法完成作業。forbidden HOT 3
- Archiving using Xcode 15.3 Fails Due when Including PPRiskMagnes.framework (minimum OS Version specified in the Info.plist) HOT 17
- Command SwiftCompile failed with a nonzero exit code HOT 3
- 📣 Upgrade your integration to continue accepting Braintree payments HOT 3
- Expose `prefersEphemeralWebBrowserSession` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from braintree_ios.