Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connector): [Braintree] Add Authorize, Capture, Void, PSync, Refund, Rsync for Braintree GraphQL API #1962

Merged
merged 34 commits into from
Aug 24, 2023

Conversation

prasunna09
Copy link
Contributor

@prasunna09 prasunna09 commented Aug 17, 2023

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

Add Authorize, Capture, Void, PSync, Refund, Rsync for Braintree GraphQL version. Now we support both older version and newer version using config. A new field introduced in router data, where the value is being fetched from this config with key - "is_connector_new_version_braintree" with value true- GraphQL version(newer one) and false - Older version.

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

Payment Autocapture -
Screen Shot 2023-08-17 at 3 06 06 AM

Payment Manual Capture -
Screen Shot 2023-08-18 at 2 57 25 AM

Capture -
Screen Shot 2023-08-18 at 2 57 39 AM

PSync -
Screen Shot 2023-08-17 at 3 06 48 AM

Refund -
Screen Shot 2023-08-17 at 3 07 03 AM

RSync -
Screen Shot 2023-08-17 at 3 08 50 AM

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@prasunna09 prasunna09 added A-connector-integration Area: Connector integration A-core Area: Core flows C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Aug 17, 2023
@prasunna09 prasunna09 added this to the August 2023 Milestone milestone Aug 17, 2023
@prasunna09 prasunna09 self-assigned this Aug 17, 2023
@prasunna09 prasunna09 requested review from a team as code owners August 17, 2023 18:26
@prasunna09 prasunna09 added the M-configuration-changes Metadata: This PR involves configuration changes label Aug 17, 2023
@AkshayaFoiger AkshayaFoiger requested review from AkshayaFoiger and removed request for AkshayaFoiger August 24, 2023 05:25

Ok(request)
let connector_api_version = req.connector_api_version.clone();
if connector_api_version == Some("v2".to_string()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's move this to a method and reuse


match item.request.payment_method_data.clone() {
api::PaymentMethodData::Card(_) => {
const CHARGE_CREDIT_CARD_MUTATION: &str = "mutation ChargeCreditCard($input: ChargeCreditCardInput!) { chargeCreditCard(input: $input) { transaction { id legacyId createdAt amount { value currencyCode } status } } }";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keep this globally

jarnura
jarnura previously approved these changes Aug 24, 2023
@ArjunKarthik ArjunKarthik added S-ready-for-merge and removed S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Aug 24, 2023
@ArjunKarthik ArjunKarthik added this pull request to the merge queue Aug 24, 2023
Merged via the queue into main with commit 820f615 Aug 24, 2023
10 of 12 checks passed
@ArjunKarthik ArjunKarthik deleted the braintree-cards-refactor branch August 24, 2023 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-connector-integration Area: Connector integration A-core Area: Core flows C-feature Category: Feature request or enhancement M-configuration-changes Metadata: This PR involves configuration changes
Projects
No open projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

5 participants