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

GraphQl Support #242

Open
wants to merge 4 commits into
base: master-2.x
Choose a base branch
from

Conversation

shreyas-codes
Copy link

Razorpay GraphQl Extension

This is the Order Flow for placing Magento Order using razorpay with graphql

  1. set Payment Method on Cart
mutation {
  setPaymentMethodOnCart(input: {
      cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"
      payment_method: {
          code: "razorpay"
      }
  }) {
    cart {
      selected_payment_method {
        code
      }
    }
  }
}
  1. Create Razorpay Order against the cart total(just after the final placeorder button click)
mutation {
  createRazorpayOrder (
    cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"
  ){
    success
    rzp_order
    order_id
    amount
    message
  }
}
  1. Generate Payment from the Frontend/React/using razorpay's checkout.js & obtain razorpay_payment_id & razorpay_signature

  2. Save Razorpay Response Details against Cart after payment success

mutation {
  setRzpPaymentDetailsOnCart (
    input: {
      cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"
      rzp_payment_id: "pay_GmVq2o9VzEQkPL"
      rzp_order_id: "order_GmVovQtWtOsquw"
      rzp_signature: "c95c961f7f4682e932f8dfc7d52e87c5f0dff43bce81efa86ad80a7c808983b7"
    }
  ){
  cart{
    id
  }
  }
}
  1. Finally Place Magento Order
mutation {
  placeOrder(input: {cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"}) {
    order {
      order_number
    }
  }
}

Ram Prakash Singh and others added 3 commits March 10, 2021 21:14
## Razorpay GraphQl Extension

This is the Order Flow for placing Magento Order using razorpay with graphql 

1. set Payment Method on Cart
```
mutation {
  setPaymentMethodOnCart(input: {
      cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"
      payment_method: {
          code: "razorpay"
      }
  }) {
    cart {
      selected_payment_method {
        code
      }
    }
  }
}
```

2. Create Razorpay Order against the cart total(just after the final placeorder button click)
```
mutation {
  createRazorpayOrder (
    cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"
  ){
    success
    rzp_order
    order_id
    amount
    message
  }
}
```

3. Generate Payment from the Frontend/React/using razorpay's checkout.js & obtain razorpay_payment_id & razorpay_signature

4. Save Razorpay Response Details against Cart after payment success 
```
mutation {
  setRzpPaymentDetailsOnCart (
    input: {
      cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"
      rzp_payment_id: "pay_GmVq2o9VzEQkPL"
      rzp_order_id: "order_GmVovQtWtOsquw"
      rzp_signature: "c95c961f7f4682e932f8dfc7d52e87c5f0dff43bce81efa86ad80a7c808983b7"
    }
  ){
  cart{
    id
  }
  }
}
```
5. Finally Place Magento Order 
```
mutation {
  placeOrder(input: {cart_id: "F8MruNi2R7tiZqo8Pkglxaz370VrUnCu"}) {
    order {
      order_number
    }
  }
}
```
@shreyas-codes
Copy link
Author

@ramth05 Please review.

@ramth05
Copy link
Contributor

ramth05 commented Mar 24, 2021

@ramth05 Please review.

@shreyas-codes, can you please add your change in this #240

@shreyas-codes
Copy link
Author

@ramth05 Please review.

@shreyas-codes, can you please add your change in this #240

Done. Did you check it ?

@ramth05
Copy link
Contributor

ramth05 commented Mar 26, 2021

@ramth05 Please review.

@shreyas-codes, can you please add your change in this #240

Done. Did you check it ?

@shreyas-codes , didn't find any new commit in this PR #240 from your side. you can merge/push your changes in this branch GraphQL_addition

@ramth05
Copy link
Contributor

ramth05 commented May 5, 2021

using #240, changed added in base PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants